Search in sources :

Example 1 with Rule

use of org.candlepin.policy.js.entitlement.EntitlementRules.Rule in project candlepin by candlepin.

the class EnforcerTest method shouldParseValidMapping.

@Test
public void shouldParseValidMapping() {
    Rule func1rule = new EntitlementRules.Rule("func1", 1, new HashSet<String>() {

        {
            add("attr1");
            add("attr2");
            add("attr3");
        }
    });
    assertEquals(func1rule, ((EntitlementRules) enforcer).parseRule("func1:1:attr1:attr2:attr3"));
    assertEquals(new EntitlementRules.Rule("func3", 3, new HashSet<String>() {

        {
            add("attr4");
        }
    }), ((EntitlementRules) enforcer).parseRule("func3:3:attr4"));
}
Also used : Rule(org.candlepin.policy.js.entitlement.EntitlementRules.Rule) EntitlementRules(org.candlepin.policy.js.entitlement.EntitlementRules) Rule(org.candlepin.policy.js.entitlement.EntitlementRules.Rule) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

HashSet (java.util.HashSet)1 EntitlementRules (org.candlepin.policy.js.entitlement.EntitlementRules)1 Rule (org.candlepin.policy.js.entitlement.EntitlementRules.Rule)1 Test (org.junit.Test)1