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"));
}
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);
}
Aggregations