Search in sources :

Example 11 with RelationshipType

use of org.apache.syncope.core.persistence.api.entity.RelationshipType in project syncope by apache.

the class RelationshipTypeTest method find.

@Test
public void find() {
    RelationshipType inclusion = relationshipTypeDAO.find("inclusion");
    assertNotNull(inclusion);
    assertEquals("inclusion", inclusion.getKey());
}
Also used : RelationshipType(org.apache.syncope.core.persistence.api.entity.RelationshipType) Test(org.junit.jupiter.api.Test) AbstractTest(org.apache.syncope.core.persistence.jpa.AbstractTest)

Example 12 with RelationshipType

use of org.apache.syncope.core.persistence.api.entity.RelationshipType in project syncope by apache.

the class RelationshipTypeTest method delete.

@Test
public void delete() {
    RelationshipType type = relationshipTypeDAO.find("neighborhood");
    assertNotNull(type);
    relationshipTypeDAO.delete(type.getKey());
    assertNull(relationshipTypeDAO.find("neighborhood"));
}
Also used : RelationshipType(org.apache.syncope.core.persistence.api.entity.RelationshipType) Test(org.junit.jupiter.api.Test) AbstractTest(org.apache.syncope.core.persistence.jpa.AbstractTest)

Example 13 with RelationshipType

use of org.apache.syncope.core.persistence.api.entity.RelationshipType in project syncope by apache.

the class RelationshipTypeTest method deleteOnAnyObject.

@Test
public void deleteOnAnyObject() {
    RelationshipType neighborhood = relationshipTypeDAO.find("neighborhood");
    assertNotNull(neighborhood);
    AnyObject anyObject = anyObjectDAO.find("fc6dbc3a-6c07-4965-8781-921e7401a4a5");
    assertNotNull(anyObject);
    assertNotNull(anyObject.getRelationships(neighborhood));
    assertFalse(anyObject.getRelationships(neighborhood).isEmpty());
    relationshipTypeDAO.delete("neighborhood");
    relationshipTypeDAO.flush();
    anyObject = anyObjectDAO.find("fc6dbc3a-6c07-4965-8781-921e7401a4a5");
    assertNotNull(anyObject);
    assertTrue(anyObject.getRelationships().isEmpty());
}
Also used : AnyObject(org.apache.syncope.core.persistence.api.entity.anyobject.AnyObject) RelationshipType(org.apache.syncope.core.persistence.api.entity.RelationshipType) Test(org.junit.jupiter.api.Test) AbstractTest(org.apache.syncope.core.persistence.jpa.AbstractTest)

Aggregations

RelationshipType (org.apache.syncope.core.persistence.api.entity.RelationshipType)13 AnyObject (org.apache.syncope.core.persistence.api.entity.anyobject.AnyObject)5 AbstractTest (org.apache.syncope.core.persistence.jpa.AbstractTest)5 Test (org.junit.jupiter.api.Test)5 SyncopeClientCompositeException (org.apache.syncope.common.lib.SyncopeClientCompositeException)4 SyncopeClientException (org.apache.syncope.common.lib.SyncopeClientException)4 AnyUtils (org.apache.syncope.core.persistence.api.entity.AnyUtils)4 Realm (org.apache.syncope.core.persistence.api.entity.Realm)4 Group (org.apache.syncope.core.persistence.api.entity.group.Group)4 Collection (java.util.Collection)3 List (java.util.List)3 AMembership (org.apache.syncope.core.persistence.api.entity.anyobject.AMembership)3 ARelationship (org.apache.syncope.core.persistence.api.entity.anyobject.ARelationship)3 UMembership (org.apache.syncope.core.persistence.api.entity.user.UMembership)3 URelationship (org.apache.syncope.core.persistence.api.entity.user.URelationship)3 Collections (java.util.Collections)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 Map (java.util.Map)2 Optional (java.util.Optional)2