From 9125b48d8813a254d5ae14109d5bd81fd34c2f33 Mon Sep 17 00:00:00 2001 From: vempo Date: Wed, 24 Oct 2018 17:18:03 +0300 Subject: Removed code that stored configuration in DB Conditionally enabled unit tests, fixed a few static analysis violations, added copyright headers. Change-Id: I46ccafc5f4397f82b86d5c51bf0452f2060f6a70 Issue-ID: SDC-1867 Signed-off-by: vempo --- .../action-library-rest-services/pom.xml | 5 ++++ .../action/rest/services/ActionsImplTest.java | 34 +++++++++++----------- 2 files changed, 22 insertions(+), 17 deletions(-) (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services') diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml index df4196a81f..bd1a9af8f7 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml @@ -115,6 +115,11 @@ junit test + + org.mockito + mockito-core + test + diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/test/java/org/openecomp/sdcrests/action/rest/services/ActionsImplTest.java b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/test/java/org/openecomp/sdcrests/action/rest/services/ActionsImplTest.java index 6fef074730..271a888bca 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/test/java/org/openecomp/sdcrests/action/rest/services/ActionsImplTest.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/test/java/org/openecomp/sdcrests/action/rest/services/ActionsImplTest.java @@ -19,6 +19,22 @@ package org.openecomp.sdcrests.action.rest.services; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.when; +import static org.openecomp.sdc.action.ActionConstants.X_OPEN_ECOMP_INSTANCE_ID_HEADER_PARAM; +import static org.openecomp.sdc.action.ActionConstants.X_OPEN_ECOMP_REQUEST_ID_HEADER_PARAM; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.activation.DataHandler; +import javax.activation.DataSource; +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.core.Response; import org.apache.cxf.attachment.AttachmentDataSource; import org.apache.cxf.jaxrs.ext.multipart.Attachment; import org.junit.Assert; @@ -35,23 +51,6 @@ import org.openecomp.sdc.action.types.ActionArtifact; import org.openecomp.sdc.action.types.ActionStatus; import org.openecomp.sdc.action.types.OpenEcompComponent; -import javax.activation.DataHandler; -import javax.activation.DataSource; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.core.Response; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.when; -import static org.openecomp.sdc.action.ActionConstants.X_OPEN_ECOMP_INSTANCE_ID_HEADER_PARAM; -import static org.openecomp.sdc.action.ActionConstants.X_OPEN_ECOMP_REQUEST_ID_HEADER_PARAM; - public class ActionsImplTest { @Mock @@ -64,6 +63,7 @@ public class ActionsImplTest { @Before public void init() { MockitoAnnotations.initMocks(this); + when(request.getRemoteUser()).thenReturn("unit-test-user"); when(request.getHeader(X_OPEN_ECOMP_INSTANCE_ID_HEADER_PARAM)).thenReturn("X-OPEN-ECOMP-InstanceID"); when(request.getHeader(X_OPEN_ECOMP_REQUEST_ID_HEADER_PARAM)).thenReturn("X-OPEN-ECOMP-RequestID"); } -- cgit 1.2.3-korg