"{\"data\":{\"id\":null,\"name\":\"Test Role\",\"description\":\"This is a test role\",\"sessionTimeout\":50,"
+ "\"roles\":[\"roleid\"],\"privileges\":[\"privid\"]}}}";
XStreamRepresentation representation =
new XStreamRepresentation(xstream, jsonString, MediaType.APPLICATION_JSON);
RoleResourceRequest request = (RoleResourceRequest) representation.getPayload(new RoleResourceRequest());
assert request.getData().getId() == null;
assert request.getData().getName().equals("Test Role");
assert request.getData().getDescription().equals("This is a test role");
assert request.getData().getSessionTimeout() == 50;
assert request.getData().getRoles().size() == 1;
assert ((String) request.getData().getRoles().get(0)).equals("roleid");
assert request.getData().getPrivileges().size() == 1;
assert ((String) request.getData().getPrivileges().get(0)).equals("privid");
}