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
This commit is contained in:
parent
58e3ef8a37
commit
db3d6a3cf7
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue