msg.put(Message.WSDL_SERVICE, QName.valueOf(service));
String resourceURL = "https://localhost:8080/doubleit";
msg.put(Message.REQUEST_URI, resourceURL);
DefaultXACMLRequestBuilder 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("execute", action);
builder.setAction("write");
request = builder.createRequest(principal, Collections.singletonList("manager"), msg);
assertNotNull(request);
action =
request.getAction().getAttributes().get(0).getAttributeValues().get(0).getValue();
assertEquals("write", action);
}