Search in sources :

Example 1 with DefaultPullCorrelationRuleConf

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

the class PolicyTest method findByKey.

@Test
public void findByKey() {
    PullPolicy policy = policyDAO.find("880f8553-069b-4aed-9930-2cd53873f544");
    assertNotNull(policy);
    CorrelationRule rule = policy.getCorrelationRule(anyTypeDAO.findUser()).orElse(null);
    assertNotNull(rule);
    DefaultPullCorrelationRuleConf ruleConf = POJOHelper.deserialize(rule.getImplementation().getBody(), DefaultPullCorrelationRuleConf.class);
    assertNotNull(ruleConf);
    assertEquals(2, ruleConf.getSchemas().size());
    assertTrue(ruleConf.getSchemas().contains("username"));
    assertTrue(ruleConf.getSchemas().contains("firstname"));
}
Also used : PullPolicy(org.apache.syncope.core.persistence.api.entity.policy.PullPolicy) PullCorrelationRule(org.apache.syncope.core.persistence.api.dao.PullCorrelationRule) CorrelationRule(org.apache.syncope.core.persistence.api.entity.policy.CorrelationRule) DefaultPullCorrelationRuleConf(org.apache.syncope.common.lib.policy.DefaultPullCorrelationRuleConf) Test(org.junit.jupiter.api.Test) AbstractTest(org.apache.syncope.core.persistence.jpa.AbstractTest)

Aggregations

DefaultPullCorrelationRuleConf (org.apache.syncope.common.lib.policy.DefaultPullCorrelationRuleConf)1 PullCorrelationRule (org.apache.syncope.core.persistence.api.dao.PullCorrelationRule)1 CorrelationRule (org.apache.syncope.core.persistence.api.entity.policy.CorrelationRule)1 PullPolicy (org.apache.syncope.core.persistence.api.entity.policy.PullPolicy)1 AbstractTest (org.apache.syncope.core.persistence.jpa.AbstractTest)1 Test (org.junit.jupiter.api.Test)1