Search in sources :

Example 21 with AnyTypeClass

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

the class AnyTypeClassTest method delete.

@Test
public void delete() {
    AnyTypeClass minimalUser = anyTypeClassDAO.find("minimal user");
    assertNotNull(minimalUser);
    anyTypeClassDAO.delete(minimalUser.getKey());
    assertNull(anyTypeClassDAO.find("minimal user"));
}
Also used : AnyTypeClass(org.apache.syncope.core.persistence.api.entity.AnyTypeClass) Test(org.junit.jupiter.api.Test) AbstractTest(org.apache.syncope.core.persistence.jpa.AbstractTest)

Example 22 with AnyTypeClass

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

the class AnyTypeClassTest method save.

@Test
public void save() {
    AnyTypeClass newClass = entityFactory.newEntity(AnyTypeClass.class);
    newClass.setKey("new class");
    newClass.add(plainSchemaDAO.find("firstname"));
    newClass = anyTypeClassDAO.save(newClass);
    assertNotNull(newClass);
    assertFalse(newClass.getPlainSchemas().isEmpty());
    assertTrue(newClass.getDerSchemas().isEmpty());
    assertTrue(newClass.getVirSchemas().isEmpty());
}
Also used : AnyTypeClass(org.apache.syncope.core.persistence.api.entity.AnyTypeClass) Test(org.junit.jupiter.api.Test) AbstractTest(org.apache.syncope.core.persistence.jpa.AbstractTest)

Aggregations

AnyTypeClass (org.apache.syncope.core.persistence.api.entity.AnyTypeClass)22 SyncopeClientException (org.apache.syncope.common.lib.SyncopeClientException)8 PlainSchema (org.apache.syncope.core.persistence.api.entity.PlainSchema)7 AnyType (org.apache.syncope.core.persistence.api.entity.AnyType)6 VirSchema (org.apache.syncope.core.persistence.api.entity.VirSchema)6 AbstractTest (org.apache.syncope.core.persistence.jpa.AbstractTest)6 Test (org.junit.jupiter.api.Test)6 SyncopeClientCompositeException (org.apache.syncope.common.lib.SyncopeClientCompositeException)5 DerSchema (org.apache.syncope.core.persistence.api.entity.DerSchema)5 Provision (org.apache.syncope.core.persistence.api.entity.resource.Provision)4 NotFoundException (org.apache.syncope.core.persistence.api.dao.NotFoundException)3 ArrayList (java.util.ArrayList)2 Collections (java.util.Collections)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 Collectors (java.util.stream.Collectors)2 StringUtils (org.apache.commons.lang3.StringUtils)2 AnyTypeClassTO (org.apache.syncope.common.lib.to.AnyTypeClassTO)2 ClientExceptionType (org.apache.syncope.common.lib.types.ClientExceptionType)2