Converted tests to use LATEST 80/96680/3
authorGamboa, Gilbert <gilbert.g.gamboa@att.com>
Mon, 7 Oct 2019 14:09:51 +0000 (10:09 -0400)
committerBenjamin, Max (mb388a) <mb388a@att.com>
Mon, 7 Oct 2019 18:34:31 +0000 (14:34 -0400)
Always use LATEST for A&AI based tests rather than a particular version

Issue-ID: SO-2398
Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com>
Change-Id: I7840b46f8d50b74a6e6b98270c4f3febc4d0b993

adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnControllerTest.java
adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java
bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/CreateVcpeResCustServiceSimplifiedTest.java
bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasksIT.java
common/pom.xml
common/src/main/java/org/onap/so/client/aai/AAIVersion.java

index f83e9c9..cd92d98 100644 (file)
@@ -73,6 +73,7 @@ import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201L
 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201LinksSelf;
 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201VimConnectionInfo;
 import org.onap.so.client.aai.AAIResourcesClient;
+import org.onap.so.client.aai.AAIVersion;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
index 297f744..96899e1 100644 (file)
@@ -61,6 +61,7 @@ import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201L
 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201LinksSelf;
 import org.onap.so.adapters.vnfmadapter.rest.exceptions.VnfmNotFoundException;
 import org.onap.so.client.aai.AAIResourcesClient;
+import org.onap.so.client.aai.AAIVersion;
 import org.onap.so.client.aai.entities.uri.AAIResourceUri;
 import org.onap.vnfmadapter.v1.model.CreateVnfRequest;
 import org.onap.vnfmadapter.v1.model.CreateVnfResponse;
@@ -408,7 +409,8 @@ public class VnfmAdapterControllerTest {
 
     private void addRelationshipFromGenericVnfToVnfm(final GenericVnf genericVnf, final String vnfmId) {
         final Relationship relationshipToVnfm = new Relationship();
-        relationshipToVnfm.setRelatedLink("/aai/v15/external-system/esr-vnfm-list/esr-vnfm/" + vnfmId);
+        relationshipToVnfm
+                .setRelatedLink("/aai/" + AAIVersion.LATEST + "/external-system/esr-vnfm-list/esr-vnfm/" + vnfmId);
         relationshipToVnfm.setRelatedTo("esr-vnfm");
         final RelationshipData relationshipData = new RelationshipData();
         relationshipData.setRelationshipKey("esr-vnfm.vnfm-id");
index 5b095a9..1cd8295 100644 (file)
@@ -43,6 +43,7 @@ import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceIn
 import org.onap.so.BaseBPMNTest;
 import org.onap.so.GrpcNettyServer;
 import org.onap.so.bpmn.mock.FileUtil;
+import org.onap.so.client.aai.AAIVersion;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -60,7 +61,7 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest {
     private static final int DMAAP_DELAY_TIME_MS = 2000;
 
     private static final String TEST_PROCESSINSTANCE_KEY = "CreateVcpeResCustService_simplified";
-
+    private static final AAIVersion VERSION = AAIVersion.LATEST;
     private String testBusinessKey;
     private String requestObject;
     private String responseObject;
@@ -230,7 +231,8 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest {
 
         String aaiResponse = "{\n" + "  \"results\": [\n" + "    {\n"
                 + "      \"resource-type\": \"service-instance\",\n"
-                + "      \"resource-link\": \"https://localhost:8443/aai/v15/business/customers/customer/ADemoCustomerInCiti/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/key3\"\n"
+                + "      \"resource-link\": \"https://localhost:8443/aai/" + VERSION
+                + "/business/customers/customer/ADemoCustomerInCiti/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/key3\"\n"
                 + "    }\n" + "  ]\n" + "}";
 
         String aaiPnfEntry = "{  \n" + "   \"pnf-name\":\"PNFDemo\",\n" + "   \"pnf-id\":\"testtest\",\n"
@@ -240,52 +242,55 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest {
         /**
          * Get the AAI entry for globalCustomerId as specified in the request file.
          */
-        wireMockServer.stubFor(
-                get(urlPathMatching("/aai/v15/business/customers/customer/ADemoCustomerInCiti.*")).willReturn(ok()));
+        wireMockServer
+                .stubFor(get(urlPathMatching("/aai/" + VERSION + "/business/customers/customer/ADemoCustomerInCiti.*"))
+                        .willReturn(ok()));
 
         /**
          * PUT the service to AAI with globalCustomerId, service type as specified in the request file. Service instance
          * id is generated during runtime, REGEX is used to represent the information.
          */
-        wireMockServer.stubFor(put(urlPathMatching(
-                "/aai/v15/business/customers/customer/ADemoCustomerInCiti/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/.*")));
+        wireMockServer.stubFor(put(urlPathMatching("/aai/" + VERSION
+                + "/business/customers/customer/ADemoCustomerInCiti/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/.*")));
 
-        wireMockServer.stubFor(get(urlPathMatching(
-                "/aai/v15/business/customers/customer/ADemoCustomerInCiti/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/.*"))
+        wireMockServer.stubFor(get(urlPathMatching("/aai/" + VERSION
+                + "/business/customers/customer/ADemoCustomerInCiti/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/.*"))
                         .willReturn(okJson(aaiResponse)));
 
         /**
          * Get the service from AAI
          */
-        wireMockServer.stubFor(get(urlPathMatching("/aai/v15/nodes/service-instances/service-instance/.*"))
+        wireMockServer.stubFor(get(urlPathMatching("/aai/" + VERSION + "/nodes/service-instances/service-instance/.*"))
                 .willReturn(okJson(aaiResponse)));
 
         /**
          * Put the project as specified in the request file to AAI.
          */
-        wireMockServer.stubFor(put(urlEqualTo("/aai/v15/business/projects/project/Project-Demonstration")));
+        wireMockServer.stubFor(put(urlEqualTo("/aai/" + VERSION + "/business/projects/project/Project-Demonstration")));
 
         /**
          * GET the project as specified in the request file to AAI.
          */
-        wireMockServer.stubFor(
-                get(urlPathMatching("/aai/v15/business/projects/project/Project-Demonstration")).willReturn(ok()));
+        wireMockServer
+                .stubFor(get(urlPathMatching("/aai/" + VERSION + "/business/projects/project/Project-Demonstration"))
+                        .willReturn(ok()));
 
         /**
          * PUT the PNF correlation ID to AAI.
          */
-        wireMockServer.stubFor(put(urlEqualTo("/aai/v15/network/pnfs/pnf/PNFDemo")));
+        wireMockServer.stubFor(put(urlEqualTo("/aai/" + VERSION + "/network/pnfs/pnf/PNFDemo")));
 
         /**
          * Get the PNF entry from AAI.
          */
-        wireMockServer.stubFor(get(urlEqualTo("/aai/v15/network/pnfs/pnf/PNFDemo")).willReturn(okJson(aaiPnfEntry)));
+        wireMockServer.stubFor(
+                get(urlEqualTo("/aai/" + VERSION + "/network/pnfs/pnf/PNFDemo")).willReturn(okJson(aaiPnfEntry)));
 
         /**
          * Put the PNF relationship
          */
-        wireMockServer.stubFor(put(
-                urlEqualTo("/aai/v15/business/projects/project/Project-Demonstration/relationship-list/relationship")));
+        wireMockServer.stubFor(put(urlEqualTo("/aai/" + VERSION
+                + "/business/projects/project/Project-Demonstration/relationship-list/relationship")));
     }
 
     /**
index 8328e0e..21b472b 100644 (file)
@@ -40,6 +40,7 @@ import org.onap.so.BaseIntegrationTest;
 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
 import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
 import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters;
+import org.onap.so.client.aai.AAIVersion;
 import org.onap.so.db.catalog.beans.ControllerSelectionReference;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -68,21 +69,22 @@ public class AppcRunTasksIT extends BaseIntegrationTest {
         final String aaiVnfJson =
                 new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiGenericVnfWithVservers.json")));
         wireMockServer.stubFor(
-                get(urlEqualTo("/aai/v15/network/generic-vnfs/generic-vnf/testVnfId1?depth=all")).willReturn(aResponse()
-                        .withHeader("Content-Type", "application/json").withBody(aaiVnfJson).withStatus(200)));
+                get(urlEqualTo("/aai/" + AAIVersion.LATEST + "/network/generic-vnfs/generic-vnf/testVnfId1?depth=all"))
+                        .willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(aaiVnfJson)
+                                .withStatus(200)));
 
         final String aaiVserverJson =
                 new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiVserverFullQueryResponse.json")));
-        wireMockServer.stubFor(get(urlEqualTo(
-                "/aai/v15/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/48bd7f11-408f-417c-b834-b41c1b98f7d7"))
+        wireMockServer.stubFor(get(urlEqualTo("/aai/" + AAIVersion.LATEST
+                + "/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/48bd7f11-408f-417c-b834-b41c1b98f7d7"))
                         .willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(aaiVserverJson)
                                 .withStatus(200)));
-        wireMockServer.stubFor(get(urlEqualTo(
-                "/aai/v15/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/1b3f44e5-d96d-4aac-bd9a-310e8cfb0af5"))
+        wireMockServer.stubFor(get(urlEqualTo("/aai/" + AAIVersion.LATEST
+                + "/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/1b3f44e5-d96d-4aac-bd9a-310e8cfb0af5"))
                         .willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(aaiVserverJson)
                                 .withStatus(200)));
-        wireMockServer.stubFor(get(urlEqualTo(
-                "/aai/v15/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/14551849-1e70-45cd-bc5d-a256d49548a2"))
+        wireMockServer.stubFor(get(urlEqualTo("/aai/" + AAIVersion.LATEST
+                + "/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/mtn23a/tenants/tenant/e6beab145f6b49098277ac163ac1b4f3/vservers/vserver/14551849-1e70-45cd-bc5d-a256d49548a2"))
                         .willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(aaiVserverJson)
                                 .withStatus(200)));
 
index 1f7f044..cd6f016 100644 (file)
@@ -58,7 +58,7 @@
     <dependency>
       <groupId>org.onap.aai.schema-service</groupId>
       <artifactId>aai-schema</artifactId>
-      <version>1.0.0</version>
+      <version>1.0.5</version>
     </dependency>
     <dependency>
       <groupId>org.modelmapper</groupId>
index 91030d8..3a59b2b 100644 (file)
@@ -23,7 +23,7 @@ package org.onap.so.client.aai;
 import org.onap.so.client.graphinventory.GraphInventoryVersion;
 
 public enum AAIVersion implements GraphInventoryVersion {
-    V13("v13"), V14("v14"), V15("v15");
+    V13("v13"), V14("v14"), V15("v15"), V16("v16"), V17("v17");
 
     public static final AAIVersion LATEST = AAIVersion.values()[AAIVersion.values().length - 1];
     private final String value;