@@ -0,0 +1,1696 @@
+package com.sunRays.dao;%0A%0Aimport org.hibernate.SessionFactory;%0Aimport org.hibernate.classic.Session;%0Aimport org.junit.Assert;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.mockito.Mockito;%0Aimport org.powermock.reflect.Whitebox;%0Aimport com.sunRays.model.MenuItem;%0A%0Apublic class MenuItemDaoImplTest %7B%0A%09MenuItemDaoImpl midi;%0A%09SessionFactory mockSessionFactory;%0A%09Session mockSession;%0A%09@Before%0A%09public void setUp()%7B%0A%09%09//Mock SessionFactory & Session%0A%09%09mockSessionFactory=Mockito.mock(SessionFactory.class);%0A%09%09mockSession=Mockito.mock(Session.class);%0A%09%09Mockito.when(mockSessionFactory.getCurrentSession()).thenReturn(mockSession);%0A%0A%09%09midi=new MenuItemDaoImpl();%0A%09%09Whitebox.setInternalState(midi, SessionFactory.class, mockSessionFactory);%0A%09%7D%0A%09@Test%0A%09public void testGetInteger()%7B%0A%09%09Integer menuId=2;%0A%09%09MenuItem menuItem = new MenuItem();%0A%09%09menuItem.setMenuId(menuId);%0A%09%09%0A%09%09Mockito.when(mockSession.get(MenuItem.class,menuId)).thenReturn(menuItem);%0A%09%09MenuItem actualMenuItem = midi.get(menuId);%0A%0A%09%09//MenuItem expectedMenuItem=new MenuItem();%0A%09%09//expectedMenuItem.setMenuId(menuId);%0A%09%09%0A%09%09//Assert.assertEquals(expectedMenuItem, actualMenuItem);%0A%09%09Assert.assertEquals(menuItem, actualMenuItem);%0A%09%7D%0A%09%0A%09@Test%0A%09public void testUpdateMenuItem()%7B%0A%09%09Integer menuId=2;%0A%09%09MenuItem expectedMenuItem = new MenuItem();%0A%09%09expectedMenuItem.setMenuId(menuId);%0A%09%09midi.update(expectedMenuItem);%0A%09%09%0A%09%09Mockito.verify(mockSession).saveOrUpdate(expectedMenuItem);%0A%09%7D%0A%09%0A%09@Test%0A%09public void testDeleteMenuItem()%7B%0A%09%09Integer menuId=2;%0A%09%09MenuItem expectedMenuItem = new MenuItem();%0A%09%09expectedMenuItem.setMenuId(menuId);%0A%09%09midi.delete(expectedMenuItem);%0A%09%09%0A%09%09Mockito.verify(mockSession).delete(expectedMenuItem);%0A%09%7D%0A%7D%0A

test added