use of org.nhindirect.policy.PolicyExpression 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());
}
use of org.nhindirect.policy.PolicyExpression 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());
}
use of org.nhindirect.policy.PolicyExpression in project nhin-d by DirectProject.
the class UniversalPolicyResolver_getPolicyTest method testGetOutgoingPolicy_assertPolicyRetrieved.
public void testGetOutgoingPolicy_assertPolicyRetrieved() throws Exception {
final PolicyExpression expression = mock(PolicyExpression.class);
final UniversalPolicyResolver resolver = new UniversalPolicyResolver(expression);
final Collection<PolicyExpression> policies = resolver.getOutgoingPolicy(new InternetAddress("me@you.com"));
assertEquals(1, policies.size());
assertEquals(expression, policies.iterator().next());
}
use of org.nhindirect.policy.PolicyExpression in project nhin-d by DirectProject.
the class UniversalPolicyResolver_getPolicyTest method testGetOutgoingPolicy_nullAddress_assertException.
public void testGetOutgoingPolicy_nullAddress_assertException() throws Exception {
final PolicyExpression expression = mock(PolicyExpression.class);
final UniversalPolicyResolver resolver = new UniversalPolicyResolver(expression);
boolean execptionOccured = false;
try {
resolver.getOutgoingPolicy(null);
} catch (IllegalArgumentException e) {
execptionOccured = true;
}
assertTrue(execptionOccured);
}
use of org.nhindirect.policy.PolicyExpression in project nhin-d by DirectProject.
the class UniversalPolicyResolver_getPolicyTest method testGetIncomingPolicy_nullAddress_assertException.
public void testGetIncomingPolicy_nullAddress_assertException() throws Exception {
final PolicyExpression expression = mock(PolicyExpression.class);
final UniversalPolicyResolver resolver = new UniversalPolicyResolver(expression);
boolean execptionOccured = false;
try {
resolver.getIncomingPolicy(null);
} catch (IllegalArgumentException e) {
execptionOccured = true;
}
assertTrue(execptionOccured);
}
Aggregations