Merge "Bug fix - SO GR Api sends wrong reposnse after service instantiation"
authorLukasz Muszkieta <lukasz.muszkieta@nokia.com>
Thu, 30 Jul 2020 15:24:48 +0000 (15:24 +0000)
committerGerrit Code Review <gerrit@onap.org>
Thu, 30 Jul 2020 15:24:48 +0000 (15:24 +0000)
INFO.yaml
adapters/pom.xml
graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/graphinventory/entities/GraphInventoryRelationships.java
graph-inventory/aai-client/src/test/java/org/onap/aaiclient/client/aai/entities/RelationshipsTest.java
packages/docker/pom.xml

index 7e1f91f..470e0d2 100644 (file)
--- a/INFO.yaml
+++ b/INFO.yaml
@@ -26,7 +26,7 @@ meetings:
       server: 'n/a'
       channel: 'n/a'
       repeats: 'weekly'
-      time: '14:00 UTC'
+      time: '13:30 UTC'
 repositories:
     - so
     - so-chef-repo
@@ -45,41 +45,16 @@ committers:
       company: 'Ericsson'
       id: 'byungwoojun'
       timezone: 'America/New_York'
-    - name: 'DeWayne Filppi'
-      email: 'dewayne@cloudify.co'
-      company: 'Cloudify'
-      id: 'dfilppi'
-      timezone: 'America/Los_Angeles'
     - name: 'Max Benjamin'
       email: 'max.benjamin@att.com'
       company: 'ATT'
       id: 'mfour'
       timezone: 'America/New_York'
-    - name: 'Yan Yang'
-      email: 'yangyanyj@chinamobile.com'
-      company: 'China Mobile'
-      id: 'yangyan'
-      timezone: 'Asia/Shanghai'
-    - name: 'Marcus Williams'
-      email: 'marcus.williams@intel.com'
-      company: 'Intel'
-      id: 'mgkwill'
-      timezone: 'America/Los_Angeles'
-    - name: 'Sanchita Pathak'
-      email: 'sanchita@techmahindra.com'
-      company: 'Tech Mahindra'
-      id: 'sanchitap'
-      timezone: 'Asia/Kolkata'
     - name: 'Steve Smokowski'
       email: 'ss835w@att.com'
       company: 'ATT'
       id: 'stevesmokowski'
       timezone: 'America/New_York'
-    - name: 'Subhash Kumar Singh'
-      email: 'Subhash.Kumar.Singh@huawei.com'
-      company: 'Huawei'
-      id: 'subhash_singh'
-      timezone: 'Asia/Kolkata'
     - name: 'Lukasz Muszkieta'
       email: 'lukasz.muszkieta@nokia.com'
       company: 'Nokia'
@@ -115,4 +90,9 @@ tsc:
         - type: 'addition'
           name: 'Max Benjamin'
           link: 'https://lists.onap.org/g/onap-tsc/message/4981?p=,,,20,0,0,0::Created,,committer,20,2,0,31638681'
-
+        - type: 'removal'
+          name: 'DeWayne Filppi'
+          name: 'Yan Yang'
+          name: 'Marcus Williams'
+          name: 'Sanchita Pathak'
+          name: 'Subhash Kumar Singh'
index 9e703b9..56d4328 100644 (file)
@@ -22,7 +22,6 @@
     <module>mso-vfc-adapter</module>
     <module>mso-openstack-adapters</module>
     <module>etsi-sol003-adapter</module>
-    <module>etsi-sol002-adapter</module>
     <module>mso-nssmf-adapter</module>
     <module>so-appc-orchestrator</module>
   </modules>
index 48feba2..881b7e9 100644 (file)
@@ -27,6 +27,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 import java.util.function.Predicate;
+import java.util.function.UnaryOperator;
 import org.onap.aaiclient.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
 import org.onap.aaiclient.client.graphinventory.GraphInventoryObjectName;
 import org.onap.aaiclient.client.graphinventory.GraphInventoryObjectType;
@@ -56,6 +57,11 @@ public abstract class GraphInventoryRelationships<Wrapper extends GraphInventory
         return this.getAll(Optional.of(type));
     }
 
+    public List<Wrapper> getByType(GraphInventoryObjectName type, UnaryOperator<Uri> func) {
+
+        return this.getAll(Optional.of(type), func);
+    }
+
     public List<Wrapper> getAll() {
 
         return this.getAll(Optional.empty());
@@ -99,6 +105,10 @@ public abstract class GraphInventoryRelationships<Wrapper extends GraphInventory
 
 
     protected List<Wrapper> getAll(final Optional<GraphInventoryObjectName> type) {
+        return getAll(type, UnaryOperator.identity());
+    }
+
+    protected List<Wrapper> getAll(final Optional<GraphInventoryObjectName> type, UnaryOperator<Uri> func) {
         List<Uri> relatedLinks;
         if (type.isPresent()) {
             relatedLinks = this.getRelatedUris(type.get());
@@ -107,7 +117,7 @@ public abstract class GraphInventoryRelationships<Wrapper extends GraphInventory
         }
         ArrayList<Wrapper> result = new ArrayList<>();
         for (Uri link : relatedLinks) {
-            result.add(this.get(link));
+            result.add(this.get(func.apply(link)));
         }
         return result;
     }
index 10162f8..9e106fa 100644 (file)
 package org.onap.aaiclient.client.aai.entities;
 
 import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.doReturn;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.util.Arrays;
 import java.util.List;
 import org.junit.Test;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mockito;
 import org.onap.aaiclient.client.aai.AAIObjectType;
 import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri;
 import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory;
@@ -53,4 +56,27 @@ public class RelationshipsTest {
 
     }
 
+    @Test
+    public void getByTypeTest() throws IOException {
+        final String content = new String(Files.readAllBytes(Paths.get(AAI_JSON_FILE_LOCATION + "e2e-complex.json")));
+
+        AAIResultWrapper wrapper = new AAIResultWrapper(content);
+        Relationships relationships = wrapper.getRelationships().get();
+
+        Relationships spy = Mockito.spy(relationships);
+        ArgumentCaptor<AAIResourceUri> argument = ArgumentCaptor.forClass(AAIResourceUri.class);
+        doReturn(new AAIResultWrapper("{}")).when(spy).get(argument.capture());
+
+        spy.getByType(AAIObjectType.VCE, uri -> uri.nodesOnly(true));
+
+        assertTrue(argument.getAllValues().stream().allMatch(item -> item.build().toString().contains("nodes-only")));
+
+        argument = ArgumentCaptor.forClass(AAIResourceUri.class);
+
+        doReturn(new AAIResultWrapper("{}")).when(spy).get(argument.capture());
+        spy.getByType(AAIObjectType.VCE);
+
+        assertTrue(argument.getAllValues().stream().allMatch(item -> !item.build().toString().contains("?")));
+
+    }
 }
index 1862bd1..f895738 100644 (file)
                 </assembly>
               </build>
             </image>
-            <image>
-              <name>${docker.image.prefix}/ve-vnfm-adapter</name>
-              <build>
-                <cleanup>try</cleanup>
-                <dockerFile>docker-files/Dockerfile.so-app</dockerFile>
-                <tags>
-                  <tag>${project.version}</tag>
-                  <tag>${project.version}-${maven.build.timestamp}</tag>
-                  <tag>${project.docker.latesttag.version}</tag>
-                </tags>
-                <assembly>
-                  <inline>
-                    <dependencySets>
-                      <dependencySet>
-                        <includes>
-                          <include>org.onap.so.adapters:etsi-sol002-adapter</include>
-                        </includes>
-                        <outputFileNameMapping>app.jar</outputFileNameMapping>
-                      </dependencySet>
-                    </dependencySets>
-                  </inline>
-                </assembly>
-              </build>
-            </image>
             <image>
               <name>${docker.image.prefix}/catalog-db-adapter</name>
               <build>