Search in sources :

Example 1 with UniversalPolicyResolver

use of org.nhindirect.stagent.policy.impl.UniversalPolicyResolver in project nhin-d by DirectProject.

the class UniversalPolicyResolver_constructTest method testConstruct_singleExpression_assertAttributes.

public void testConstruct_singleExpression_assertAttributes() {
    final PolicyExpression expression = mock(PolicyExpression.class);
    final UniversalPolicyResolver resolver = new UniversalPolicyResolver(expression);
    assertNotNull(resolver);
    assertEquals(1, resolver.expressions.size());
    assertEquals(expression, resolver.expressions.iterator().next());
}
Also used : UniversalPolicyResolver(org.nhindirect.stagent.policy.impl.UniversalPolicyResolver) PolicyExpression(org.nhindirect.policy.PolicyExpression)

Example 2 with UniversalPolicyResolver

use of org.nhindirect.stagent.policy.impl.UniversalPolicyResolver in project nhin-d by DirectProject.

the class UniversalPolicyResolver_constructTest method testConstruct_multipleExpressions_assertAttributes.

public void testConstruct_multipleExpressions_assertAttributes() {
    final PolicyExpression expression1 = mock(PolicyExpression.class);
    final PolicyExpression expression2 = mock(PolicyExpression.class);
    final UniversalPolicyResolver resolver = new UniversalPolicyResolver(Arrays.asList(expression1, expression2));
    assertNotNull(resolver);
    assertEquals(2, resolver.expressions.size());
    final Iterator<PolicyExpression> iter = resolver.expressions.iterator();
    assertEquals(expression1, iter.next());
    assertEquals(expression2, iter.next());
}
Also used : UniversalPolicyResolver(org.nhindirect.stagent.policy.impl.UniversalPolicyResolver) PolicyExpression(org.nhindirect.policy.PolicyExpression)

Aggregations

PolicyExpression (org.nhindirect.policy.PolicyExpression)2 UniversalPolicyResolver (org.nhindirect.stagent.policy.impl.UniversalPolicyResolver)2