aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/test/java/org
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-09-19 13:10:26 +0300
committerIttay Stern <ittay.stern@att.com>2019-09-19 14:28:08 +0300
commit2be2e77d30a3cd547c1a37fb2f280b5fabf1ecd6 (patch)
treeeaba9dc69dca7777dc6c6ac0e12b8ff26fa643f1 /vid-app-common/src/test/java/org
parent497e040b5569b0b0139a5cbc8115a63bc7f99244 (diff)
Rename PromiseRequestIdFilter, extract isWrapNeeded and incomingRequestId methods
Change-Id: Idb39f7d5e723598e34e737522c4f73d8de3df93c Issue-ID: VID-253 Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-app-common/src/test/java/org')
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/controller/PromiseRequestIdFilterTest.java (renamed from vid-app-common/src/test/java/org/onap/vid/controller/PromiseEcompRequestIdFilterTest.java)48
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/mso/rest/OutgoingRequestHeadersTest.java6
2 files changed, 31 insertions, 23 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/PromiseEcompRequestIdFilterTest.java b/vid-app-common/src/test/java/org/onap/vid/controller/PromiseRequestIdFilterTest.java
index 39638c305..2304d46f3 100644
--- a/vid-app-common/src/test/java/org/onap/vid/controller/PromiseEcompRequestIdFilterTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/controller/PromiseRequestIdFilterTest.java
@@ -20,35 +20,41 @@
package org.onap.vid.controller;
-import com.google.common.collect.ImmutableMap;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Mockito;
-import org.mockito.stubbing.Answer;
-import org.onap.portalsdk.core.web.support.UserUtils;
-import org.onap.vid.controller.filter.PromiseEcompRequestIdFilter;
-import org.springframework.mock.web.MockHttpServletResponse;
-import org.testng.annotations.Test;
+import static org.apache.commons.lang3.StringUtils.equalsIgnoreCase;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsInAnyOrder;
+import static org.hamcrest.Matchers.emptyOrNullString;
+import static org.hamcrest.Matchers.equalToIgnoringCase;
+import static org.hamcrest.Matchers.not;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.argThat;
+import static org.onap.portalsdk.core.util.SystemProperties.ECOMP_REQUEST_ID;
+import com.google.common.collect.ImmutableMap;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.Map;
+import java.util.function.Function;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.*;
-import java.util.function.Function;
-
-import static org.apache.commons.lang3.StringUtils.equalsIgnoreCase;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.*;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.argThat;
-import static org.onap.portalsdk.core.util.SystemProperties.ECOMP_REQUEST_ID;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mockito;
+import org.mockito.stubbing.Answer;
+import org.onap.portalsdk.core.web.support.UserUtils;
+import org.onap.vid.controller.filter.PromiseRequestIdFilter;
+import org.springframework.mock.web.MockHttpServletResponse;
+import org.testng.annotations.Test;
@Test
-public class PromiseEcompRequestIdFilterTest {
+public class PromiseRequestIdFilterTest {
private final String anotherHeader = "ANDREI_RUBLEV";
private final String anotherValue = "foo value";
@@ -119,7 +125,7 @@ public class PromiseEcompRequestIdFilterTest {
//
// doFilter() is the function under test
//
- new PromiseEcompRequestIdFilter().doFilter(servletRequest, servletResponse, capturingFilterChain);
+ new PromiseRequestIdFilter().doFilter(servletRequest, servletResponse, capturingFilterChain);
//
//////////////////
diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/rest/OutgoingRequestHeadersTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/rest/OutgoingRequestHeadersTest.java
index 20a05e334..ac05ea706 100644
--- a/vid-app-common/src/test/java/org/onap/vid/mso/rest/OutgoingRequestHeadersTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/mso/rest/OutgoingRequestHeadersTest.java
@@ -50,7 +50,7 @@ import org.mockito.MockitoAnnotations;
import org.onap.vid.aai.util.AAIRestInterface;
import org.onap.vid.aai.util.ServletRequestHelper;
import org.onap.vid.aai.util.SystemPropertyHelper;
-import org.onap.vid.controller.filter.PromiseEcompRequestIdFilter;
+import org.onap.vid.controller.filter.PromiseRequestIdFilter;
import org.onap.vid.testUtils.TestUtils;
import org.onap.vid.utils.Logging;
import org.onap.vid.utils.Unchecked;
@@ -65,6 +65,7 @@ import org.testng.annotations.Test;
public class OutgoingRequestHeadersTest {
+ private static final PromiseRequestIdFilter promiseRequestIdFilter = new PromiseRequestIdFilter();
// @InjectMocks
// private RestMsoImplementation restMsoImplementation;
@@ -96,7 +97,8 @@ public class OutgoingRequestHeadersTest {
}
public static void putRequestInSpringContext() {
- RequestContextHolder.setRequestAttributes(new ServletRequestAttributes((HttpServletRequest) PromiseEcompRequestIdFilter.wrapIfNeeded(new MockHttpServletRequest())));
+ RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(
+ (HttpServletRequest) promiseRequestIdFilter.wrapIfNeeded(new MockHttpServletRequest())));
}
// @DataProvider