Changes to identity-url for multistep flow 97/67497/3
authorGeorge, Lina (lg941u) <lg941u@att.com>
Tue, 18 Sep 2018 20:48:29 +0000 (16:48 -0400)
committerTakamune Cho <tc012c@att.com>
Wed, 19 Sep 2018 20:17:53 +0000 (20:17 +0000)
Change-Id: I82f1d4302ebd4ad53d7f1f0b78b16f98ee8916f9
Issue-ID: APPC-1186
Signed-off-by: George, Lina (lg941u) <lg941u@att.com>
appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/dbervices/FlowControlDBService.java
appc-config/appc-flow-controller/provider/src/main/java/org/onap/appc/flow/controller/node/InventoryInfoExtractor.java
appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/node/InventoryInfoExtractorTest.java

index 733d03b..10c4564 100644 (file)
@@ -75,9 +75,6 @@ public class FlowControlDBService {
         String fn = "DBService.getflowModelInfo";
         String whereClause = " where ACTION = $" + FlowControllerConstants.REQUEST_ACTION;
 
-        if (StringUtils.isNotBlank(ctx.getAttribute(FlowControllerConstants.VNF_TYPE))) {
-            whereClause = whereClause.concat(" and VNF_TYPE = $" + FlowControllerConstants.VNF_TYPE);
-        }
         if (StringUtils.isNotBlank(ctx.getAttribute(FlowControllerConstants.ACTION_LEVEL))) {
             whereClause = whereClause.concat(" and ACTION_LEVEL = $" + FlowControllerConstants.ACTION_LEVEL);
         }
index 631b72c..4e27065 100644 (file)
@@ -81,9 +81,10 @@ class InventoryInfoExtractor {
       for (String key : ctx.getAttributeKeySet()) {
             log.debug("InventoryData " + key + "=" + ctx.getAttribute(key));
       }
-      String urlFromPayload= ctx.getAttribute("AICIdentity");
+      String urlFromPayload= ctx.getAttribute("identity-url");
       log.info("Url from payload:" + urlFromPayload);
-      String urlFromAAI=ctx.getAttribute("tmp.vnfInfo.identity-url");
+      String urlFromAAI=ctx.getAttribute("tmp.vnfInfo.cloud-region.identity-url");
+      log.info("Url from AAI:" + urlFromAAI);
 
       if(StringUtils.isNotBlank(urlFromPayload)){
           identityUrl=urlFromPayload;
index 314c0ed..022f317 100644 (file)
@@ -57,7 +57,7 @@ public class InventoryInfoExtractorTest {
     when(ctx.getAttribute("tmp.vnfInfo.vm[1].vnfc-name")).thenReturn("some-vnfc-name-1");
     when(ctx.getAttribute("tmp.vnfInfo.vm[1].vnfc-type")).thenReturn("some-vnfc-type-1");
 
-    when(ctx.getAttribute("tmp.vnfInfo.identity-url")).thenReturn("some-url");
+    when(ctx.getAttribute("tmp.vnfInfo.cloud-region.identity-url")).thenReturn("some-url");
 
     String vnfId = "some-vnf-id";
     InventoryInfo inventoryInfo = inventoryInfoExtractor.getInventoryInfo(ctx, vnfId);
@@ -74,7 +74,7 @@ public class InventoryInfoExtractorTest {
     when(ctx.getAttribute("tmp.vnfInfo.vnf.vnf-name")).thenReturn("some-vnf-name");
     when(ctx.getAttribute("tmp.vnfInfo.vnf.vnf-type")).thenReturn("some-vnf-type");
     when(ctx.getAttribute("tmp.vnfInfo.vm-count")).thenReturn("2");
-    when(ctx.getAttribute("tmp.vnfInfo.identity-url")).thenReturn("some-url");
+    when(ctx.getAttribute("tmp.vnfInfo.cloud-region.identity-url")).thenReturn("some-url");
 
     when(ctx.getAttribute("tmp.vnfInfo.vm[0].vserver-id")).thenReturn("some-id-0");
     when(ctx.getAttribute("tmp.vnfInfo.vm[0].vnfc-count")).thenReturn("2");
@@ -102,7 +102,7 @@ public class InventoryInfoExtractorTest {
     when(ctx.getAttribute("tmp.vnfInfo.vnf.vnf-name")).thenReturn("some-vnf-name");
     when(ctx.getAttribute("tmp.vnfInfo.vnf.vnf-type")).thenReturn("some-vnf-type");
     when(ctx.getAttribute("tmp.vnfInfo.vm-count")).thenReturn("0");
-    when(ctx.getAttribute("tmp.vnfInfo.identity-url")).thenReturn("some-url");
+    when(ctx.getAttribute("tmp.vnfInfo.cloud-region.identity-url")).thenReturn("some-url");
 
 
     when(ctx.getAttribute("tmp.vnfInfo.vm[0].vserver-id")).thenReturn("some-id-0");
@@ -128,7 +128,7 @@ public class InventoryInfoExtractorTest {
     when(ctx.getAttribute("tmp.vnfInfo.vnf.vnf-name")).thenReturn("some-vnf-name");
     when(ctx.getAttribute("tmp.vnfInfo.vnf.vnf-type")).thenReturn("some-vnf-type");
     when(ctx.getAttribute("tmp.vnfInfo.vm-count")).thenReturn("");
-    when(ctx.getAttribute("tmp.vnfInfo.identity-url")).thenReturn("some-url");
+    when(ctx.getAttribute("tmp.vnfInfo.cloud-region.identity-url")).thenReturn("some-url");
 
     when(ctx.getAttribute("tmp.vnfInfo.vm[0].vserver-id")).thenReturn("some-id-0");
     when(ctx.getAttribute("tmp.vnfInfo.vm[0].vnfc-count")).thenReturn("2");
@@ -154,7 +154,7 @@ public class InventoryInfoExtractorTest {
     when(ctx.getAttribute("tmp.vnfInfo.vnf.vnf-name")).thenReturn("some-vnf-name");
     when(ctx.getAttribute("tmp.vnfInfo.vnf.vnf-type")).thenReturn("some-vnf-type");
     when(ctx.getAttribute("tmp.vnfInfo.vm-count")).thenReturn(null);
-    when(ctx.getAttribute("tmp.vnfInfo.identity-url")).thenReturn("some-url");
+    when(ctx.getAttribute("tmp.vnfInfo.cloud-region.identity-url")).thenReturn("some-url");
 
     when(ctx.getAttribute("tmp.vnfInfo.vm[0].vserver-id")).thenReturn("some-id-0");
     when(ctx.getAttribute("tmp.vnfInfo.vm[0].vnfc-count")).thenReturn("2");
@@ -178,7 +178,7 @@ public class InventoryInfoExtractorTest {
   @Test
   public void testGetIdentityUrl_from_payload() throws Exception{
       InventoryInfoExtractor info = new InventoryInfoExtractor();
-      when(ctx.getAttribute("AICIdentity")).thenReturn("some_url");
+      when(ctx.getAttribute("identity-url")).thenReturn("some_url");
       VnfInfo vnfInfo = new VnfInfo();
       String url=info.getIdentityUrl(ctx, vnfInfo, "123");
       System.out.println(info.toString());
@@ -188,7 +188,7 @@ public class InventoryInfoExtractorTest {
   @Test
   public void testGetIdentityUrl_from_Inventory() throws Exception{
       InventoryInfoExtractor info = new InventoryInfoExtractor();
-      when(ctx.getAttribute("tmp.vnfInfo.identity-url")).thenReturn("some_url_from_inventory");
+      when(ctx.getAttribute("tmp.vnfInfo.cloud-region.identity-url")).thenReturn("some_url_from_inventory");
       VnfInfo vnfInfo = new VnfInfo();
       String url=info.getIdentityUrl(ctx, vnfInfo, "123");
       System.out.println(info.toString());