bus = control.createMock(Bus.class);
constants = new PolicyConstants();
constants.setNamespace(PolicyConstants.NAMESPACE_XMLSOAP_200409);
EasyMock.expect(bus.getExtension(PolicyConstants.class)).andReturn(constants).anyTimes();
AssertionBuilderRegistry abr = new AssertionBuilderRegistryImpl();
builder = new PolicyBuilderImpl();
builder.setBus(bus);
builder.setAssertionBuilderRegistry(abr);
NestedPrimitiveAssertionBuilder npab = new NestedPrimitiveAssertionBuilder();
npab.setBus(bus);
npab.setPolicyBuilder(builder);
npab.setKnownElements(Collections.singletonList(TEST_NAME1));
abr.register(TEST_NAME1, npab);
PrimitiveAssertionBuilder pab = new PrimitiveAssertionBuilder();
pab.setBus(bus);
Collection<QName> known = new ArrayList<QName>();
known.add(TEST_NAME2);
known.add(TEST_NAME3);
pab.setKnownElements(known);
abr.register(TEST_NAME2, pab);
abr.register(TEST_NAME3, pab);
control.replay();
}