verify(dao).getPageByPathName(PATH_NAME);
}
@Test
void testCreatePage() throws EntityExistsException {
SimplePage simplePage = new SimplePage(NAME, CONTENT, PATH_NAME);
JCUser user = new JCUser("username", "email", "password");
when(dao.isExist(PATH_NAME)).thenReturn(false);
when(groupDao.getGroupByName(AdministrationGroup.ADMIN.getName())).thenReturn(new Group());
SimplePage actualSimplePage = simplePageService.createPage(simplePage, user);
assertEquals(actualSimplePage.getName(), NAME);
assertEquals(actualSimplePage.getContent(), CONTENT);
assertEquals(actualSimplePage.getPathName(), PATH_NAME);
verify(dao).isExist(PATH_NAME);
verify(dao).saveOrUpdate(simplePage);
verify(aclBuilder).grant(GeneralPermission.WRITE);
}