Search in sources :

Example 21 with Validations

use of io.jans.scim.model.scim2.Validations in project atlasmap by atlasmap.

the class AtlasCoreValidationTest method testXmlToJson.

@Test
public void testXmlToJson() throws AtlasException {
    assertNotNull(context);
    assertNotNull(session);
    context.processValidation(session);
    Validations validations = session.getValidations();
    assertNotNull(validations);
    assertNotNull(validations.getValidation());
    assertTrue(validations.getValidation().isEmpty());
}
Also used : Validations(io.atlasmap.v2.Validations) Test(org.junit.jupiter.api.Test) AtlasMappingBaseTest(io.atlasmap.itests.validation.AtlasMappingBaseTest)

Example 22 with Validations

use of io.jans.scim.model.scim2.Validations in project atlasmap by atlasmap.

the class AtlasCoreValidationTest method testJsonToXml.

@Test
public void testJsonToXml() throws AtlasException {
    assertNotNull(context);
    assertNotNull(session);
    context.processValidation(session);
    Validations validations = session.getValidations();
    assertNotNull(validations);
    assertNotNull(validations.getValidation());
    assertTrue(validations.getValidation().isEmpty());
}
Also used : Validations(io.atlasmap.v2.Validations) Test(org.junit.jupiter.api.Test) AtlasMappingBaseTest(io.atlasmap.itests.validation.AtlasMappingBaseTest)

Example 23 with Validations

use of io.jans.scim.model.scim2.Validations in project atlasmap by atlasmap.

the class AtlasService method validateMapping.

/**
 * Performs mapping validation.
 * @param mappingDefinitionId mapping definition ID
 * @param mapping mapping
 * @param uriInfo URI info
 * @return {@link Validations} validation result
 * @throws IOException unexpected error
 * @throws AtlasException unexpected error
 */
protected Response validateMapping(Integer mappingDefinitionId, AtlasMapping mapping, UriInfo uriInfo) throws IOException, AtlasException {
    AtlasSession session;
    synchronized (atlasContextFactory) {
        AtlasContext context = atlasContextFactory.createContext(mapping);
        session = context.createSession();
        context.processValidation(session);
    }
    Validations validations = session.getValidations();
    if (session.getValidations() == null) {
        validations = new Validations();
    }
    return Response.ok().entity(toJson(validations)).build();
}
Also used : Validations(io.atlasmap.v2.Validations) AtlasContext(io.atlasmap.api.AtlasContext) AtlasSession(io.atlasmap.api.AtlasSession)

Example 24 with Validations

use of io.jans.scim.model.scim2.Validations in project atlasmap by atlasmap.

the class DefaultAtlasSessionTest method testGetSetValidations.

@Test
public void testGetSetValidations() {
    assertNotNull(session.getValidations());
    assertNotNull(session.getValidations().getValidation());
    assertTrue(session.getValidations().getValidation().size() == 0);
    Validations validations = new Validations();
    Validation validation = new Validation();
    validation.setScope(ValidationScope.MAPPING);
    validation.setId("bar");
    validations.getValidation().add(validation);
    session.setValidations(validations);
    assertNotNull(session.getValidations());
    assertNotNull(session.getValidations().getValidation());
    assertTrue(session.getValidations().getValidation().size() == 1);
}
Also used : Validation(io.atlasmap.v2.Validation) Validations(io.atlasmap.v2.Validations) Test(org.junit.jupiter.api.Test)

Example 25 with Validations

use of io.jans.scim.model.scim2.Validations in project atlasmap by atlasmap.

the class AtlasCoreValidationTest method testJavaToXml.

@Test
public void testJavaToXml() throws AtlasException {
    assertNotNull(context);
    assertNotNull(session);
    context.processValidation(session);
    Validations validations = session.getValidations();
    assertNotNull(validations);
    assertNotNull(validations.getValidation());
    assertTrue(validations.getValidation().isEmpty());
}
Also used : Validations(io.atlasmap.v2.Validations) Test(org.junit.Test) AtlasMappingBaseTest(io.atlasmap.validation.AtlasMappingBaseTest)

Aggregations

Validations (io.atlasmap.v2.Validations)26 Test (org.junit.jupiter.api.Test)11 Validation (io.atlasmap.v2.Validation)9 Test (org.junit.Test)9 AtlasMappingBaseTest (io.atlasmap.itests.validation.AtlasMappingBaseTest)8 AtlasMappingBaseTest (io.atlasmap.validation.AtlasMappingBaseTest)8 AtlasSession (io.atlasmap.api.AtlasSession)5 AtlasContext (io.atlasmap.api.AtlasContext)4 SCIMException (io.jans.scim.model.exception.SCIMException)4 Audits (io.atlasmap.v2.Audits)3 File (java.io.File)3 InvalidAttributeValueException (javax.management.InvalidAttributeValueException)3 AtlasValidationException (io.atlasmap.api.AtlasValidationException)2 BaseFlatPrimitiveClass (io.atlasmap.java.test.BaseFlatPrimitiveClass)2 TargetFlatPrimitiveClass (io.atlasmap.java.test.TargetFlatPrimitiveClass)2 DuplicateEntryException (io.jans.orm.exception.operation.DuplicateEntryException)2 AtlasMappingBaseTest (io.atlasmap.itests.reference.AtlasMappingBaseTest)1 AtlasMappingBaseTest (io.atlasmap.reference.AtlasMappingBaseTest)1 Head (io.atlasmap.spi.AtlasInternalSession.Head)1 AtlasMapping (io.atlasmap.v2.AtlasMapping)1