From b66104edbfeec09edc61cbd43107b2fe82856c80 Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Tue, 24 Sep 2019 16:45:51 +0300 Subject: Introduce request-id headers enum Issue-ID: VID-253 Change-Id: I4df5756d14969a2c0daa777c75c1365837f9ad1f Signed-off-by: Ittay Stern --- .../controller/filter/PromiseRequestIdFilterTest.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'vid-app-common/src/test/java') 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 incomingRequestHeaders) { - PromiseRequestIdFilter testSubject = promiseRequestIdFilter; + public void highestPriorityHeader_givenSeveralRequestIdHeaders_correctHeaderIsUsed(String description, RequestIdHeader expectedHeader, Map incomingRequestHeaders) { HttpServletRequest mockedHttpServletRequest = createMockedHttpServletRequest(incomingRequestHeaders); assertThat(description, - testSubject.highestPriorityHeader(mockedHttpServletRequest), equalToIgnoringCase(expectedHeader)); + promiseRequestIdFilter.highestPriorityHeader(mockedHttpServletRequest), is(expectedHeader)); } -- cgit 1.2.3-korg