From a1628289f118fd20591d750bfa5e2e196eb3275e Mon Sep 17 00:00:00 2001 From: remillet Date: Fri, 7 Aug 2015 16:53:42 -0700 Subject: [PATCH] CSPACE-6770: More changes for RESTEasy client framework upgrade from 2.x to 3.0 --- .../test/RelationIntegrationTest.java | 7 +- .../test/PerformanceTest.java | 10 +- .../client/AbstractPoxServiceClientImpl.java | 6 +- .../client/AbstractServiceClientImpl.java | 4 +- .../client/CollectionSpaceClient.java | 4 +- .../client/CollectionSpacePoxClient.java | 6 +- .../client/CollectionSpacePoxProxy.java | 8 +- .../services/client/CollectionSpaceProxy.java | 4 +- .../client/test/AbstractServiceTestImpl.java | 81 ++++++----- .../test/CollectionObjectSearchTest.java | 136 +++++++++--------- .../client/test/WorkflowServiceTest.java | 12 +- 11 files changed, 152 insertions(+), 126 deletions(-) diff --git a/services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/RelationIntegrationTest.java b/services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/RelationIntegrationTest.java index 588294380..6e8c33e3b 100644 --- a/services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/RelationIntegrationTest.java +++ b/services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/RelationIntegrationTest.java @@ -187,7 +187,8 @@ public class RelationIntegrationTest extends CollectionSpaceIntegrationTest { // Now lock the dimension record. @SuppressWarnings("unused") - ClientResponse workflowResponse = dimensionClient.updateWorkflowWithTransition(dimensionCsid1, WorkflowClient.WORKFLOWTRANSITION_LOCK); + Response workflowResponse = dimensionClient.updateWorkflowWithTransition( + dimensionCsid1, WorkflowClient.WORKFLOWTRANSITION_LOCK); System.out.println("Locked dimension record with CSID=" + dimensionCsid1); // Finally, try to delete the relationship @@ -367,7 +368,9 @@ public class RelationIntegrationTest extends CollectionSpaceIntegrationTest { } @SuppressWarnings("unused") - ClientResponse workflowResponse = dimensionClient.updateWorkflowWithTransition(dimensionCsid, WorkflowClient.WORKFLOWTRANSITION_LOCK); + Response workflowResponse = dimensionClient.updateWorkflowWithTransition(dimensionCsid, + WorkflowClient.WORKFLOWTRANSITION_LOCK); + workflowResponse.close(); System.out.println("Locked dimension record with CSID=" + dimensionCsid); // Lastly, relate the two entities, by creating a new relation object diff --git a/services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/PerformanceTest.java b/services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/PerformanceTest.java index b610d8c89..415d9a0b4 100644 --- a/services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/PerformanceTest.java +++ b/services/PerformanceTests/src/test/java/org/collectionspace/services/PerformanceTests/test/PerformanceTest.java @@ -116,7 +116,7 @@ public class PerformanceTest extends CollectionSpacePerformanceTest { private void searchCollectionObjects(int numberOfObjects) { CollectionObjectClient collectionObjectClient = new CollectionObjectClient(); Random randomGenerator = new Random(System.currentTimeMillis()); - ClientResponse searchResults; + Response searchResultsResponse; long totalTime = 0; long totalSearchResults = 0; @@ -129,15 +129,16 @@ public class PerformanceTest extends CollectionSpacePerformanceTest { for (int i = 0; i < MAX_SEARCHES; i++) { //sandwich the call with timestamps Date startTime = new Date(); - searchResults = collectionObjectClient.keywordSearchIncludeDeleted(keywords, NOT_INCLUDING_DELETED_RESOURCES); + searchResultsResponse = collectionObjectClient.keywordSearchIncludeDeleted(keywords, + NOT_INCLUDING_DELETED_RESOURCES); Date stopTime = new Date(); //extract the result list and release the ClientResponse AbstractCommonList coListItem = null; try { - coListItem = searchResults.getEntity(); + coListItem = searchResultsResponse.readEntity(AbstractCommonList.class); } finally { - searchResults.close(); + searchResultsResponse.close(); } long time = stopTime.getTime() - startTime.getTime(); @@ -146,6 +147,7 @@ public class PerformanceTest extends CollectionSpacePerformanceTest { totalSearchResults = totalSearchResults + coListItem.getListItem().size(); } + if (logger.isDebugEnabled()) { System.out.println("------------------------------------------------------------------------------"); System.out.println("Searched Objects: " + numberOfObjects); diff --git a/services/client/src/main/java/org/collectionspace/services/client/AbstractPoxServiceClientImpl.java b/services/client/src/main/java/org/collectionspace/services/client/AbstractPoxServiceClientImpl.java index cdd26cd35..42fdf7e1d 100644 --- a/services/client/src/main/java/org/collectionspace/services/client/AbstractPoxServiceClientImpl.java +++ b/services/client/src/main/java/org/collectionspace/services/client/AbstractPoxServiceClientImpl.java @@ -35,7 +35,7 @@ public abstract class AbstractPoxServiceClientImpl readIncludeDeleted(String csid, Boolean includeDeleted) { + public Response readIncludeDeleted(String csid, Boolean includeDeleted) { return getProxy().readIncludeDeleted(csid, includeDeleted.toString()); } @@ -46,13 +46,13 @@ public abstract class AbstractPoxServiceClientImpl keywordSearchIncludeDeleted(String keywords, Boolean includeDeleted) { + public Response keywordSearchIncludeDeleted(String keywords, Boolean includeDeleted) { CollectionSpacePoxProxy proxy = getProxy(); return proxy.keywordSearchIncludeDeleted(keywords, includeDeleted.toString()); } @Override - public ClientResponse advancedSearchIncludeDeleted(String whereClause, Boolean includeDeleted) { + public Response advancedSearchIncludeDeleted(String whereClause, Boolean includeDeleted) { CollectionSpacePoxProxy proxy = getProxy(); return proxy.advancedSearchIncludeDeleted(whereClause, includeDeleted.toString()); } diff --git a/services/client/src/main/java/org/collectionspace/services/client/AbstractServiceClientImpl.java b/services/client/src/main/java/org/collectionspace/services/client/AbstractServiceClientImpl.java index 8304dfc89..64d8da7a8 100644 --- a/services/client/src/main/java/org/collectionspace/services/client/AbstractServiceClientImpl.java +++ b/services/client/src/main/java/org/collectionspace/services/client/AbstractServiceClientImpl.java @@ -528,12 +528,12 @@ public abstract class AbstractServiceClientImpl getWorkflow(String csid) { + public Response getWorkflow(String csid) { return getProxy().getWorkflow(csid); } @Override - public ClientResponse updateWorkflowWithTransition(String csid, String workflowTransition) { + public Response updateWorkflowWithTransition(String csid, String workflowTransition) { return getProxy().updateWorkflowWithTransition(csid, workflowTransition); } diff --git a/services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceClient.java b/services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceClient.java index 298751101..4f932c041 100644 --- a/services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceClient.java +++ b/services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceClient.java @@ -216,9 +216,9 @@ public interface CollectionSpaceClient getWorkflow(String csid); + public Response getWorkflow(String csid); - public ClientResponse updateWorkflowWithTransition(String csid, String workflowTransition); + public Response updateWorkflowWithTransition(String csid, String workflowTransition); /** * Gets the authority refs. diff --git a/services/client/src/main/java/org/collectionspace/services/client/CollectionSpacePoxClient.java b/services/client/src/main/java/org/collectionspace/services/client/CollectionSpacePoxClient.java index 0efbfb9c2..e7830f392 100644 --- a/services/client/src/main/java/org/collectionspace/services/client/CollectionSpacePoxClient.java +++ b/services/client/src/main/java/org/collectionspace/services/client/CollectionSpacePoxClient.java @@ -3,7 +3,7 @@ package org.collectionspace.services.client; import javax.ws.rs.core.Response; import org.collectionspace.services.jaxb.AbstractCommonList; -import org.jboss.resteasy.client.ClientResponse; +//import org.jboss.resteasy.client.ClientResponse; /* * = List type @@ -23,7 +23,7 @@ public interface CollectionSpacePoxClient keywordSearchIncludeDeleted(String keywords, Boolean includeDeleted); + public Response keywordSearchIncludeDeleted(String keywords, Boolean includeDeleted); - public ClientResponse advancedSearchIncludeDeleted(String whereClause, Boolean includeDeleted); + public Response advancedSearchIncludeDeleted(String whereClause, Boolean includeDeleted); } diff --git a/services/client/src/main/java/org/collectionspace/services/client/CollectionSpacePoxProxy.java b/services/client/src/main/java/org/collectionspace/services/client/CollectionSpacePoxProxy.java index 3f17a9f20..df0321a10 100644 --- a/services/client/src/main/java/org/collectionspace/services/client/CollectionSpacePoxProxy.java +++ b/services/client/src/main/java/org/collectionspace/services/client/CollectionSpacePoxProxy.java @@ -8,7 +8,7 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.Response; -import org.jboss.resteasy.client.ClientResponse; +//import org.jboss.resteasy.client.ClientResponse; import org.collectionspace.services.client.workflow.WorkflowClient; import org.collectionspace.services.jaxb.AbstractCommonList; @@ -28,7 +28,7 @@ public interface CollectionSpacePoxProxy extends // (R)ead @GET @Path("/{csid}") - ClientResponse readIncludeDeleted( + Response readIncludeDeleted( @PathParam("csid") String csid, @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState); @@ -53,13 +53,13 @@ public interface CollectionSpacePoxProxy extends */ @GET @Produces({ "application/xml" }) - ClientResponse keywordSearchIncludeDeleted( + Response keywordSearchIncludeDeleted( @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords, @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState); @GET @Produces({ "application/xml" }) - ClientResponse advancedSearchIncludeDeleted( + Response advancedSearchIncludeDeleted( @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_AS) String whereClause, @QueryParam(WorkflowClient.WORKFLOWSTATE_QUERY) String workflowState); diff --git a/services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceProxy.java b/services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceProxy.java index 0532b507a..6fa4eebd9 100644 --- a/services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceProxy.java +++ b/services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceProxy.java @@ -62,13 +62,13 @@ public interface CollectionSpaceProxy { @Produces({"application/xml"}) @Consumes({"application/xml"}) @Path("{csid}" + WorkflowClient.SERVICE_PATH) - ClientResponse getWorkflow(@PathParam("csid") String csid); + Response getWorkflow(@PathParam("csid") String csid); @PUT @Produces({"application/xml"}) @Consumes({"application/xml"}) @Path("{csid}" + WorkflowClient.SERVICE_PATH + "/" + "{transition}") - ClientResponse updateWorkflowWithTransition(@PathParam("csid") String csid, @PathParam("transition") String transition); + Response updateWorkflowWithTransition(@PathParam("csid") String csid, @PathParam("transition") String transition); /* * (R)read List operations diff --git a/services/client/src/main/java/org/collectionspace/services/client/test/AbstractServiceTestImpl.java b/services/client/src/main/java/org/collectionspace/services/client/test/AbstractServiceTestImpl.java index 8c1e9b02e..de2e72d0a 100644 --- a/services/client/src/main/java/org/collectionspace/services/client/test/AbstractServiceTestImpl.java +++ b/services/client/src/main/java/org/collectionspace/services/client/test/AbstractServiceTestImpl.java @@ -671,26 +671,35 @@ public abstract class AbstractServiceTestImpl res = client.keywordSearchIncludeDeleted(KEYWORD, Boolean.FALSE); - int result = res.getStatus(); - Assert.assertEquals(result, STATUS_OK); - - AbstractCommonList list = res.getEntity(); - long itemsMatchedBySearch = list.getTotalItems(); - Assert.assertEquals(itemsMatchedBySearch, OBJECTS_TO_CREATE - 1, - "The number of items marked for delete is not correct."); + Response res = client.keywordSearchIncludeDeleted(KEYWORD, Boolean.FALSE); + try { + int result = res.getStatus(); + Assert.assertEquals(result, STATUS_OK); + + CLT list = res.readEntity(getCommonListType()); + long itemsMatchedBySearch = this.getSizeOfList(list); //list.getTotalItems(); + Assert.assertEquals(itemsMatchedBySearch, OBJECTS_TO_CREATE - 1, + "The number of items marked for delete is not correct."); + } finally { + res.close(); + } + // // Search for the newly-created records, including the soft deleted record. // // Send the search request and receive a response res = client.keywordSearchIncludeDeleted(KEYWORD, Boolean.TRUE); - result = res.getStatus(); - Assert.assertEquals(result, STATUS_OK); - - list = res.getEntity(); - itemsMatchedBySearch = list.getTotalItems(); - Assert.assertEquals(itemsMatchedBySearch, OBJECTS_TO_CREATE, - "Deleted item was not returned in list results, even though it was requested to be included."); + try { + int result = res.getStatus(); + Assert.assertEquals(result, STATUS_OK); + + CLT list = res.readEntity(getCommonListType()); + long itemsMatchedBySearch = this.getSizeOfList(list); //list.getTotalItems(); + Assert.assertEquals(itemsMatchedBySearch, OBJECTS_TO_CREATE, + "Deleted item was not returned in list results, even though it was requested to be included."); + } finally { + res.close(); + } } catch (UnsupportedOperationException e) { logger.warn(this.getClass().getName() + " did not implement createWorkflowTarget() method. No workflow tests performed."); @@ -881,17 +890,17 @@ public abstract class AbstractServiceTestImpl res = client.getWorkflow(resourceId); + Response res = client.getWorkflow(resourceId); WorkflowCommon workflowCommons = null; try { assertStatusCode(res, testName); logger.debug("Got object to update life cycle state with ID: " + resourceId); - PoxPayloadIn input = new PoxPayloadIn(res.getEntity()); + PoxPayloadIn input = new PoxPayloadIn((String)res.readEntity(String.class)); workflowCommons = (WorkflowCommon) extractPart(input, WorkflowClient.SERVICE_COMMONPART_NAME, WorkflowCommon.class); Assert.assertNotNull(workflowCommons); } finally { if (res != null) { - res.releaseConnection(); + res.close(); } } // @@ -908,12 +917,12 @@ public abstract class AbstractServiceTestImpl res = client.readItem(parentCsid, csid, Boolean.FALSE); - - int result = res.getStatus(); - Assert.assertEquals(result, STATUS_NOT_FOUND); + try { + int result = res.getStatus(); + Assert.assertEquals(result, STATUS_NOT_FOUND); + } finally { + res.close(); + } } catch (UnsupportedOperationException e) { logger.warn(this.getClass().getName() + " did not implement createWorkflowTarget() method. No workflow tests performed."); @@ -1179,7 +1194,7 @@ public abstract class AbstractServiceTestImpl res = doAdvancedSearch(propertyName, propertyValue, "="); + Response res = doAdvancedSearch(propertyName, propertyValue, "="); try { int statusCode = res.getStatus(); @@ -202,7 +202,7 @@ public class CollectionObjectSearchTest extends BaseServiceTest res = doSearch(KEYWORD); + Response res = doSearch(KEYWORD); try { int statusCode = res.getStatus(); @@ -245,7 +245,7 @@ public class CollectionObjectSearchTest extends BaseServiceTest res = doSearch(TWO_KEYWORDS); + Response res = doSearch(TWO_KEYWORDS); try { int statusCode = res.getStatus(); @@ -313,44 +313,52 @@ public class CollectionObjectSearchTest extends BaseServiceTest res = doSearch(TWO_MORE_KEYWORDS); - int statusCode = res.getStatus(); - - // Check the status code of the response: does it match - // the expected response(s)? - if (logger.isDebugEnabled()) { - logger.debug(testName + ": status = " + statusCode); + Response res = doSearch(TWO_MORE_KEYWORDS); + try { + int statusCode = res.getStatus(); + + // Check the status code of the response: does it match + // the expected response(s)? + if (logger.isDebugEnabled()) { + logger.debug(testName + ": status = " + statusCode); + } + Assert.assertTrue(testRequestType.isValidStatusCode(statusCode), + invalidStatusCodeMessage(testRequestType, statusCode)); + Assert.assertEquals(statusCode, testExpectedStatusCode); + + // Verify that the number of resources matched by the search + // is identical to the expected result + long NUM_MATCHES_EXPECTED = numKeywordRetrievableResources; + long numMatched = getNumMatched(res, NUM_MATCHES_EXPECTED, testName); + Assert.assertEquals(numMatched, NUM_MATCHES_EXPECTED); + } finally { + res.close(); } - Assert.assertTrue(testRequestType.isValidStatusCode(statusCode), - invalidStatusCodeMessage(testRequestType, statusCode)); - Assert.assertEquals(statusCode, testExpectedStatusCode); - - // Verify that the number of resources matched by the search - // is identical to the expected result - long NUM_MATCHES_EXPECTED = numKeywordRetrievableResources; - long numMatched = getNumMatched(res, NUM_MATCHES_EXPECTED, testName); - Assert.assertEquals(numMatched, NUM_MATCHES_EXPECTED); // Search using a single term // Send the search request and receive a response res = doSearch(TWO_MORE_KEYWORDS.get(0)); - statusCode = res.getStatus(); - - // Check the status code of the response: does it match - // the expected response(s)? - if (logger.isDebugEnabled()) { - logger.debug(testName + ": status = " + statusCode); + try { + int statusCode = res.getStatus(); + + // Check the status code of the response: does it match + // the expected response(s)? + if (logger.isDebugEnabled()) { + logger.debug(testName + ": status = " + statusCode); + } + Assert.assertTrue(testRequestType.isValidStatusCode(statusCode), + invalidStatusCodeMessage(testRequestType, statusCode)); + Assert.assertEquals(statusCode, testExpectedStatusCode); + + // Verify that the number of resources matched by the search + // is identical to the expected result + long NUM_MATCHES_EXPECTED = numKeywordRetrievableResources; + long numMatched = getNumMatched(res, NUM_MATCHES_EXPECTED, testName); + Assert.assertEquals(numMatched, NUM_MATCHES_EXPECTED); + } finally { + res.close(); } - Assert.assertTrue(testRequestType.isValidStatusCode(statusCode), - invalidStatusCodeMessage(testRequestType, statusCode)); - Assert.assertEquals(statusCode, testExpectedStatusCode); - - // Verify that the number of resources matched by the search - // is identical to the expected result - NUM_MATCHES_EXPECTED = numKeywordRetrievableResources; - numMatched = getNumMatched(res, NUM_MATCHES_EXPECTED, testName); - Assert.assertEquals(numMatched, NUM_MATCHES_EXPECTED); } @@ -380,23 +388,27 @@ public class CollectionObjectSearchTest extends BaseServiceTest res = doSearch(UTF8_KEYWORD); - int statusCode = res.getStatus(); - - // Check the status code of the response: does it match - // the expected response(s)? - if (logger.isDebugEnabled()) { - logger.debug(testName + ": status = " + statusCode); + Response res = doSearch(UTF8_KEYWORD); + try { + int statusCode = res.getStatus(); + + // Check the status code of the response: does it match + // the expected response(s)? + if (logger.isDebugEnabled()) { + logger.debug(testName + ": status = " + statusCode); + } + Assert.assertTrue(testRequestType.isValidStatusCode(statusCode), + invalidStatusCodeMessage(testRequestType, statusCode)); + Assert.assertEquals(statusCode, testExpectedStatusCode); + + // Verify that the number of resources matched by the search + // is identical to the expected result + long NUM_MATCHES_EXPECTED = numKeywordRetrievableResources; + long numMatched = getNumMatched(res, NUM_MATCHES_EXPECTED, testName); + Assert.assertEquals(numMatched, NUM_MATCHES_EXPECTED); + } finally { + res.close(); } - Assert.assertTrue(testRequestType.isValidStatusCode(statusCode), - invalidStatusCodeMessage(testRequestType, statusCode)); - Assert.assertEquals(statusCode, testExpectedStatusCode); - - // Verify that the number of resources matched by the search - // is identical to the expected result - long NUM_MATCHES_EXPECTED = numKeywordRetrievableResources; - long numMatched = getNumMatched(res, NUM_MATCHES_EXPECTED, testName); - Assert.assertEquals(numMatched, NUM_MATCHES_EXPECTED); } // Failure outcomes @@ -408,10 +420,9 @@ public class CollectionObjectSearchTest extends BaseServiceTest res = doSearch(NON_EXISTENT_KEYWORD); - int statusCode; + Response res = doSearch(NON_EXISTENT_KEYWORD); try { - statusCode = res.getStatus(); + int statusCode = res.getStatus(); // Check the status code of the response: does it match // the expected response(s)? @@ -533,12 +544,12 @@ public class CollectionObjectSearchTest extends BaseServiceTest doSearch(List keywords) { + private Response doSearch(List keywords) { String searchParamValue = listToString(keywords, KEYWORD_SEPARATOR); return doSearch(searchParamValue); } - private ClientResponse doAdvancedSearch( + private Response doAdvancedSearch( String propertyName, String propertyValue, String operator) { if (logger.isDebugEnabled()) { logger.debug("Searching on property: " + propertyName + "=" @@ -547,12 +558,12 @@ public class CollectionObjectSearchTest extends BaseServiceTest res = client.advancedSearchIncludeDeleted(whereClause, false); // NOT_INCLUDING_DELETED_RESOURCES + Response res = client.advancedSearchIncludeDeleted(whereClause, false); // NOT_INCLUDING_DELETED_RESOURCES return res; } - private ClientResponse doSearch(String keyword) { + private Response doSearch(String keyword) { String searchParamValue = keyword; if (logger.isDebugEnabled()) { logger.debug("Searching on keyword(s): " + searchParamValue @@ -560,16 +571,13 @@ public class CollectionObjectSearchTest extends BaseServiceTest res = client - .keywordSearchIncludeDeleted(searchParamValue, + Response res = client.keywordSearchIncludeDeleted(searchParamValue, NOT_INCLUDING_DELETED_RESOURCES); return res; } - private long getNumMatched(ClientResponse res, - long numExpectedMatches, String testName) { - AbstractCommonList list = (AbstractCommonList) res - .getEntity(AbstractCommonList.class); + private long getNumMatched(Response res, long numExpectedMatches, String testName) { + AbstractCommonList list = (AbstractCommonList) res.readEntity(AbstractCommonList.class); long numMatched = list.getTotalItems(); if (logger.isDebugEnabled()) { logger.debug("Keyword search matched " + numMatched diff --git a/services/workflow/client/src/test/java/org/collectionspace/services/client/test/WorkflowServiceTest.java b/services/workflow/client/src/test/java/org/collectionspace/services/client/test/WorkflowServiceTest.java index 44f115c50..47b67d9f8 100644 --- a/services/workflow/client/src/test/java/org/collectionspace/services/client/test/WorkflowServiceTest.java +++ b/services/workflow/client/src/test/java/org/collectionspace/services/client/test/WorkflowServiceTest.java @@ -22,21 +22,19 @@ */ package org.collectionspace.services.client.test; +import javax.ws.rs.core.Response; + import org.collectionspace.services.client.CollectionSpaceClient; import org.collectionspace.services.client.PayloadOutputPart; import org.collectionspace.services.client.PoxPayloadIn; import org.collectionspace.services.client.PoxPayloadOut; - import org.collectionspace.services.jaxb.AbstractCommonList; import org.collectionspace.services.workflow.WorkflowCommon; import org.collectionspace.services.client.DimensionClient; import org.collectionspace.services.client.workflow.WorkflowClient; import org.collectionspace.services.dimension.DimensionsCommon; - import org.jboss.resteasy.client.ClientResponse; - import org.testng.Assert; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -82,10 +80,10 @@ public class WorkflowServiceTest extends AbstractPoxServiceTestImpl res = client.getWorkflow(knownResourceId); + Response res = client.getWorkflow(knownResourceId); try { assertStatusCode(res, testName); - PoxPayloadIn input = new PoxPayloadIn(res.getEntity()); + PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity()); WorkflowCommon workflowsCommon = (WorkflowCommon) extractPart(input, WorkflowClient.SERVICE_COMMONPART_NAME, WorkflowCommon.class); if (logger.isDebugEnabled() == true) { logger.debug("Workflow payload is: " + input.getXmlPayload()); @@ -93,7 +91,7 @@ public class WorkflowServiceTest extends AbstractPoxServiceTestImpl