Package org.apache.syncope.common.to

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


        assertEquals(Arrays.asList(6L, 7L, 10L, 8L), policyTO.getUsedByRoles());
    }

    @Test
    public void getSyncPolicy() {
        SyncPolicyTO policyTO = policyService.read(PolicyType.SYNC, 1L);

        assertNotNull(policyTO);
        assertTrue(policyTO.getUsedByRoles().isEmpty());
    }
View Full Code Here


        assertFalse(policyTO.getUsedByResources().contains(RESOURCE_NAME_NOPROPAGATION));
    }

    @Test
    public void getGlobalSyncPolicy() {
        SyncPolicyTO policyTO = policyService.readGlobal(PolicyType.SYNC);

        assertNotNull(policyTO);
        assertEquals(PolicyType.GLOBAL_SYNC, policyTO.getType());
        assertFalse(policyTO.getUsedByResources().contains(RESOURCE_NAME_CSV));
        assertFalse(policyTO.getUsedByResources().contains(RESOURCE_NAME_WS2));
        assertTrue(policyTO.getUsedByRoles().isEmpty());
    }
View Full Code Here

        }
    }

    @Test
    public void createMissingDescription() {
        SyncPolicyTO policy = new SyncPolicyTO();
        policy.setSpecification(new SyncPolicySpec());

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

        }
    }

    @Test
    public void create() {
        SyncPolicyTO policy = buildSyncPolicyTO();

        SyncPolicyTO policyTO = createPolicy(PolicyType.SYNC, policy);

        assertNotNull(policyTO);
        assertEquals(PolicyType.SYNC, policyTO.getType());
        assertEquals(TestSyncRule.class.getName(), policyTO.getSpecification().getUserJavaRule());
    }
View Full Code Here

        assertEquals(8, policy.getSpecification().getMinLength());
    }

    @Test
    public void delete() {
        SyncPolicyTO policy = buildSyncPolicyTO();

        SyncPolicyTO policyTO = createPolicy(PolicyType.SYNC, policy);
        assertNotNull(policyTO);

        policyService.delete(PolicyType.SYNC, policyTO.getId());

        Throwable t = null;
        try {
            policyService.read(PolicyType.SYNC, policyTO.getId());
        } catch (SyncopeClientCompositeErrorException e) {
            t = e;
        }

        assertNotNull(t);
View Full Code Here

            assertNotNull(e.getException(SyncopeClientExceptionType.InvalidPolicy));
        }
    }

    private SyncPolicyTO buildSyncPolicyTO() {
        SyncPolicyTO policy = new SyncPolicyTO();

        SyncPolicySpec spec = new SyncPolicySpec();
        spec.setUserJavaRule(TestSyncRule.class.getName());

        policy.setSpecification(spec);
        policy.setDescription("Sync policy");

        return policy;
    }
View Full Code Here

        }
    }

    @Test
    public void createMissingDescription() {
        SyncPolicyTO policy = new SyncPolicyTO();
        policy.setSpecification(new SyncPolicySpec());

        try {
            createPolicy(policy);
            fail();
        } catch (SyncopeClientException e) {
View Full Code Here

        }
    }

    @Test
    public void create() {
        SyncPolicyTO policy = buildSyncPolicyTO();

        SyncPolicyTO policyTO = createPolicy(policy);

        assertNotNull(policyTO);
        assertEquals(PolicyType.SYNC, policyTO.getType());
        assertEquals(TestSyncRule.class.getName(), policyTO.getSpecification().getUserJavaRule());
    }
View Full Code Here

        assertEquals(8, policy.getSpecification().getMinLength());
    }

    @Test
    public void delete() {
        SyncPolicyTO policy = buildSyncPolicyTO();

        SyncPolicyTO policyTO = createPolicy(policy);
        assertNotNull(policyTO);

        policyService.delete(policyTO.getId());

        try {
            policyService.read(policyTO.getId());
            fail();
        } catch (SyncopeClientException e) {
            assertNotNull(e);
        }
    }
View Full Code Here

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

    private SyncPolicyTO buildSyncPolicyTO() {
        SyncPolicyTO policy = new SyncPolicyTO();

        SyncPolicySpec spec = new SyncPolicySpec();
        spec.setUserJavaRule(TestSyncRule.class.getName());

        policy.setSpecification(spec);
        policy.setDescription("Sync policy");

        return policy;
    }
View Full Code Here

TOP

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

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.