From db3d6a3cf7ee0e9a64e85ef6817fca0fba476688 Mon Sep 17 00:00:00 2001 From: "manuele.simi" Date: Mon, 12 Feb 2018 05:10:11 +0000 Subject: [PATCH] Use GXInboundResponse to access to the response returned by the resource methods. git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/resource-management/resource-manager@163183 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../manager/webapp/context/RMContextTest.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/webapp/src/test/java/org/gcube/resourcemanagement/manager/webapp/context/RMContextTest.java b/webapp/src/test/java/org/gcube/resourcemanagement/manager/webapp/context/RMContextTest.java index e04e1d1..5819824 100644 --- a/webapp/src/test/java/org/gcube/resourcemanagement/manager/webapp/context/RMContextTest.java +++ b/webapp/src/test/java/org/gcube/resourcemanagement/manager/webapp/context/RMContextTest.java @@ -4,7 +4,6 @@ import static org.junit.Assert.*; import java.io.IOException; import java.io.InputStream; -import java.util.Objects; import java.util.Properties; import java.util.UUID; @@ -18,8 +17,8 @@ import org.gcube.common.authorization.client.Constants; import org.gcube.common.authorization.client.exceptions.ObjectNotFound; import org.gcube.common.authorization.library.AuthorizationEntry; import org.gcube.common.authorization.library.provider.SecurityTokenProvider; +import org.gcube.common.gxrest.response.inbound.GXInboundResponse; import org.gcube.common.gxrest.response.outbound.ErrorCode; -import org.gcube.common.gxrest.response.outbound.deserialization.ErrorEntityManager; import org.gcube.common.gxrest.response.outbound.deserialization.SerializableErrorEntity; import org.gcube.common.scope.api.ScopeProvider; import org.gcube.informationsystem.impl.entity.ContextImpl; @@ -162,10 +161,8 @@ public class RMContextTest extends JerseyTest { } else { assertEquals("Unexpected returned code. Reason: " + create.getStatusInfo().getReasonPhrase(), Status.NOT_ACCEPTABLE.getStatusCode(), create.getStatus()); - SerializableErrorEntity entity = create.readEntity(SerializableErrorEntity.class); - ErrorEntityManager response = new ErrorEntityManager(entity); + GXInboundResponse response = new GXInboundResponse(create); if (response.hasException()) { - logger.info("about to load " + entity.getExceptionClass()); try { throw response.getException(); } catch (Exception e) { @@ -270,8 +267,7 @@ public class RMContextTest extends JerseyTest { } else { assertEquals("Unexpected returned code. Reason: " + delete.getStatusInfo().getReasonPhrase(), Status.NOT_ACCEPTABLE.getStatusCode(), delete.getStatus()); - SerializableErrorEntity entity = delete.readEntity(SerializableErrorEntity.class); - ErrorEntityManager response = new ErrorEntityManager(entity); + GXInboundResponse response = new GXInboundResponse(delete); if (response.hasException()) { try { throw response.getException();