From b7ef1dd99f76e8f94c760e6603ee3e91efba97f6 Mon Sep 17 00:00:00 2001 From: "manuele.simi" Date: Fri, 15 Feb 2019 04:08:05 +0000 Subject: [PATCH] Update to the new IS and gCube models. Upgrade dependency on resource-registry-context-client to 2.1.0-SNAPSHOT. git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/resource-management/resource-manager@177157 82a268e6-3cf1-43bd-a215-b396298e98cf --- webapp/pom.xml | 12 ++++++------ .../manager/webapp/context/ContextHolder.java | 4 ++-- .../manager/webapp/context/CreateRequest.java | 4 ++-- .../manager/webapp/context/Queries.java | 6 +++--- .../manager/webapp/rs/RMContexts.java | 5 +++-- .../manager/webapp/rs/RMTestForGXRest.java | 10 +++------- .../manager/webapp/context/QueriesTest.java | 11 +++++------ .../manager/webapp/context/RMContextTest.java | 12 ++++++------ 8 files changed, 30 insertions(+), 34 deletions(-) diff --git a/webapp/pom.xml b/webapp/pom.xml index f97bec8..374d1fb 100644 --- a/webapp/pom.xml +++ b/webapp/pom.xml @@ -74,6 +74,12 @@ resource-registry-client + + org.gcube.information-system + resource-registry-context-client + 2.1.0-SNAPSHOT + + org.gcube.core common-events @@ -127,12 +133,6 @@ 0.0.1-SNAPSHOT - - org.gcube.information-system - resource-registry-context-client - 2.0.0-SNAPSHOT - - org.glassfish.jersey.media diff --git a/webapp/src/main/java/org/gcube/resourcemanagement/manager/webapp/context/ContextHolder.java b/webapp/src/main/java/org/gcube/resourcemanagement/manager/webapp/context/ContextHolder.java index dbe95e9..226d54a 100644 --- a/webapp/src/main/java/org/gcube/resourcemanagement/manager/webapp/context/ContextHolder.java +++ b/webapp/src/main/java/org/gcube/resourcemanagement/manager/webapp/context/ContextHolder.java @@ -1,8 +1,8 @@ package org.gcube.resourcemanagement.manager.webapp.context; -import org.gcube.informationsystem.model.impl.utils.ISMapper; -import org.gcube.informationsystem.model.reference.entity.Context; +import org.gcube.informationsystem.model.reference.entities.Context; +import org.gcube.informationsystem.utils.ISMapper; /** diff --git a/webapp/src/main/java/org/gcube/resourcemanagement/manager/webapp/context/CreateRequest.java b/webapp/src/main/java/org/gcube/resourcemanagement/manager/webapp/context/CreateRequest.java index a1178f6..f4b9c4e 100644 --- a/webapp/src/main/java/org/gcube/resourcemanagement/manager/webapp/context/CreateRequest.java +++ b/webapp/src/main/java/org/gcube/resourcemanagement/manager/webapp/context/CreateRequest.java @@ -3,8 +3,8 @@ package org.gcube.resourcemanagement.manager.webapp.context; import java.util.Objects; import org.gcube.common.gxrest.response.outbound.LocalCodeException; -import org.gcube.informationsystem.model.reference.entity.Context; -import org.gcube.informationsystem.model.reference.relation.IsParentOf; +import org.gcube.informationsystem.model.reference.entities.Context; +import org.gcube.informationsystem.model.reference.relations.IsParentOf; import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException; import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextAlreadyPresentException; import org.gcube.resourcemanagement.manager.io.rs.RMCreateContextCode; diff --git a/webapp/src/main/java/org/gcube/resourcemanagement/manager/webapp/context/Queries.java b/webapp/src/main/java/org/gcube/resourcemanagement/manager/webapp/context/Queries.java index e220d93..b45f0aa 100644 --- a/webapp/src/main/java/org/gcube/resourcemanagement/manager/webapp/context/Queries.java +++ b/webapp/src/main/java/org/gcube/resourcemanagement/manager/webapp/context/Queries.java @@ -2,8 +2,8 @@ package org.gcube.resourcemanagement.manager.webapp.context; import java.util.UUID; -import org.gcube.informationsystem.model.reference.entity.Context; -import org.gcube.informationsystem.model.reference.entity.Resource; +import org.gcube.informationsystem.model.reference.entities.Context; +import org.gcube.informationsystem.model.reference.entities.Resource; import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException; import org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClient; import org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClientFactory; @@ -44,7 +44,7 @@ final class Queries { /** * Tests if the given context exists * - * @param uuid + * @param context * @return */ protected boolean contextExists(UUID context) { diff --git a/webapp/src/main/java/org/gcube/resourcemanagement/manager/webapp/rs/RMContexts.java b/webapp/src/main/java/org/gcube/resourcemanagement/manager/webapp/rs/RMContexts.java index 29bbdf7..c19e865 100644 --- a/webapp/src/main/java/org/gcube/resourcemanagement/manager/webapp/rs/RMContexts.java +++ b/webapp/src/main/java/org/gcube/resourcemanagement/manager/webapp/rs/RMContexts.java @@ -12,9 +12,10 @@ import javax.ws.rs.core.Response; import org.gcube.common.authorization.library.provider.CalledMethodProvider; import org.gcube.common.gxrest.response.outbound.GXOutboundErrorResponse; import org.gcube.common.gxrest.response.outbound.GXOutboundSuccessResponse; -import org.gcube.informationsystem.model.reference.entity.Context; import static org.gcube.resourcemanagement.manager.io.rs.RMContextsAccess.*; + +import org.gcube.informationsystem.model.reference.entities.Context; import org.gcube.resourcemanagement.manager.webapp.ResourceInitializer; import org.gcube.resourcemanagement.manager.webapp.context.CreateRequest; import org.gcube.resourcemanagement.manager.webapp.context.DeleteRequest; @@ -26,7 +27,7 @@ import java.util.UUID; /** - * Resource methods for {@link Context}. + * Resource methods for {@link org.gcube.informationsystem.model.reference.entities.Context}. * * @author Manuele Simi (ISTI-CNR) * diff --git a/webapp/src/main/java/org/gcube/resourcemanagement/manager/webapp/rs/RMTestForGXRest.java b/webapp/src/main/java/org/gcube/resourcemanagement/manager/webapp/rs/RMTestForGXRest.java index 388889f..2c708a2 100644 --- a/webapp/src/main/java/org/gcube/resourcemanagement/manager/webapp/rs/RMTestForGXRest.java +++ b/webapp/src/main/java/org/gcube/resourcemanagement/manager/webapp/rs/RMTestForGXRest.java @@ -17,19 +17,15 @@ import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import javax.xml.bind.Unmarshaller; import org.gcube.common.authorization.library.provider.CalledMethodProvider; import org.gcube.common.gxrest.response.outbound.GXOutboundErrorResponse; import org.gcube.common.gxrest.response.outbound.GXOutboundSuccessResponse; -import org.gcube.informationsystem.model.impl.entity.ContextImpl; -import org.gcube.informationsystem.model.impl.utils.ISMapper; -import org.gcube.informationsystem.model.reference.entity.Context; +import org.gcube.informationsystem.model.impl.entities.ContextImpl; +import org.gcube.informationsystem.model.reference.entities.Context; +import org.gcube.informationsystem.utils.ISMapper; import org.gcube.resourcemanagement.manager.io.rs.RMContextDoesNotExistException; import org.gcube.resourcemanagement.manager.webapp.ResourceInitializer; -import org.gcube.resourcemanagement.manager.webapp.context.ContextHolder; -import org.gcube.resourcemanagement.manager.webapp.context.CreateRequest; -import org.gcube.resourcemanagement.manager.webapp.context.ResponseFromResourceRegistry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/webapp/src/test/java/org/gcube/resourcemanagement/manager/webapp/context/QueriesTest.java b/webapp/src/test/java/org/gcube/resourcemanagement/manager/webapp/context/QueriesTest.java index 34c7ad9..3046167 100644 --- a/webapp/src/test/java/org/gcube/resourcemanagement/manager/webapp/context/QueriesTest.java +++ b/webapp/src/test/java/org/gcube/resourcemanagement/manager/webapp/context/QueriesTest.java @@ -16,7 +16,7 @@ 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.scope.api.ScopeProvider; -import org.gcube.informationsystem.model.reference.entity.Context; +import org.gcube.informationsystem.model.reference.entities.Context; import org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClient; import org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClientImpl; import org.gcube.informationsystem.resourceregistry.context.ResourceRegistryContextClient; @@ -100,7 +100,7 @@ public class QueriesTest { } /** - * Test method for {@link org.gcube.resourcemanagement.manager.webapp.context.Queries#fetchContext(UUID, client)}. + * Test method for {@link org.gcube.resourcemanagement.manager.webapp.context.Queries#fetchContext(UUID)} . */ @Test public void testFetchContext() { @@ -110,11 +110,10 @@ public class QueriesTest { ResourceRegistryClient rclient = new ResourceRegistryClientImpl(RR); Queries queries = new Queries(cclient, rclient); Context context = queries.fetchContext(context1UUID); - if (Objects.nonNull(context)) { - assertNotNull("Context does not exist.", context); - assertEquals("Unexpected uuid for context", context1UUID, context.getHeader().getUUID()); + assertNotNull("Context does not exist.", context); + assertEquals("Unexpected uuid for context", context1UUID, context.getHeader().getUUID()); - } + } } 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 4b74111..1e40dcc 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 @@ -21,11 +21,11 @@ import org.gcube.common.gxrest.response.inbound.GXInboundResponse; import org.gcube.common.gxrest.response.outbound.CodeFinder; import org.gcube.common.gxrest.response.outbound.ErrorCode; import org.gcube.common.scope.api.ScopeProvider; -import org.gcube.informationsystem.model.impl.entity.ContextImpl; -import org.gcube.informationsystem.model.impl.utils.ISMapper; -import org.gcube.informationsystem.model.reference.entity.Context; +import org.gcube.informationsystem.model.impl.entities.ContextImpl; +import org.gcube.informationsystem.model.reference.entities.Context; import org.gcube.informationsystem.resourceregistry.context.ResourceRegistryContextClient; import org.gcube.informationsystem.resourceregistry.context.ResourceRegistryContextClientImpl; +import org.gcube.informationsystem.utils.ISMapper; import org.gcube.resourcemanagement.manager.io.rs.RMCreateContextCode; import org.gcube.resourcemanagement.manager.io.rs.RMContextsAccess; import org.gcube.resourcemanagement.manager.webapp.rs.RMContexts; @@ -139,7 +139,7 @@ public class RMContextTest extends JerseyTest { /** * Test method for - * {@link org.gcube.resourcemanagement.manager.webapp.rs.RMContexts#create(String)}. + * {@link org.gcube.resourcemanagement.manager.webapp.rs.RMContexts#create(String, String)}. * * @throws Exception */ @@ -184,7 +184,7 @@ public class RMContextTest extends JerseyTest { /** * Test method for - * {@link org.gcube.resourcemanagement.manager.webapp.rs.RMContexts#create(java.lang.String)} + * {@link org.gcube.resourcemanagement.manager.webapp.rs.RMContexts#create(String, String)} * when the parent does not exist. */ @Test @@ -213,7 +213,7 @@ public class RMContextTest extends JerseyTest { /** * Test method for - * {@link org.gcube.resourcemanagement.manager.webapp.rs.RMContexts#create(java.lang.String)} + * {@link org.gcube.resourcemanagement.manager.webapp.rs.RMContexts#create(String, String)}. * when the parent does not exist. */ @Test