summaryrefslogtreecommitdiffstats
path: root/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services
diff options
context:
space:
mode:
authorvempo <vitaliy.emporopulo@amdocs.com>2018-10-24 17:18:03 +0300
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-10-25 06:09:31 +0000
commit9125b48d8813a254d5ae14109d5bd81fd34c2f33 (patch)
treee958a82b887d4d27ca17d61f3a4445b4f58278ff /openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services
parent04a5bef1c0c8ac2bd22c416ef224d968279550ee (diff)
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 <vitaliy.emporopulo@amdocs.com>
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services')
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/pom.xml5
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/test/java/org/openecomp/sdcrests/action/rest/services/ActionsImplTest.java34
2 files changed, 22 insertions, 17 deletions
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 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
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");
}