summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-simulators/src/test/java
diff options
context:
space:
mode:
authorpramod.jamkhedkar <pramod@research.att.com>2019-04-11 10:03:23 -0400
committerpramod.jamkhedkar <pramod@research.att.com>2019-04-11 11:40:24 -0400
commit23fc065efe1a2152b6bea3d522039784c3c29488 (patch)
tree737daf40dc15840681896f35de3ffecfdef3cd5f /models-interactions/model-simulators/src/test/java
parent38c89e3a57f168603faaf2ad4220105b2d54a9c8 (diff)
Aai Simulator for CQ
Added the aai simulator for custom query. Minor change to AaiManager Issue-ID: POLICY-1278 Change-Id: I4d5d2a616d2ce85f3b6c539a1d90fe85ee55e093 Signed-off-by: pramod.jamkhedkar <pramod@research.att.com>
Diffstat (limited to 'models-interactions/model-simulators/src/test/java')
-rw-r--r--models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/AaiSimulatorTest.java15
1 files changed, 12 insertions, 3 deletions
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 53daf5455..dfc34e02b 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
@@ -21,6 +21,7 @@
package org.onap.policy.simulators;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
@@ -31,10 +32,10 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
-
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.onap.policy.aai.AaiCqResponse;
import org.onap.policy.aai.AaiGetVnfResponse;
import org.onap.policy.aai.AaiManager;
import org.onap.policy.aai.AaiNqInstanceFilters;
@@ -74,6 +75,14 @@ public class AaiSimulatorTest {
}
@Test
+ public void testCqGet() {
+ final AaiCqResponse response = new AaiManager(new RestManager()).getCustomQueryResponse("http://localhost:6666",
+ "testUser", "testPass", UUID.randomUUID(), "vfw-vm-0201-2");
+ assertNotNull(response);
+ assertEquals(response.getVserver().getVserverName(), "vfw-vm-0201-2");
+ }
+
+ @Test
public void testPost() {
// check vserver named query
final AaiNqRequest request = new AaiNqRequest();
@@ -96,7 +105,7 @@ public class AaiSimulatorTest {
"testPass", request, UUID.randomUUID());
assertNotNull(response);
assertNotNull(response.getInventoryResponseItems());
-
+
// check error response for vserver query
tempInnerMap.put("vserver-name", "error");
@@ -125,7 +134,7 @@ public class AaiSimulatorTest {
assertNotNull(response);
assertNotNull(response.getInventoryResponseItems());
assertNull(response.getRequestError());
-
+
// check error response for generic-vnf query
tempInnerMap.put("vnf-id", "error");