Package org.apache.syncope.client.validation

Examples of org.apache.syncope.client.validation.SyncopeClientException


        userTO = restTemplate.postForObject(BASE_URL + "user/create", userTO, UserTO.class);
        assertNotNull(userTO);

        // 2. try to request user delete as admin: failure
        SyncopeClientException exception = null;
        try {
            restTemplate.getForObject(BASE_URL + "user/request/delete/{userId}", UserRequestTO.class, userTO.getId());
            fail();
        } catch (SyncopeClientCompositeErrorException e) {
            exception = e.getException(SyncopeClientExceptionType.UnauthorizedRole);
View Full Code Here


        UserMod userMod = new UserMod();
        userMod.setId(userTO.getId());
        userMod.setPassword("newPassword");
        userMod.addResourceToBeAdded("ws-target-resource-2");

        SyncopeClientException sce = null;
        try {
            userTO = restTemplate.postForObject(BASE_URL + "user/update", userMod, UserTO.class);
        } catch (SyncopeClientCompositeErrorException scce) {
            sce = scce.getException(SyncopeClientExceptionType.RequiredValuesMissing);
        }
View Full Code Here

        PreemptiveAuthHttpRequestFactory requestFactory = ((PreemptiveAuthHttpRequestFactory) restTemplate.
                getRequestFactory());
        ((DefaultHttpClient) requestFactory.getHttpClient()).getCredentialsProvider().setCredentials(
                requestFactory.getAuthScope(), new UsernamePasswordCredentials("user1", "password"));

        SyncopeClientException exception = null;
        try {
            restTemplate.getForObject(BASE_URL + "role/selfRead/{roleId}", RoleTO.class, 3);
            fail();
        } catch (SyncopeClientCompositeErrorException e) {
            exception = e.getException(SyncopeClientExceptionType.UnauthorizedRole);
View Full Code Here

        try {
            restTemplate.postForObject(BASE_URL + "schema/user/create", schemaTO, SchemaTO.class);
            fail("This should not be reacheable");
        } catch (SyncopeClientCompositeErrorException scce) {
            SyncopeClientException sce = scce.getException(SyncopeClientExceptionType.InvalidUSchema);

            assertNotNull(sce.getElements());
            assertEquals(1, sce.getElements().size());
            assertTrue(sce.getElements().iterator().next().contains(EntityViolationType.InvalidUSchema.name()));
        }
    }
View Full Code Here

        try {
            restTemplate.postForObject(BASE_URL + "schema/role/create", schemaTO, SchemaTO.class);
            fail("This should not be reacheable");
        } catch (SyncopeClientCompositeErrorException scce) {
            SyncopeClientException sce = scce.getException(SyncopeClientExceptionType.InvalidRSchema);

            assertNotNull(sce.getElements());
            assertEquals(1, sce.getElements().size());
            assertTrue(sce.getElements().iterator().next().contains(
                    EntityViolationType.InvalidSchemaTypeSpecification.name()));
        }
    }
View Full Code Here

        try {
            restTemplate.postForObject(BASE_URL + "schema/user/create", schemaTO, SchemaTO.class);
            fail("This should not be reacheable");
        } catch (SyncopeClientCompositeErrorException scce) {
            SyncopeClientException sce = scce.getException(SyncopeClientExceptionType.InvalidUSchema);

            assertNotNull(sce.getElements());
            assertEquals(1, sce.getElements().size());
            assertTrue(sce.getElements().iterator().next().contains(
                    EntityViolationType.InvalidSchemaTypeSpecification.name()));
        }
    }
View Full Code Here

        updatedTO.setType(SchemaType.Date);
        try {
            restTemplate.postForObject(BASE_URL + "schema/role/update", updatedTO, SchemaTO.class);
            fail("This should not be reacheable");
        } catch (SyncopeClientCompositeErrorException scce) {
            SyncopeClientException sce = scce.getException(SyncopeClientExceptionType.InvalidRSchema);
            assertNotNull(sce);
        }
    }
View Full Code Here

        schemaTO.setType(SchemaType.Long);
        try {
            restTemplate.postForObject(BASE_URL + "schema/user/update", schemaTO, SchemaTO.class);
            fail("This should not be reacheable");
        } catch (SyncopeClientCompositeErrorException scce) {
            SyncopeClientException sce = scce.getException(SyncopeClientExceptionType.InvalidUSchema);
            assertNotNull(sce);
        }
    }
View Full Code Here

        schemaTO.setUniqueConstraint(false);
        try {
            restTemplate.postForObject(BASE_URL + "schema/user/update", schemaTO, SchemaTO.class);
            fail("This should not be reacheable");
        } catch (SyncopeClientCompositeErrorException scce) {
            SyncopeClientException sce = scce.getException(SyncopeClientExceptionType.InvalidUSchema);
            assertNotNull(sce);
        }
    }
View Full Code Here

                NotificationTO.class, "100");
        assertNotNull(notificationTO);

        notificationTO.setRecipients(NodeCond.getLeafCond(new MembershipCond()));

        SyncopeClientException exception = null;
        try {
            restTemplate.postForObject(BASE_URL + "notification/update.json", notificationTO, NotificationTO.class);
        } catch (SyncopeClientCompositeErrorException e) {
            exception = e.getException(SyncopeClientExceptionType.InvalidNotification);
        }
View Full Code Here

TOP

Related Classes of org.apache.syncope.client.validation.SyncopeClientException

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.