From a5d213aa479f5ae16b57563caf7801220baf5bec Mon Sep 17 00:00:00 2001 From: subhash kumar singh Date: Wed, 16 Jan 2019 18:13:48 +0530 Subject: Fix url for catalog query Fix url for catalog query. Change-Id: I694284b9c3b354a5d0e4340b7f7e78744096c80f Issue-ID: SO-1398 Signed-off-by: subhash kumar singh --- .../so/bpmn/common/resource/ResourceRequestBuilder.java | 3 +-- .../bpmn/common/resource/ResourceRequestBuilderTest.java | 16 ++++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java index 7259c56b6c..44559443a7 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java @@ -66,8 +66,7 @@ public class ResourceRequestBuilder { private static String CUSTOMIZATION_UUID = "cuserviceResourcesstomizationUUID"; - private static String SERVICE_URL_TOSCA_CSAR = "/v3/serviceToscaCsar"; - private static String SERVICE_URL_SERVICE_INSTANCE = "/v3/serviceResources"; + private static String SERVICE_URL_SERVICE_INSTANCE = "/v2/serviceResources"; private static MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, ResourceRequestBuilder.class); diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilderTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilderTest.java index 731d890e15..115ed91e50 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilderTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilderTest.java @@ -50,10 +50,10 @@ public class ResourceRequestBuilderTest { UrnPropertiesReader reader = new UrnPropertiesReader(); Environment env = mock(Environment.class); - when(env.getProperty(eq("mso.catalog.db.endpoint"))).thenReturn("http://localhost:8080"); + when(env.getProperty(eq("mso.catalog.db.endpoint"))).thenReturn("http://localhost:8080/ecomp/mso/catalog"); reader.setEnvironment(env); - WireMock.stubFor(WireMock.get(WireMock.urlEqualTo("/v3/serviceResources?serviceModelUuid=c3954379-4efe-431c-8258-f84905b158e5")) + WireMock.stubFor(WireMock.get(WireMock.urlEqualTo("/ecomp/mso/catalog/v2/serviceResources?serviceModelUuid=c3954379-4efe-431c-8258-f84905b158e5")) .willReturn(WireMock.ok("{ \"serviceResources\" : {\n" + "\t\"modelInfo\" : {\n" + "\t\t\"modelName\" : \"demoVFWCL\",\n" + @@ -148,10 +148,10 @@ public class ResourceRequestBuilderTest { UrnPropertiesReader reader = new UrnPropertiesReader(); Environment env = mock(Environment.class); - when(env.getProperty(eq("mso.catalog.db.endpoint"))).thenReturn("http://localhost:8080"); + when(env.getProperty(eq("mso.catalog.db.endpoint"))).thenReturn("http://localhost:8080/ecomp/mso/catalog"); reader.setEnvironment(env); - WireMock.stubFor(WireMock.get(WireMock.urlEqualTo("/v3/serviceResources?serviceModelUuid=c3954379-4efe-431c-8258-f84905b158e5")) + WireMock.stubFor(WireMock.get(WireMock.urlEqualTo("/ecomp/mso/catalog/v2/serviceResources?serviceModelUuid=c3954379-4efe-431c-8258-f84905b158e5")) .willReturn(WireMock.ok("{ \"serviceResources\" : {\n" + "\t\"modelInfo\" : {\n" + "\t\t\"modelName\" : \"demoVFWCL\",\n" + @@ -245,10 +245,10 @@ public class ResourceRequestBuilderTest { UrnPropertiesReader reader = new UrnPropertiesReader(); Environment env = mock(Environment.class); - when(env.getProperty(eq("mso.catalog.db.endpoint"))).thenReturn("http://localhost:8080"); + when(env.getProperty(eq("mso.catalog.db.endpoint"))).thenReturn("http://localhost:8080/ecomp/mso/catalog"); reader.setEnvironment(env); - WireMock.stubFor(WireMock.get(WireMock.urlEqualTo("/v3/serviceResources?serviceModelUuid=c3954379-4efe-431c-8258-f84905b158e5")) + WireMock.stubFor(WireMock.get(WireMock.urlEqualTo("/ecomp/mso/catalog/v2/serviceResources?serviceModelUuid=c3954379-4efe-431c-8258-f84905b158e5")) .willReturn(WireMock.ok("{ \"serviceResources\" : {\n" + "\t\"modelInfo\" : {\n" + "\t\t\"modelName\" : \"demoVFWCL\",\n" + @@ -342,10 +342,10 @@ public class ResourceRequestBuilderTest { UrnPropertiesReader reader = new UrnPropertiesReader(); Environment env = mock(Environment.class); - when(env.getProperty(eq("mso.catalog.db.endpoint"))).thenReturn("http://localhost:8080"); + when(env.getProperty(eq("mso.catalog.db.endpoint"))).thenReturn("http://localhost:8080/ecomp/mso/catalog"); reader.setEnvironment(env); - WireMock.stubFor(WireMock.get(WireMock.urlEqualTo("/v3/serviceResources?serviceModelUuid=c3954379-4efe-431c-8258-f84905b158e5")) + WireMock.stubFor(WireMock.get(WireMock.urlEqualTo("/ecomp/mso/catalog/v2/serviceResources?serviceModelUuid=c3954379-4efe-431c-8258-f84905b158e5")) .willReturn(WireMock.ok("{ \"serviceResources\" : {\n" + "\t\"modelInfo\" : {\n" + "\t\t\"modelName\" : \"demoVFWCL\",\n" + -- cgit 1.2.3-korg