emptyPolicy.addPolicyComponent(new All());
doTestUpdateWithEmptyPolicy(emptyPolicy);
}
private void doTestUpdateWithEmptyPolicy(Policy emptyPolicy) {
Policy p1 = new Policy();
QName aqn1 = new QName("http://x.y.z", "a");
p1.addAssertion(mockAssertion(aqn1, 5, true));
EndpointPolicyImpl epi = new TestEndpointPolicy();
control.replay();
epi.setPolicy((Policy)p1.normalize(true));
Policy ep = epi.updatePolicy(emptyPolicy).getPolicy();
List<ExactlyOne> pops =
CastUtils.cast(ep.getPolicyComponents(), ExactlyOne.class);
assertEquals("New policy must have 1 top level policy operator", 1, pops.size());
List<All> alts =
CastUtils.cast(pops.get(0).getPolicyComponents(), All.class);
assertEquals("1 alternatives should be available", 1, alts.size());