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 --- .../org/onap/vid/mso/MsoBusinessLogicImplTest.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java') diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java index 718e22fb4..8a821c27a 100644 --- a/vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/mso/MsoBusinessLogicImplTest.java @@ -22,6 +22,7 @@ package org.onap.vid.mso; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.commons.io.IOUtils; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -41,7 +42,6 @@ import org.togglz.core.manager.FeatureManager; import java.io.IOException; import java.net.URL; -import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; @@ -206,7 +206,7 @@ public class MsoBusinessLogicImplTest { String vnfEndpoint = String.format(endpointTemplate, serviceInstanceId, vnfInstanceId); org.onap.vid.changeManagement.RequestDetails requestDetails = readRequest( "scaleOutVfModulePayload.json"); - org.onap.vid.changeManagement.RequestDetailsWrapper expectedRequest = readExpectedRequest( + org.onap.vid.changeManagement.RequestDetailsWrapper expectedRequest = readExpectedRequest( "scaleOutVfModulePayloadToMso.json"); MsoResponseWrapper expectedMsoResponseWrapper = createOkResponse(); given( @@ -229,7 +229,7 @@ public class MsoBusinessLogicImplTest { return objectMapper.readValue(url, org.onap.vid.changeManagement.RequestDetails.class); } - private org.onap.vid.changeManagement.RequestDetailsWrapper readExpectedRequest(String requestJsonFilename) + private org.onap.vid.changeManagement.RequestDetailsWrapper readExpectedRequest(String requestJsonFilename) throws IOException { Path path = Paths.get("payload_jsons", requestJsonFilename); URL url = this.getClass().getClassLoader().getResource(path.toString()); @@ -252,15 +252,15 @@ public class MsoBusinessLogicImplTest { } @Test - public void shouldFilterOutOrchestrationRequestsNotAllowedInDashboard() throws IOException { + public void shouldFilterOutOrchestrationRequestsNotAllowedInDashboard() throws Exception { //given String vnfModelTypeOrchestrationRequests = getFileContentAsString("mso_model_info_sample_response.json"); String scaleOutActionOrchestrationRequests = getFileContentAsString("mso_action_scaleout_sample_response.json"); MsoResponseWrapper msoResponseWrapperMock = mock(MsoResponseWrapper.class); given(msoInterface - .getOrchestrationRequestsForDashboard(any(String.class), any(String.class), any(String.class), - any(RestObject.class))) + .getOrchestrationRequest(any(String.class), any(String.class), any(String.class), + any(RestObject.class), anyBoolean())) .willReturn(msoResponseWrapperMock); given(msoResponseWrapperMock.getEntity()) .willReturn(vnfModelTypeOrchestrationRequests, scaleOutActionOrchestrationRequests); @@ -276,14 +276,14 @@ public class MsoBusinessLogicImplTest { .map(el -> el.getRequestType().toUpperCase()) .collect(Collectors.toList())); assertThat(filteredOrchestrationReqs) - .extracting(org.onap.vid.domain.mso.Request::getRequestScope) + .extracting(Request::getRequestScope) .containsOnly("vnf", "vfModule"); } - private String getFileContentAsString(String resourceName) throws IOException { - URL url = this.getClass().getClassLoader().getResource("."); - Path path = Paths.get(url.getPath(), "payload_jsons", resourceName); - return new String(Files.readAllBytes(path)); + private String getFileContentAsString(String resourceName) throws Exception { + Path path = Paths.get("payload_jsons", resourceName); + URL url = this.getClass().getClassLoader().getResource(path.toString()); + return IOUtils.toString(url.toURI(), "UTF-8"); } private static class MsoRequestWrapperMatcher implements -- cgit 1.2.3-korg