summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-simulators/src/test
diff options
context:
space:
mode:
authorpramod.jamkhedkar <pramod@research.att.com>2019-11-13 13:21:16 -0500
committerpramod.jamkhedkar <pramod@research.att.com>2019-11-13 15:41:00 -0500
commit6de5a0c9e2acf3a799f53c9fedf8a40861b6ddbe (patch)
tree8acb76dd6de88cef955ce0914046d072c3a6d1a0 /models-interactions/model-simulators/src/test
parentc34a4b6b2e111462cde7f5663b8fbbc4ad86fc7e (diff)
Removing Named Query.
Removing all the related files and necessary modifications for removing named query. The code now only supports Custom Query Issue-ID: POLICY-2125 Change-Id: Ifa5ccb74142aa424359c0dea85b90bbcf70147cb Signed-off-by: pramod.jamkhedkar <pramod@research.att.com>
Diffstat (limited to 'models-interactions/model-simulators/src/test')
-rw-r--r--models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/AaiSimulatorTest.java88
1 files changed, 2 insertions, 86 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 a03010a00..1d60af0e1 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
@@ -23,26 +23,14 @@ 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;
import static org.junit.Assert.fail;
-import java.util.HashMap;
-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;
-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.HttpServletServerFactoryInstance;
import org.onap.policy.rest.RestManager;
@@ -66,82 +54,10 @@ public class AaiSimulatorTest {
}
@Test
- public void testGet() {
- final AaiGetVnfResponse response = new AaiManager(new RestManager()).getQueryByVnfId(
- "http://localhost:6666/aai/v11/network/generic-vnfs/generic-vnf/", "testUser", "testPass",
- UUID.randomUUID(), "5e49ca06-2972-4532-9ed4-6d071588d792");
- assertNotNull(response);
- 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
- final AaiNqRequest request = new AaiNqRequest();
- final AaiNqQueryParameters tempQueryParameters = new AaiNqQueryParameters();
- final AaiNqNamedQuery tempNamedQuery = new AaiNqNamedQuery();
- tempNamedQuery.setNamedQueryUuid(UUID.fromString("4ff56a54-9e3f-46b7-a337-07a1d3c6b469"));
- tempQueryParameters.setNamedQuery(tempNamedQuery);
- request.setQueryParameters(tempQueryParameters);
- Map<String, String> tempInnerMap = new HashMap<>();
- tempInnerMap.put("vserver-name", "vserver-name-16102016-aai3255-data-11-1");
- Map<String, Map<String, String>> tempOuterMap = new HashMap<>();
- tempOuterMap.put("vserver", tempInnerMap);
- List<Map<String, Map<String, String>>> tempInstanceFilter = new LinkedList<>();
- tempInstanceFilter.add(tempOuterMap);
- AaiNqInstanceFilters tempInstanceFilters = new AaiNqInstanceFilters();
- tempInstanceFilters.setInstanceFilter(tempInstanceFilter);
- request.setInstanceFilters(tempInstanceFilters);
-
- AaiNqResponse response = new AaiManager(new RestManager()).postQuery("http://localhost:6666", "testUser",
- "testPass", request, UUID.randomUUID());
- assertNotNull(response);
- assertNotNull(response.getInventoryResponseItems());
-
- // check error response for vserver query
- tempInnerMap.put("vserver-name", "error");
-
- response = new AaiManager(new RestManager()).postQuery("http://localhost:6666", "testUser", "testPass", request,
- UUID.randomUUID());
- assertNotNull(response);
- assertNotNull(response.getRequestError());
- assertTrue(response.getRequestError().getServiceExcept().getVariables()[2].contains("vserver"));
-
- // check generic-vnf named query
- tempNamedQuery.setNamedQueryUuid(UUID.fromString("a93ac487-409c-4e8c-9e5f-334ae8f99087"));
- tempQueryParameters.setNamedQuery(tempNamedQuery);
- request.setQueryParameters(tempQueryParameters);
- tempInnerMap = new HashMap<>();
- tempInnerMap.put("vnf-id", "de7cc3ab-0212-47df-9e64-da1c79234deb");
- tempOuterMap = new HashMap<>();
- tempOuterMap.put("generic-vnf", tempInnerMap);
- tempInstanceFilter = new LinkedList<>();
- tempInstanceFilter.add(tempOuterMap);
- tempInstanceFilters = new AaiNqInstanceFilters();
- tempInstanceFilters.setInstanceFilter(tempInstanceFilter);
- request.setInstanceFilters(tempInstanceFilters);
-
- response = new AaiManager(new RestManager()).postQuery("http://localhost:6666", "testUser", "testPass", request,
- UUID.randomUUID());
- assertNotNull(response);
- assertNotNull(response.getInventoryResponseItems());
- assertNull(response.getRequestError());
-
- // check error response for generic-vnf query
- tempInnerMap.put("vnf-id", "error");
-
- response = new AaiManager(new RestManager()).postQuery("http://localhost:6666", "testUser", "testPass", request,
- UUID.randomUUID());
+ "testUser", "testPass", UUID.randomUUID(), "f953c499-4b1e-426b-8c6d-e9e9f1fc730f");
assertNotNull(response);
- assertNotNull(response.getRequestError());
- assertTrue(response.getRequestError().getServiceExcept().getVariables()[2].contains("generic-vnf"));
+ assertEquals(response.getVserver().getVserverId(), "f953c499-4b1e-426b-8c6d-e9e9f1fc730f");
}
}