}
@Test
public void customBindingData() throws Exception {
List<Policy> policies = Arrays.<Policy>asList(SecurityPolicy.CONFIDENTIALITY);
final MockHandler mockService = new MockHandler();
_serviceDomain.registerService(
new QName(_serviceName),
new InOnlyService(),
mockService,
ServiceMetadataBuilder.create().security(_serviceDomain.getServiceSecurity(null))
.requiredPolicies(policies).registrant(new Binding(new ArrayList<BindingModel>())).build());
_serviceDomain.registerServiceReference(new QName(_serviceName), new InOnlyService("process"));
_camelContext.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("netty://foo").to("switchyard://" + _serviceName + "?operationName=process");
}
});
_camelContext.createProducerTemplate().sendBody("netty://foo", "baja");
LinkedBlockingQueue<Exchange> msgs = mockService.getMessages();
Exchange exchange = msgs.iterator().next();
assertTrue(PolicyUtil.isProvided(exchange, SecurityPolicy.CONFIDENTIALITY));
}