Added VFModule count
[policy/models.git] / models-interactions / model-simulators / src / test / java / org / onap / policy / simulators / AaiSimulatorTest.java
index 53daf54..a03010a 100644 (file)
@@ -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;
@@ -42,7 +43,7 @@ import org.onap.policy.aai.AaiNqNamedQuery;
 import org.onap.policy.aai.AaiNqQueryParameters;
 import org.onap.policy.aai.AaiNqRequest;
 import org.onap.policy.aai.AaiNqResponse;
-import org.onap.policy.common.endpoints.http.server.HttpServletServer;
+import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
 import org.onap.policy.rest.RestManager;
 
 public class AaiSimulatorTest {
@@ -61,7 +62,7 @@ public class AaiSimulatorTest {
 
     @AfterClass
     public static void tearDownSimulator() {
-        HttpServletServer.factory.destroy();
+        HttpServletServerFactoryInstance.getServerFactory().destroy();
     }
 
     @Test
@@ -73,6 +74,14 @@ public class AaiSimulatorTest {
         assertNotNull(response.getRelationshipList());
     }
 
+    @Test
+    public void testCqGet() {
+        final AaiCqResponse response = new AaiManager(new RestManager()).getCustomQueryResponse("http://localhost:6666",
+                "testUser", "testPass", UUID.randomUUID(), "Ete_vFWCLvFWSNK_7ba1fbde_0");
+        assertNotNull(response);
+        assertEquals(response.getVserver().getVserverName(), "Ete_vFWCLvFWSNK_7ba1fbde_0");
+    }
+
     @Test
     public void testPost() {
         // check vserver named query
@@ -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");