roleDAO.save(role);
}
@Test
public void findByOwner() {
SyncopeRole role = roleDAO.find(6L);
assertNotNull("did not find expected role", role);
SyncopeUser user = userDAO.find(5L);
assertNotNull("did not find expected user", user);
assertEquals(user, role.getUserOwner());
SyncopeRole child1 = roleDAO.find(7L);
assertNotNull(child1);
assertEquals(role, child1.getParent());
SyncopeRole child2 = roleDAO.find(10L);
assertNotNull(child2);
assertEquals(role, child2.getParent());
List<SyncopeRole> ownedRoles = roleDAO.findOwned(user);
assertFalse(ownedRoles.isEmpty());
assertEquals(2, ownedRoles.size());
assertTrue(ownedRoles.contains(role));