diff options
author | Amichai Hemli <amichai.hemli@intl.att.com> | 2019-09-25 10:43:09 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-09-25 10:43:09 +0000 |
commit | 41c8e5685b70387c203b4c225a1573697d28b6d1 (patch) | |
tree | fd3a66ad195bc589071d402837b8357bbe063388 /vid-app-common/src/test/java | |
parent | d062c0446d4f288e523aa6ad4489250794babcd7 (diff) | |
parent | b66104edbfeec09edc61cbd43107b2fe82856c80 (diff) |
Merge "Introduce request-id headers enum"
Diffstat (limited to 'vid-app-common/src/test/java')
-rw-r--r-- | vid-app-common/src/test/java/org/onap/vid/controller/filter/PromiseRequestIdFilterTest.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/filter/PromiseRequestIdFilterTest.java b/vid-app-common/src/test/java/org/onap/vid/controller/filter/PromiseRequestIdFilterTest.java index 5f80e04a0..d67bd618c 100644 --- a/vid-app-common/src/test/java/org/onap/vid/controller/filter/PromiseRequestIdFilterTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/controller/filter/PromiseRequestIdFilterTest.java @@ -52,6 +52,7 @@ 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.logging.RequestIdHeader; import org.springframework.mock.web.MockHttpServletResponse; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -182,37 +183,37 @@ public class PromiseRequestIdFilterTest { return new Object[][]{ { - "header is selected when single", transactionIdHeader, + "header is selected when single", RequestIdHeader.TRANSACTION_ID, ImmutableMap.of( transactionIdHeader, someTxId ) }, { - "header is selected when first", onapRequestIdHeader, + "header is selected when first", RequestIdHeader.ONAP_ID, ImmutableMap.of( onapRequestIdHeader, someTxId, "noise-header", anotherTxId, ECOMP_REQUEST_ID, anotherTxId ) }, { - "header is selected when last", onapRequestIdHeader, + "header is selected when last", RequestIdHeader.ONAP_ID, ImmutableMap.of( ECOMP_REQUEST_ID, anotherTxId, "noise-header", anotherTxId, onapRequestIdHeader, someTxId ) }, { - "header is selected when value is invalid uuid", onapRequestIdHeader, + "header is selected when value is invalid uuid", RequestIdHeader.ONAP_ID, ImmutableMap.of( onapRequestIdHeader, "invalid-uuid" ) }, { - "header is selected when no ecomp-request-id", onapRequestIdHeader, + "header is selected when no ecomp-request-id", RequestIdHeader.ONAP_ID, ImmutableMap.of( requestIdHeader, anotherTxId, onapRequestIdHeader, someTxId ) }, { - "ECOMP_REQUEST_ID is returned when no request-id header", ECOMP_REQUEST_ID, + "ECOMP_REQUEST_ID is returned when no request-id header", RequestIdHeader.ECOMP_ID, ImmutableMap.of( "tsamina-mina", anotherTxId, "waka-waka", anotherTxId @@ -222,13 +223,12 @@ public class PromiseRequestIdFilterTest { } @Test(dataProvider = "severalRequestIdHeaders") - public void highestPriorityHeader_givenSeveralRequestIdHeaders_correctHeaderIsUsed(String description, String expectedHeader, Map<String, String> incomingRequestHeaders) { - PromiseRequestIdFilter testSubject = promiseRequestIdFilter; + public void highestPriorityHeader_givenSeveralRequestIdHeaders_correctHeaderIsUsed(String description, RequestIdHeader expectedHeader, Map<String, String> incomingRequestHeaders) { HttpServletRequest mockedHttpServletRequest = createMockedHttpServletRequest(incomingRequestHeaders); assertThat(description, - testSubject.highestPriorityHeader(mockedHttpServletRequest), equalToIgnoringCase(expectedHeader)); + promiseRequestIdFilter.highestPriorityHeader(mockedHttpServletRequest), is(expectedHeader)); } |