### Question:
InitiatorMappingDAO extends DefaultDAOBase<Integer, InitiatorMapping> { public InitiatorMapping findByVolumeAndInitiator(final Integer idVolumeManagement, final String initiatorIqn) { Criteria criteria = createCriteria(Restrictions.eq("volume.id", idVolumeManagement)).add( Restrictions.eq("initiatorIqn", initiatorIqn)); Object obj = criteria.uniqueResult(); return (InitiatorMapping) obj; } InitiatorMappingDAO();  InitiatorMappingDAO(final EntityManager entityManager); InitiatorMapping findByVolumeAndInitiator(final Integer idVolumeManagement,
        final String initiatorIqn); List<InitiatorMapping> findByVolumeId(final Integer idVolume);  }### Answer:
@Test public void testfindByVolumeAndInitiator() { InitiatorMapping m = eg().createUniqueInstance(); List<Object> entitiesToPersist = new ArrayList<Object>(); eg().addAuxiliaryEntitiesToPersist(m, entitiesToPersist); persistAll(ds(), entitiesToPersist, m); InitiatorMappingDAO dao = createDaoForRollbackTransaction(); String initm = m.getInitiatorIqn(); Integer idVm = m.getVolumeManagement().getId(); InitiatorMapping im1 = dao.findByVolumeAndInitiator(idVm, initm); assertNotNull(im1); eg().assertAllPropertiesEqual(m, im1); }