diff options
Diffstat (limited to 'aai-service/provider/src/test')
6 files changed, 1 insertions, 290 deletions
diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AutoGeneratedRegressionTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AutoGeneratedRegressionTest.java index 9e26a26cb..f39542ad0 100755 --- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AutoGeneratedRegressionTest.java +++ b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/AutoGeneratedRegressionTest.java @@ -60,7 +60,6 @@ import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum; -import org.onap.ccsdk.sli.adaptors.aai.query.NamedQueryData; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus; import org.onap.aai.inventory.v14.GenericVnf; @@ -724,38 +723,7 @@ public class AutoGeneratedRegressionTest { } } - @Test - public void R1702NamedQueryRequest() - { - LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------"); - try - { - SvcLogicContext ctx = new SvcLogicContext(); - URL resource = this.getClass().getResource("/json/nquery2.json"); - - LOG.info("Resource is " + resource.getFile()); - File requestFile = new File(resource.getFile()); - if(!requestFile.exists()) { - fail("Test file does not exist"); - } - ObjectMapper mapper = AAIService.getObjectMapper(); - NamedQueryData request = mapper.readValue(requestFile, NamedQueryData.class); - Map<String, Object> map = mapper.convertValue(request, Map.class); - - ctx.setAttribute("namedQueryData.instance-filters.instance-filter[0].l3-network.network-role", "example-network-role-val-432223"); - ctx.setAttribute("namedQueryData.instance-filters.instance-filter_length", "1"); - QueryStatus resp = client.query("named-query", false, null, "named-query-uuid = '4f448e43-339f-4c1c-85f6-896c444e25ca' AND prefix = 'namedQueryData' ", "zdzich", null, ctx); - - LOG.info("AAIResponse: " + resp.toString()); - } - catch (Throwable e) - { - assert(true); - } - } - - - static class MySchemaOutputResolver extends SchemaOutputResolver { + static class MySchemaOutputResolver extends SchemaOutputResolver { public Result createOutput(String namespaceURI, String suggestedFileName) throws IOException { File file = new File(suggestedFileName); diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/NamedQueryRequestTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/NamedQueryRequestTest.java deleted file mode 100644 index c28a1ed0f..000000000 --- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/NamedQueryRequestTest.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.onap.ccsdk.sli.adaptors.aai; - -import static org.junit.Assert.*; - -import java.io.UnsupportedEncodingException; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; - -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class NamedQueryRequestTest { - - private static final Logger LOG = LoggerFactory.getLogger(NamedQueryRequestTest.class); - - private static NamedQueryRequest request; - - @BeforeClass - public static void setUp() throws Exception { - - request = new NamedQueryRequest(); - LOG.info("\nEchoRequestTest.setUp\n"); - } - - @AfterClass - public static void tearDown() throws Exception { - request = null; - LOG.info("----------------------- EchoRequestTest.tearDown -----------------------"); - } - - @Test - public void runGetRequestUrlTest() { - LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------"); - - URL url; - try { - url = request.getRequestUrl("GET", null); - assertNotNull(url); - } catch (UnsupportedEncodingException | MalformedURLException exc) { - LOG.error("Failed test", exc); - } - - } - - @Test - public void runToJSONStringTest() { - LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------"); - - try { - String json = request.toJSONString(); - assertNotNull(json); - } catch (Exception exc) { - LOG.error("Failed test", exc); - } - - } - - @Test - public void runGetArgsListTest() { - LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------"); - - try { - String[] args = request.getArgsList(); - assertNotNull(args); - } catch (Exception exc) { - LOG.error("Failed test", exc); - } - - } - - @Test - public void runGetModelTest() { - LOG.info("----------------------- Test: " + new Object(){}.getClass().getEnclosingMethod().getName() + " -----------------------"); - - try { - Class<? extends AAIDatum> clazz = request.getModelClass(); - assertNotNull(clazz); - } catch (Exception exc) { - LOG.error("Failed test", exc); - } - - } -} diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/NamedQueryDataTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/NamedQueryDataTest.java deleted file mode 100644 index 9f01e84a9..000000000 --- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/NamedQueryDataTest.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.onap.ccsdk.sli.adaptors.aai.query; - -import static org.junit.Assert.*; -import static org.mockito.Mockito.mock; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class NamedQueryDataTest { - - NamedQueryData _nqdInstance; - protected QueryParameters _queryParameters; - protected InstanceFilters _instanceFilters; - protected Map<String, Object> _additionalProperties; - - @Before - public void setUp() throws Exception { - _nqdInstance = new NamedQueryData(); - _queryParameters = mock(QueryParameters.class); - _instanceFilters = mock(InstanceFilters.class); - _additionalProperties = new HashMap<String, Object>() {{ - put("prop1", "propvalue1"); - put("prop2", "propvalue2"); - }}; - } - - @After - public void tearDown() throws Exception { - _nqdInstance = null; - _queryParameters = null; - _instanceFilters = null; - _additionalProperties = null; - } - - @Test - public void testSetQueryParameters() { - _nqdInstance.setQueryParameters(_queryParameters); - assertEquals(_nqdInstance.getQueryParameters(), _queryParameters); - } - - @Test - public void testSetInstanceFilters() { - _nqdInstance.setInstanceFilters(_instanceFilters); - assertEquals(_nqdInstance.getInstanceFilters(), _instanceFilters); - } - - @Test - public void testSetAdditionalProperty() { - _nqdInstance.setAdditionalProperty("prop1", "propvalue1"); - _nqdInstance.setAdditionalProperty("prop2", "propvalue2"); - assertEquals(_nqdInstance.getAdditionalProperties(), _additionalProperties); - } - -} diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/NamedQueryTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/NamedQueryTest.java deleted file mode 100644 index 02a239a22..000000000 --- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/NamedQueryTest.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.onap.ccsdk.sli.adaptors.aai.query; - -import static org.junit.Assert.*; -import static org.mockito.Mockito.mock; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class NamedQueryTest { - - NamedQuery _nqInstance; - protected String _namedQueryUuid; - protected Map<String, Object> _additionalProperties; - - @Before - public void setUp() throws Exception { - _nqInstance = new NamedQuery(); - _namedQueryUuid = "uuid"; - _additionalProperties = new HashMap<String, Object>() {{ - put("prop1", "propvalue1"); - put("prop2", "propvalue2"); - }}; - } - - @After - public void tearDown() throws Exception { - _nqInstance = null; - _namedQueryUuid = null; - _additionalProperties = null; - } - - @Test - public void testSetNamedQueryUuid() { - _nqInstance.setNamedQueryUuid(_namedQueryUuid); - assertEquals(_nqInstance.getNamedQueryUuid(), _namedQueryUuid); - } - - @Test - public void testSetAdditionalProperty() { - _nqInstance.setAdditionalProperty("prop1", "propvalue1"); - _nqInstance.setAdditionalProperty("prop2", "propvalue2"); - assertEquals(_nqInstance.getAdditionalProperties(), _additionalProperties); - } - -} diff --git a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/QueryParametersTest.java b/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/QueryParametersTest.java deleted file mode 100644 index d9a578903..000000000 --- a/aai-service/provider/src/test/java/org/onap/ccsdk/sli/adaptors/aai/query/QueryParametersTest.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.onap.ccsdk.sli.adaptors.aai.query; - -import static org.junit.Assert.*; -import static org.mockito.Mockito.mock; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.onap.ccsdk.sli.adaptors.aai.data.ErrorResponse; -import org.onap.ccsdk.sli.adaptors.aai.data.RequestError; - -public class QueryParametersTest { - - QueryParameters _qpInstance; - protected NamedQuery _namedQuery; - protected Map<String, Object> _additionalProperties; - - @Before - public void setUp() throws Exception { - _qpInstance = new QueryParameters(); - _namedQuery = mock(NamedQuery.class); - _additionalProperties = new HashMap<String, Object>() {{ - put("prop1", "propvalue1"); - put("prop2", "propvalue2"); - }}; - } - - @After - public void tearDown() throws Exception { - _qpInstance = null; - _namedQuery = null; - _additionalProperties = null; - } - - @Test - public void testSetNamedQuery() { - _qpInstance.setNamedQuery(_namedQuery); - assertEquals(_qpInstance.getNamedQuery(), _namedQuery); - } - - @Test - public void testSetAdditionalProperty() { - _qpInstance.setAdditionalProperty("prop1", "propvalue1"); - _qpInstance.setAdditionalProperty("prop2", "propvalue2"); - assertEquals(_qpInstance.getAdditionalProperties(), _additionalProperties); - } - -} diff --git a/aai-service/provider/src/test/resources/aaiclient.properties b/aai-service/provider/src/test/resources/aaiclient.properties index d23078d8f..e994d66fa 100755 --- a/aai-service/provider/src/test/resources/aaiclient.properties +++ b/aai-service/provider/src/test/resources/aaiclient.properties @@ -49,9 +49,6 @@ org.onap.ccsdk.sli.adaptors.aai.path.query=/aai/v14/search/sdn-zone-query org.onap.ccsdk.sli.adaptors.aai.query.nodes=/aai/v14/search/nodes-query?search-node-type={node-type}&filter={entity-identifier}:EQUALS:{entity-name} org.onap.ccsdk.sli.adaptors.aai.query.generic=/aai/v14/search/generic-query?key={identifier}:{value}&start-node-type={start-node-type}&include=complex&depth=3 -# named query -org.onap.ccsdk.sli.adaptors.aai.query.named=/aai/search/named-query - #update org.onap.ccsdk.sli.adaptors.aai.update=/aai/v14/actions/update @@ -65,8 +62,6 @@ org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterfaces=/aai/v14/cloud-infrastr org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterface=/aai/v14/cloud-infrastructure/pservers/pserver/{hostname}/p-interfaces/p-interface/{interface-name} # VNF IMAGES -org.onap.ccsdk.sli.adaptors.aai.path.vnf.images=/aai/v14/service-design-and-creation/vnf-images -org.onap.ccsdk.sli.adaptors.aai.path.vnf.image=/aai/v14/service-design-and-creation/vnf-images/vnf-image/{att-uuid} org.onap.ccsdk.sli.adaptors.aai.path.vnf.image.query=/aai/v14/service-design-and-creation/vnf-images/vnf-image?application={application_model}&application-vendor={application_vendor} # service instance |