예제 #1
0
 @Test(expected = HibernateException.class)
 public void testDeleteDataKO() {
   // Setup
   Person input = new Person();
   doThrow(new HibernateException("")).when(session).delete(input);
   // Action
   dao.deletePerson(input);
 }
예제 #2
0
 @Test
 public void testDeleteDataOK() {
   // Setup
   Person input = new Person();
   // Action
   dao.deletePerson(input);
   // Test
   verify(factory, times(1)).getCurrentSession();
   verify(session, times(1)).delete(input);
 }