AssignmentConfigDaoImpl implements AssignmentConfigDao { @Override @Transactional(rollbackFor = Throwable.class) public void deleteAll() { Query query = getSession().createQuery("DELETE from AssignmentConfig"); query.executeUpdate(); }  @Autowired @Qualifier("assignmentSessionFactory") void setSessionFactory(SessionFactory sessionFactory); @Override List<AssignmentConfig> getAll(); @Override @Transactional(readOnly = true) AssignmentConfig getAssignmentConfig(String key); @Override @Transactional(rollbackFor = Throwable.class) void save(AssignmentConfig assignmentConfig); @Override @Transactional(rollbackFor = Throwable.class) void saveAll(List<AssignmentConfig> assignmentConfigList); @Override @Transactional(rollbackFor = Throwable.class) void delete(AssignmentConfig assignmentConfig); @Override @Transactional(rollbackFor = Throwable.class) void deleteAll();  }
@Test public void deleteAllTest() { Date date = new Date(); AssignmentConfig retrievedAssignmentConfig = _dao.getAssignmentConfig("lastUpdatedTest"); assertNull(retrievedAssignmentConfig); AssignmentConfig assignmentConfig = new AssignmentConfig("lastUpdatedTest", getDateAsString(date)); _dao.save(assignmentConfig); retrievedAssignmentConfig = _dao.getAssignmentConfig("lastUpdatedTest"); assertNotNull(retrievedAssignmentConfig); _dao.deleteAll(); retrievedAssignmentConfig = _dao.getAssignmentConfig("lastUpdatedTest"); assertNull(retrievedAssignmentConfig); }