private List<RepositoryContentClassListResource> getContentClasses(XStream xstream, MediaType mediaType,
int failureId)
throws IOException
{
XStreamRepresentation representation = new XStreamRepresentation(xstream, "", mediaType);
String serviceURI = "service/local/components/repo_content_classes";
Response response = RequestFacade.sendMessage(serviceURI, Method.GET, representation);
if (failureId > -1) {
Assert.assertEquals(failureId, response.getStatus().getCode());
return null;
}
else {
String responseString = response.getEntity().getText();
representation = new XStreamRepresentation(xstream, responseString, mediaType);
RepositoryContentClassListResourceResponse resourceResponse =
(RepositoryContentClassListResourceResponse) representation
.getPayload(new RepositoryContentClassListResourceResponse());
return resourceResponse.getData();
}
}