### Question:
SystemPropertyDAO extends DefaultDAOBase<Integer, SystemProperty> { public SystemProperty findByName(String name) { Criteria criteria = createCriteria(equalsName(name)); criteria.addOrder(Order.asc(SystemProperty.NAME_PROPERTY)); List<SystemProperty> result = getResultList(criteria); return result.isEmpty() ? null : result.get(0); } SystemPropertyDAO();  SystemPropertyDAO(EntityManager entityManager); boolean existsAnyWithName(String name); boolean existsAnyOtherWithName(SystemProperty systemProperty, String name); SystemProperty findByName(String name); List<SystemProperty> findByComponent(String component);  }### Answer:
@Test public void test_findByName() { SystemProperty systemProperty = createUniqueEntity(); systemProperty.setName("Some name"); ds().persistAll(systemProperty); SystemPropertyDAO dao = createDaoForRollbackTransaction(); SystemProperty found = dao.findByName("Some name"); assertEquals(dao.findByName("UNEXISTING_NAME"), null); eg().assertAllPropertiesEqual(systemProperty, found); }