Package org.apache.syncope.common.to

Examples of org.apache.syncope.common.to.SchemaTO


        assertNotNull(userTO);
    }

    @Test
    public void issue260() {
        SchemaTO schemaTO = buildSchemaTO("schema_issue260", AttributeSchemaType.Double);
        schemaTO.setUniqueConstraint(true);

        schemaTO = createSchema(AttributableType.USER, SchemaType.NORMAL, schemaTO);
        assertNotNull(schemaTO);

        UserTO userTO = UserTestITCase.getUniqueSampleTO("issue260@syncope.apache.org");
        userTO.addAttribute(attributeTO(schemaTO.getName(), "1.2"));
        userTO = createUser(userTO);
        assertNotNull(userTO);

        schemaTO.setUniqueConstraint(false);
        try {
            schemaService.update(AttributableType.USER, SchemaType.NORMAL, schemaTO.getName(), schemaTO);
            fail("This should not be reacheable");
        } catch (SyncopeClientCompositeErrorException scce) {
            SyncopeClientException sce = scce.getException(SyncopeClientExceptionType.InvalidUSchema);
            assertNotNull(sce);
        }
View Full Code Here


        }
    }

    @Test
    public void issueSYNCOPE323() {
        SchemaTO actual = schemaService.read(AttributableType.ROLE, SchemaType.NORMAL, "icon");
        assertNotNull(actual);

        try {
            createSchema(AttributableType.ROLE, SchemaType.NORMAL, actual);
            fail();
        } catch (SyncopeClientCompositeErrorException scce) {
            assertEquals(HttpStatus.CONFLICT, scce.getStatusCode());
            assertTrue(scce.hasException(SyncopeClientExceptionType.EntityExists));
        }

        actual.setName(null);
        try {
            createSchema(AttributableType.ROLE, SchemaType.NORMAL, actual);
            fail();
        } catch (SyncopeClientCompositeErrorException scce) {
            assertEquals(HttpStatus.BAD_REQUEST, scce.getStatusCode());
View Full Code Here

        }
    }

    @Test
    public void issueSYNCOPE418() {
        SchemaTO schema = buildSchemaTO("http://schemas.examples.org/security/authorization/organizationUnit",
                AttributeSchemaType.Double);

        try {
            createSchema(AttributableType.ROLE, SchemaType.NORMAL, schema);
            fail();
View Full Code Here

            assertTrue(sce.getElements().iterator().next().contains(EntityViolationType.InvalidName.name()));
        }
    }

    private SchemaTO buildSchemaTO(final String name, final AttributeSchemaType type) {
        SchemaTO schemaTO = new SchemaTO();
        schemaTO.setName(name + getUUIDString());
        schemaTO.setType(type);
        return schemaTO;
    }
View Full Code Here

@FixMethodOrder(MethodSorters.JVM)
public class SchemaTestITCase extends AbstractTest {

    private SchemaTO buildSchemaTO(final String name, final AttributeSchemaType type) {
        SchemaTO schemaTO = new SchemaTO();
        schemaTO.setName(name + getUUIDString());
        schemaTO.setType(type);
        return schemaTO;
    }
View Full Code Here

        return schemaTO;
    }

    @Test
    public void create() {
        SchemaTO schemaTO = buildSchemaTO("testAttribute", AttributeSchemaType.String);
        schemaTO.setMandatoryCondition("false");

        SchemaTO newSchemaTO = createSchema(AttributableType.USER, SchemaType.NORMAL, schemaTO);
        assertEquals(schemaTO, newSchemaTO);

        newSchemaTO = createSchema(AttributableType.MEMBERSHIP, SchemaType.NORMAL, schemaTO);
        assertEquals(schemaTO, newSchemaTO);
    }
View Full Code Here

        assertEquals(schemaTO, newSchemaTO);
    }

    @Test
    public void createWithNotPermittedName() {
        SchemaTO schemaTO = new SchemaTO();
        schemaTO.setName("failedLogins");
        schemaTO.setType(AttributeSchemaType.String);

        try {
            createSchema(AttributableType.USER, SchemaType.NORMAL, schemaTO);
            fail("This should not be reacheable");
        } catch (SyncopeClientException e) {
View Full Code Here

        }
    }

    @Test
    public void createREnumWithoutEnumeration() {
        SchemaTO schemaTO = new SchemaTO();
        schemaTO.setName("enumcheck");
        schemaTO.setType(AttributeSchemaType.Enum);

        try {
            createSchema(AttributableType.ROLE, SchemaType.NORMAL, schemaTO);
            fail("This should not be reacheable");
        } catch (SyncopeClientException e) {
View Full Code Here

        }
    }

    @Test
    public void createUEnumWithoutEnumeration() {
        SchemaTO schemaTO = new SchemaTO();
        schemaTO.setName("enumcheck");
        schemaTO.setType(AttributeSchemaType.Enum);

        try {
            createSchema(AttributableType.USER, SchemaType.NORMAL, schemaTO);
            fail("This should not be reacheable");
        } catch (SyncopeClientException e) {
View Full Code Here

        }
    }

    @Test
    public void createEncrypted() {
        SchemaTO schemaTO = new SchemaTO();
        schemaTO.setName("encrypted");
        schemaTO.setType(AttributeSchemaType.Encrypted);
        schemaTO.setCipherAlgorithm(CipherAlgorithm.AES);
        schemaTO.setSecretKey("huhadfhsjfsfsdkj!####");

        createSchema(AttributableType.MEMBERSHIP, SchemaType.NORMAL, schemaTO);
    }
View Full Code Here

TOP

Related Classes of org.apache.syncope.common.to.SchemaTO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.