### Question:
MenuDao extends BaseDao<Menu> { public List<Menu> findByModule(String names) { Criteria criteria = currentSession().createCriteria(Menu.class); criteria.add(Restrictions.eq("module", names)); criteria.addOrder(Order.asc("index")); return list(criteria); } @Inject  MenuDao(SessionFactory sessionFactory); List<Menu> findByModule(String names); List<Menu> findHierarchicalMenu(); List<Menu> findByParentOid(String parentOid);  }### Answer:
@Test public void findByModule() { super.createFrom(); List<Menu> menus = dao.findByModule("MODULE"); Assert.assertTrue(menus.size() == 1); super.deleteFrom(menus.get(0)); }