Search in sources :

Example 6 with AccountPolicyTO

use of org.apache.syncope.common.lib.policy.AccountPolicyTO in project syncope by apache.

the class PolicyITCase method getAccountPolicy.

@Test
public void getAccountPolicy() {
    AccountPolicyTO policyTO = policyService.read(PolicyType.ACCOUNT, "06e2ed52-6966-44aa-a177-a0ca7434201f");
    assertNotNull(policyTO);
    assertTrue(policyTO.getUsedByResources().isEmpty());
    assertTrue(policyTO.getUsedByRealms().contains("/odd"));
}
Also used : AccountPolicyTO(org.apache.syncope.common.lib.policy.AccountPolicyTO) Test(org.junit.jupiter.api.Test)

Example 7 with AccountPolicyTO

use of org.apache.syncope.common.lib.policy.AccountPolicyTO in project syncope by apache.

the class PolicyITCase method issueSYNCOPE553.

@Test
public void issueSYNCOPE553() {
    AccountPolicyTO policy = new AccountPolicyTO();
    policy.setDescription("SYNCOPE553");
    DefaultAccountRuleConf ruleConf = new DefaultAccountRuleConf();
    ruleConf.setMinLength(3);
    ruleConf.setMaxLength(8);
    ImplementationTO rule = new ImplementationTO();
    rule.setKey("DefaultAccountRuleConf" + getUUIDString());
    rule.setEngine(ImplementationEngine.JAVA);
    rule.setType(ImplementationType.ACCOUNT_RULE);
    rule.setBody(POJOHelper.serialize(ruleConf));
    Response response = implementationService.create(rule);
    rule.setKey(response.getHeaderString(RESTHeaders.RESOURCE_KEY));
    policy.getRules().add(rule.getKey());
    policy = createPolicy(PolicyType.ACCOUNT, policy);
    assertNotNull(policy);
}
Also used : ImplementationTO(org.apache.syncope.common.lib.to.ImplementationTO) Response(javax.ws.rs.core.Response) DefaultAccountRuleConf(org.apache.syncope.common.lib.policy.DefaultAccountRuleConf) AccountPolicyTO(org.apache.syncope.common.lib.policy.AccountPolicyTO) Test(org.junit.jupiter.api.Test)

Aggregations

AccountPolicyTO (org.apache.syncope.common.lib.policy.AccountPolicyTO)7 Test (org.junit.jupiter.api.Test)5 Response (javax.ws.rs.core.Response)4 ImplementationTO (org.apache.syncope.common.lib.to.ImplementationTO)4 DefaultAccountRuleConf (org.apache.syncope.common.lib.policy.DefaultAccountRuleConf)3 PasswordPolicyTO (org.apache.syncope.common.lib.policy.PasswordPolicyTO)3 PullPolicyTO (org.apache.syncope.common.lib.policy.PullPolicyTO)2 RealmTO (org.apache.syncope.common.lib.to.RealmTO)2 Entity (org.apache.syncope.core.persistence.api.entity.Entity)2 Realm (org.apache.syncope.core.persistence.api.entity.Realm)2 AccountPolicy (org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy)2 PasswordPolicy (org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy)2 PullPolicy (org.apache.syncope.core.persistence.api.entity.policy.PullPolicy)2 ExternalResource (org.apache.syncope.core.persistence.api.entity.resource.ExternalResource)2 Collectors (java.util.stream.Collectors)1 SyncopeClientException (org.apache.syncope.common.lib.SyncopeClientException)1 PolicyTO (org.apache.syncope.common.lib.policy.PolicyTO)1 UserTO (org.apache.syncope.common.lib.to.UserTO)1 RealmService (org.apache.syncope.common.rest.api.service.RealmService)1 AnyTypeDAO (org.apache.syncope.core.persistence.api.dao.AnyTypeDAO)1