aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiCqResponse.java18
-rw-r--r--models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/AaiSimulatorJaxRs.java1
-rw-r--r--models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/AaiSimulatorTest.java2
3 files changed, 20 insertions, 1 deletions
diff --git a/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiCqResponse.java b/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiCqResponse.java
index 1b18e439c..2648959bb 100644
--- a/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiCqResponse.java
+++ b/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/AaiCqResponse.java
@@ -383,6 +383,24 @@ public class AaiCqResponse implements Serializable {
}
/**
+ * Returns the VNF given the vnf-id.
+ *
+ * @param vnfId The vnf-id
+ * @return generic Vnf
+ */
+ public GenericVnf getGenericVnfByVnfId(String vnfId) {
+ List<GenericVnf> genericVnfList = this.getGenericVnfs();
+
+ for (GenericVnf genVnf : genericVnfList) {
+ if (vnfId.equals(genVnf.getVnfId())) {
+ return genVnf;
+ }
+ }
+
+ return null;
+ }
+
+ /**
* Get the generic vnf associated with the vserver in the custom query.
*
* @return Generic VNF
diff --git a/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/AaiSimulatorJaxRs.java b/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/AaiSimulatorJaxRs.java
index 8a3d6a803..27afb7b73 100644
--- a/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/AaiSimulatorJaxRs.java
+++ b/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/AaiSimulatorJaxRs.java
@@ -68,6 +68,7 @@ public class AaiSimulatorJaxRs {
@Produces("application/json")
public String aaiGetVserverQuery(@QueryParam("filter") final String filter) {
if (filter.equals("vserver-name:EQUALS:f953c499-4b1e-426b-8c6d-e9e9f1fc730f")
+ || filter.equals("vserver-name:EQUALS:Ete_vFWCLvFWSNK_7ba1fbde_0")
|| filter.equals("vserver-name:EQUALS:OzVServer")
|| filter.equals("vserver-name:EQUALS:testVserverName")) {
return "{\"result-data\":[{\"resource-type\": \"vserver\",\"resource-link\":\"/aai/v15/"
diff --git a/models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/AaiSimulatorTest.java b/models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/AaiSimulatorTest.java
index e8d2f7d32..d5d93e07f 100644
--- a/models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/AaiSimulatorTest.java
+++ b/models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/AaiSimulatorTest.java
@@ -56,7 +56,7 @@ public class AaiSimulatorTest {
@Test
public void testCqGet() {
final AaiCqResponse response = new AaiManager(new RestManager()).getCustomQueryResponse("http://localhost:6666",
- "testUser", "testPass", UUID.randomUUID(), "f953c499-4b1e-426b-8c6d-e9e9f1fc730f");
+ "testUser", "testPass", UUID.randomUUID(), "Ete_vFWCLvFWSNK_7ba1fbde_0");
assertNotNull(response);
assertEquals("f953c499-4b1e-426b-8c6d-e9e9f1fc730f", response.getVserver().getVserverId());
}