@Test
public void runAs() throws Exception {

    ResourceAddress address = new ResourceAddress()
            .add("subsystem", "datasources")
            .add("data-source", "foo");
    Operation operation = new Operation.Builder(address, ADD)
            .param(JNDI_NAME, "java:/bar")
            .header("header1", "value1")
            .build();
    assertOperation(operation.runAs(Collections.singleton("Administrator")), "Administrator");
}