use of org.apache.syncope.core.persistence.api.entity.Realm in project syncope by apache.
the class RealmTest method test.
@Test
public void test() {
Realm realm = realmDAO.findByFullPath("/odd");
assertNotNull(realm);
// need to remove this group in order to remove the realm, which is otherwise empty
Group group = groupDAO.findByName("fake");
assertNotNull(group);
assertEquals(realm, group.getRealm());
groupDAO.delete(group);
Role role = roleDAO.find("User reviewer");
assertTrue(role.getRealms().contains(realm));
int beforeSize = role.getRealms().size();
realmDAO.delete(realm);
realmDAO.flush();
role = roleDAO.find("User reviewer");
assertEquals(beforeSize - 1, role.getRealms().size());
}
Aggregations