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/controllers/MsoControllerTest.java | 109 --------------------- 1 file changed, 109 deletions(-) delete mode 100644 vid-app-common/src/test/java/org/onap/vid/controllers/MsoControllerTest.java (limited to 'vid-app-common/src/test/java/org/onap/vid/controllers/MsoControllerTest.java') diff --git a/vid-app-common/src/test/java/org/onap/vid/controllers/MsoControllerTest.java b/vid-app-common/src/test/java/org/onap/vid/controllers/MsoControllerTest.java deleted file mode 100644 index 0d1559548..000000000 --- a/vid-app-common/src/test/java/org/onap/vid/controllers/MsoControllerTest.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.onap.vid.controllers; - -import org.apache.commons.lang.StringEscapeUtils; -import org.onap.portalsdk.core.util.SystemProperties; -import org.onap.vid.controllers.MsoConfig; -import org.onap.vid.controllers.MsoController; -import org.onap.vid.domain.mso.RequestInfo; -import org.onap.vid.factories.MsoRequestFactory; -import org.onap.vid.mso.rest.Request; -import org.onap.vid.mso.rest.RequestDetails; -import org.onap.vid.mso.rest.Task; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.ResponseEntity; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; -import org.springframework.test.context.web.WebAppConfiguration; -import org.testng.Assert; -import org.testng.Assert.*; -import org.testng.annotations.Test; - -import java.util.List; - - -@WebAppConfiguration -@ContextConfiguration(classes = {SystemProperties.class, MsoConfig.class}) -public class MsoControllerTest extends AbstractTestNGSpringContextTests { - - @Autowired - MsoRequestFactory msoRequestFactory; - - @Test(enabled = false) - public void testInstanceCreationNew() throws Exception { - - RequestDetails requestDetails = msoRequestFactory.createMsoRequest("msoRequest.json"); - MsoController msoController = new MsoController(null); - //TODO: make ths test to really test something - //ResponseEntity responseEntityNew = msoController.createSvcInstanceNew(null, requestDetails); - ResponseEntity responseEntity = msoController.createSvcInstance(null, requestDetails); - //Assert.assertEquals(responseEntityNew, responseEntity); - - } - - @Test(enabled = false) - public void testInstanceCreationLocalWithRest() throws Exception { - - RequestDetails requestDetails = msoRequestFactory.createMsoRequest("msoRequest.json"); - MsoController msoController = new MsoController(null); - ResponseEntity responseEntityNew = msoController.createSvcInstance(null, requestDetails); - //TODO: make ths test to really test something -// ResponseEntity responseEntityRest = msoController.createSvcInstanceNewRest(null, requestDetails); -// -// Assert.assertEquals(responseEntityNew.getBody(), responseEntityRest.getBody()); - - } - - @Test(enabled = false) - public void testInstanceCreation() throws Exception { - - RequestDetails requestDetails = msoRequestFactory.createMsoRequest("msoRequest.json"); - MsoController msoController = new MsoController(null); - ResponseEntity responseEntity = msoController.createSvcInstance(null, requestDetails); - - - Assert.assertEquals(responseEntity.getBody(), "{ \"status\": 200, \"entity\": {\n" + - " \"requestReferences\": {\n" + - " \"instanceId\": \"ba00de9b-3c3e-4b0a-a1ad-0c5489e711fb\",\n" + - " \"requestId\": \"311cc766-b673-4a50-b9c5-471f68914586\"\n" + - " }\n" + - "}}"); - - } - - @Test(enabled = false) - public void testGetOrchestrationRequestsForDashboard() throws Exception { - MsoController msoController = new MsoController(null); - List orchestrationRequestsForDashboard = msoController.getOrchestrationRequestsForDashboard(); - - Assert.assertEquals(orchestrationRequestsForDashboard.size(), 2); - } - - @Test(enabled = false) - public void testGetManualTasksByRequestId() throws Exception { - MsoController msoController = new MsoController(null); - List orchestrationRequestsForDashboard = msoController.getManualTasksByRequestId("za1234d1-5a33-55df-13ab-12abad84e335"); - - Assert. assertEquals(orchestrationRequestsForDashboard.get(0).getTaskId(), "daf4dd84-b77a-42da-a051-3239b7a9392c"); - } - - - public void testCompleteManualTask() throws Exception { // TODO not done yet - RequestInfo requestInfo = new RequestInfo(); - requestInfo.setResponseValue("rollback"); - requestInfo.setRequestorId("abc"); - requestInfo.setSource("VID"); - RequestDetails requestDetails = new RequestDetails(); - requestDetails.setRequestInfo(requestInfo); - MsoController msoController = new MsoController(null); - ResponseEntity responseEntity = msoController.manualTaskComplete("daf4dd84-b77a-42da-a051-3239b7a9392c", requestDetails); - String assertString = "{ \\\"status\\\": 200, \\\"entity\\\": {\\n\" +\n" + - " \" \\\"taskRequestReference\\\": {\\n\" +\n" + - " \" \\\"taskId\\\": \\\"daf4dd84-b77a-42da-a051-3239b7a9392c\\\"\\n\" +\n" + - " \" }\\n\" +\n" + - " \"}\\n\" +\n" + - " \"}"; - Assert.assertEquals(responseEntity.getBody(), StringEscapeUtils.unescapeJava(assertString)); - } - - -} -- cgit 1.2.3-korg