msg.put(Message.WSDL_SERVICE, QName.valueOf(service));
String resourceURL = "/doubleit";
msg.put(Message.REQUEST_URI, resourceURL);
XACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
RequestType request =
builder.createRequest(principal, Collections.singletonList("manager"), msg);
assertNotNull(request);
String action =
request.getAction().getAttributes().get(0).getAttributeValues().get(0).getValue();
assertEquals(action, "execute");
((DefaultXACMLRequestBuilder)builder).setAction("write");
request = builder.createRequest(principal, Collections.singletonList("manager"), msg);
assertNotNull(request);
action =
request.getAction().getAttributes().get(0).getAttributeValues().get(0).getValue();
assertEquals(action, "write");
}