From 6ad41e3ccd398a2721f41ad61c80b7bb03f7d127 Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Mon, 31 Dec 2018 17:21:27 +0200 Subject: Merge from ECOMP's repository Main Features -------------- - Async-Instantiation jobs mechanism major update; still WIP (package `org.onap.vid.job`) - New features in View/Edit: Activate fabric configuration; show related networks; soft delete - Support AAI service-tree traversal (`AAIServiceTree`) - In-memory cache for SDC models and certain A&AI queries (`CacheProviderWithLoadingCache`) - Upgrade TOSCA Parser and add parsing options; fix malformed TOSCA models - Resolve Cloud-Owner values for MSO - Pass X-ONAP headers to MSO Infrastructure -------------- - Remove codehaus' jackson mapper; use soley fasterxml 2.9.7 - Surefire invokes both TestNG and JUnit tests - Support Kotlin source files - AaiController2 which handles errors in a "Spring manner" - Inline generated-sources and remove jsonschema2pojo Quality -------- - Cumulative bug fixes (A&AI API, UI timeouts, and many more) - Many Sonar issues cleaned-up - Some unused classes removed - Minor changes in vid-automation project, allowing some API verification to run Hard Merges ------------ - HTTP Clients (MSO, A&AI, WebConfig, OutgoingRequestHeadersTest) - Moved `package org.onap.vid.controllers` to `controller`, without plural -- just to keep semantic sync with ECOMP. Reference commit in ECOMP: 3d1141625 Issue-ID: VID-378 Change-Id: I9c8d1e74caa41815891d441fc0760bb5f29c5788 Signed-off-by: Ittay Stern --- .../onap/vid/aai/AaiOverTLSClientServerTest.java | 72 +++++----------------- 1 file changed, 14 insertions(+), 58 deletions(-) (limited to 'vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientServerTest.java') diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientServerTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientServerTest.java index d4f59e7da..da08ed866 100644 --- a/vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientServerTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientServerTest.java @@ -34,7 +34,6 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; -import org.onap.vid.aai.model.AaiNodeQueryResponse; import org.onap.vid.aai.model.ResourceType; import org.onap.vid.client.SyncRestClient; import org.onap.vid.model.SubscriberList; @@ -50,31 +49,15 @@ public class AaiOverTLSClientServerTest { private static StubServerUtil serverUtil; - private String searchNodesQueryResponsePayload = - "{\n" - + "\"result-data\": [\n" - + " {\n" - + "\"resource-type\": \"generic-vnf\",\n" - + "\"resource-link\": \"/aai/v13/network/generic-vnfs/generic-vnf/6eac8e69-c98d-4ac5-ab90-69fe0cabda76\"\n" - + "},\n" - + " {\n" - + "\"resource-type\": \"generic-vnf\",\n" - + "\"resource-link\": \"/aai/v13/network/generic-vnfs/generic-vnf/e3766bc5-40a7-4dbe-9d4a-1d8c8f284913\"\n" - + "},\n" - + " {\n" - + "\"resource-type\": \"generic-vnf\",\n" - + "\"resource-link\": \"/aai/v13/network/generic-vnfs/generic-vnf/6aa153ee-6637-4b49-beb5-a5e756e00393\"\n" - + "},\n" - + " {\n" - + "\"resource-type\": \"generic-vnf\",\n" - + "\"resource-link\": \"/aai/v13/network/generic-vnfs/generic-vnf/5a981c30-de25-4ea9-98fa-ed398f13ea41\"\n" - + "},\n" - + " {\n" - + "\"resource-type\": \"generic-vnf\",\n" - + "\"resource-link\": \"/aai/v13/network/generic-vnfs/generic-vnf/b0ef2271-8ac0-4268-b9a5-09cb50c20c85\"\n" - + "}\n" - + "],\n" - + "}"; + private String searchNodesQueryResponsePayload = "" + + "{" + + "\"result-data\": [" + + " {" + + " \"resource-type\": \"generic-vnf\"," + + " \"resource-link\": \"/aai/v13/network/generic-vnfs/generic-vnf/6eac8e69-c98d-4ac5-ab90-69fe0cabda76\"" + + " }" + + " ]" + + "}"; private String subscribersResponsePayload = "{\n" @@ -122,19 +105,17 @@ public class AaiOverTLSClientServerTest { ObjectMapper objectMapper = getFasterXmlObjectMapper(); AaiOverTLSClient aaiOverTLSClient = new AaiOverTLSClient(new SyncRestClient(objectMapper), propertySupplier, serverUtil.constructTargetUrl("http", "")); - serverUtil.prepareGetCall("/search/nodes-query", new JSONParser().parse(searchNodesQueryResponsePayload), Action.status(HttpStatus.OK_200)); + serverUtil.prepareGetCall("/nodes/generic-vnfs", new JSONParser().parse(searchNodesQueryResponsePayload), Action.status(HttpStatus.OK_200)); - HttpResponse aaiNodeQueryResponseHttpResponse = aaiOverTLSClient - .searchNodeTypeByName("any", ResourceType.GENERIC_VNF); + boolean aaiNodeQueryResponseHttpResponse = aaiOverTLSClient + .isNodeTypeExistsByName("any", ResourceType.GENERIC_VNF); - AaiNodeQueryResponse body = aaiNodeQueryResponseHttpResponse.getBody(); - Assertions.assertThat(body.resultData.size()).isEqualTo(5); - Assertions.assertThat(aaiNodeQueryResponseHttpResponse.getStatus()).isEqualTo(200); + Assertions.assertThat(aaiNodeQueryResponseHttpResponse).isEqualTo(true); } @Test public void shouldGetSubscribers() throws ParseException, JsonProcessingException { - ObjectMapper objectMapper = getCodehausObjectMapper(); + ObjectMapper objectMapper = getFasterXmlObjectMapper(); AaiOverTLSClient aaiOverTLSClient = new AaiOverTLSClient(new SyncRestClient(objectMapper), propertySupplier, serverUtil.constructTargetUrl("http", "")); serverUtil.prepareGetCall("/business/customers", new JSONParser().parse(subscribersResponsePayload), Action.status(HttpStatus.OK_200)); @@ -146,31 +127,6 @@ public class AaiOverTLSClientServerTest { Assertions.assertThat(allSubscribers.getStatus()).isEqualTo(200); } - private ObjectMapper getCodehausObjectMapper() { - return new ObjectMapper() { - - org.codehaus.jackson.map.ObjectMapper om = new org.codehaus.jackson.map.ObjectMapper(); - - @Override - public T readValue(String s, Class aClass) { - try { - return om.readValue(s, aClass); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - @Override - public String writeValue(Object o) { - try { - return om.writeValueAsString(o); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - }; - } - private ObjectMapper getFasterXmlObjectMapper() { return new ObjectMapper() { -- cgit 1.2.3-korg