Package org.apache.syncope.common.to

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


            case ACCOUNT:
                policyTO = new AccountPolicyTO();
                break;

            case GLOBAL_PASSWORD:
                policyTO = new PasswordPolicyTO(true);
                break;

            case PASSWORD:
                policyTO = new PasswordPolicyTO();
                break;

            case GLOBAL_SYNC:
                policyTO = new SyncPolicyTO(true);
                break;
View Full Code Here


            case PASSWORD:
                if (!(policy.getSpecification() instanceof PasswordPolicySpec)) {
                    throw new ClassCastException("Expected " + PasswordPolicySpec.class.getName()
                            + ", found " + policy.getSpecification().getClass().getName());
                }
                policyTO = new PasswordPolicyTO(isGlobal);
                ((PasswordPolicyTO) policyTO).setSpecification((PasswordPolicySpec) policy.getSpecification());
                break;

            case GLOBAL_ACCOUNT:
            case ACCOUNT:
View Full Code Here

        assertNotNull(policyTO);
    }

    @Test
    public void getGlobalPasswordPolicy() {
        PasswordPolicyTO policyTO = policyService.readGlobal(PolicyType.PASSWORD);

        assertNotNull(policyTO);
        assertEquals(PolicyType.GLOBAL_PASSWORD, policyTO.getType());
        assertEquals(8, policyTO.getSpecification().getMinLength());
    }
View Full Code Here

        assertEquals(PolicyType.GLOBAL_ACCOUNT, policyTO.getType());
    }

    @Test
    public void createWithException() {
        PasswordPolicyTO policy = new PasswordPolicyTO(true);
        policy.setSpecification(new PasswordPolicySpec());
        policy.setDescription("global password policy");

        try {
            createPolicy(policyService, PolicyType.PASSWORD, policy);
            fail();
        } catch (SyncopeClientCompositeErrorException sccee) {
View Full Code Here

    }

    @Test
    public void update() {
        // get global password
        PasswordPolicyTO globalPolicy = policyService.read(PolicyType.PASSWORD, 2L);

        PasswordPolicyTO policy = new PasswordPolicyTO();
        policy.setDescription("A simple password policy");
        policy.setSpecification(globalPolicy.getSpecification());

        // create a new password policy using global password as a template
        Response response = createPolicy(policyService, PolicyType.PASSWORD, policy);
        policy = getObject(response, PasswordPolicyTO.class, policyService);

        // read new password policy
        policy = policyService.read(PolicyType.PASSWORD, policy.getId());

        assertNotNull("find to update did not work", policy);

        PasswordPolicySpec policySpec = policy.getSpecification();
        policySpec.setMaxLength(22);
        policy.setSpecification(policySpec);

        // update new password policy
        policyService.update(PolicyType.PASSWORD, policy.getId(), policy);
        policy = policyService.read(PolicyType.PASSWORD, policy.getId());

        assertNotNull(policy);
        assertEquals(PolicyType.PASSWORD, policy.getType());
        assertEquals(22, policy.getSpecification().getMaxLength());
        assertEquals(8, policy.getSpecification().getMinLength());
    }
View Full Code Here

            case ACCOUNT:
                policyTO = new AccountPolicyTO();
                break;

            case GLOBAL_PASSWORD:
                policyTO = new PasswordPolicyTO(true);
                break;

            case PASSWORD:
                policyTO = new PasswordPolicyTO();
                break;

            case GLOBAL_SYNC:
                policyTO = new SyncPolicyTO(true);
                break;
View Full Code Here

            case PASSWORD:
                if (!(policy.getSpecification() instanceof PasswordPolicySpec)) {
                    throw new ClassCastException("Expected " + PasswordPolicySpec.class.getName()
                            + ", found " + policy.getSpecification().getClass().getName());
                }
                policyTO = new PasswordPolicyTO(isGlobal);
                ((PasswordPolicyTO) policyTO).setSpecification((PasswordPolicySpec) policy.getSpecification());
                break;

            case GLOBAL_ACCOUNT:
            case ACCOUNT:
View Full Code Here

            case ACCOUNT:
                policyTO = new AccountPolicyTO();
                break;

            case GLOBAL_PASSWORD:
                policyTO = new PasswordPolicyTO(true);
                break;

            case PASSWORD:
                policyTO = new PasswordPolicyTO();
                break;

            case GLOBAL_SYNC:
                policyTO = new SyncPolicyTO(true);
                break;
View Full Code Here

        assertNotNull(policyTO);
    }

    @Test
    public void getGlobalPasswordPolicy() {
        PasswordPolicyTO policyTO = policyService.readGlobal(PolicyType.PASSWORD);

        assertNotNull(policyTO);
        assertEquals(PolicyType.GLOBAL_PASSWORD, policyTO.getType());
        assertEquals(8, policyTO.getSpecification().getMinLength());
    }
View Full Code Here

        assertEquals(PolicyType.GLOBAL_ACCOUNT, policyTO.getType());
    }

    @Test
    public void createWithException() {
        PasswordPolicyTO policy = new PasswordPolicyTO(true);
        policy.setSpecification(new PasswordPolicySpec());
        policy.setDescription("global password policy");

        try {
            createPolicy(PolicyType.PASSWORD, policy);
            fail();
        } catch (SyncopeClientCompositeErrorException sccee) {
View Full Code Here

TOP

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

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.