Package org.apache.syncope.client.validation

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


        assertNotNull(configurationTO);

        UserTO userTO = UserTestITCase.getSampleTO("selfcreate@syncope.apache.org");

        // 2. get unauthorized when trying to request user create
        SyncopeClientException exception = null;
        try {
            restTemplate.postForObject(BASE_URL + "user/request/create", userTO, UserRequestTO.class);
            fail();
        } catch (SyncopeClientCompositeErrorException e) {
            exception = e.getException(SyncopeClientExceptionType.UnauthorizedRole);
View Full Code Here


        UserMod userMod = new UserMod();
        userMod.setId(userTO.getId());
        userMod.setPassword(initialPassword);

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

        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

        UserTO readUserTO = restTemplate.getForObject(BASE_URL + "user/read/{userId}.json", UserTO.class, 1);
        assertNotNull(readUserTO);

        super.setupRestTemplate("user2", "password");

        SyncopeClientException exception = null;
        try {
            restTemplate.getForObject(BASE_URL + "user/read/{userId}.json", UserTO.class, 1);
            fail();
        } catch (SyncopeClientCompositeErrorException e) {
            exception = e.getException(SyncopeClientExceptionType.UnauthorizedRole);
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

    public void delete() {
        NotificationTO deletedNotification = restTemplate.getForObject(
                BASE_URL + "notification/delete/{notificationId}.json", NotificationTO.class, "101");
        assertNotNull(deletedNotification);

        SyncopeClientException exception = null;
        try {
            restTemplate.getForObject(BASE_URL + "notification/read/{notificationId}.json", NotificationTO.class, "101");
        } catch (SyncopeClientCompositeErrorException e) {
            exception = e.getException(SyncopeClientExceptionType.NotFound);
        }
View Full Code Here

        notificationTO.setSender("syncope@syncope.apache.org");
        notificationTO.setSubject("Test notification without");
        notificationTO.setTemplate("test");

        NotificationTO actual = null;
        SyncopeClientException exception = null;
        try {
            actual = restTemplate.postForObject(
                    BASE_URL + "notification/create.json", notificationTO, NotificationTO.class);

        } catch (SyncopeClientCompositeErrorException e) {
View Full Code Here

        // now, let's see if there are new resource subscriptions without providing password
        Set<String> updatedResources = user.getResourceNames();
        updatedResources.removeAll(currentResources);
        if (!updatedResources.isEmpty() && StringUtils.isBlank(userMod.getPassword())) {

            SyncopeClientException sce = new SyncopeClientException(SyncopeClientExceptionType.RequiredValuesMissing);
            sce.addElement("password cannot be empty " + "when subscribing to new resources");
            scce.addException(sce);

            throw scce;
        }
View Full Code Here

        } catch (Exception e) {
            LOG.error("While registering quartz job for report " + report.getId(), e);

            SyncopeClientCompositeErrorException scce =
                    new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
            SyncopeClientException sce = new SyncopeClientException(SyncopeClientExceptionType.Scheduling);
            sce.addElement(e.getMessage());
            scce.addException(sce);
            throw scce;
        }

        auditManager.audit(Category.report, ReportSubCategory.create, Result.success,
View Full Code Here

            jobInstanceLoader.registerJob(report);
        } catch (Exception e) {
            LOG.error("While registering quartz job for report " + report.getId(), e);

            SyncopeClientCompositeErrorException scce = new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
            SyncopeClientException sce = new SyncopeClientException(SyncopeClientExceptionType.Scheduling);
            sce.addElement(e.getMessage());
            scce.addException(sce);
            throw scce;
        }

        auditManager.audit(Category.report, ReportSubCategory.update, Result.success,
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.