### Question:
SimplePageHibernateDao extends GenericDao<SimplePage> implements SimplePageDao { public SimplePage getPageByPathName(String pathName) throws NotFoundException { return (SimplePage) (session().getNamedQuery("getPageByPathName"). setCacheable(true).setString("pathName", pathName). uniqueResult()); } SimplePageHibernateDao(SessionFactory sessionFactory); void createPage(SimplePage simplePage); SimplePage getPageByPathName(String pathName); @Override boolean isExist(String pagePathName);  }### Answer:
@Test public void testGetPageByPathName() { SimplePage simplePage = ObjectsFactory.getDefaultSimplePage(); session.save(simplePage); SimplePage result = dao.getPageByPathName(simplePage.getPathName()); assertNotNull(result); assertEquals(simplePage.getId(), result.getId()); assertEquals(simplePage.getName(), result.getName()); assertEquals(simplePage.getContent(), result.getContent()); assertEquals(simplePage.getPathName(), result.getPathName()); }
@Test public void testGetPageByPathNameNotExist() { SimplePage simplePage = ObjectsFactory.getDefaultSimplePage(); session.save(simplePage); SimplePage result = dao.getPageByPathName("not Exist Path Name"); assertNull(result); }