From 29a97a7fe7fa9c3c50fba299a7b1cf121be05b07 Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Thu, 23 Jan 2020 15:56:05 +0200 Subject: Revert "Promise Request-id header: Check MDC value if no header" This reverts commit 1420dc49 Issue-ID: VID-647 Change-Id: Ib33ae33ba0d1482eddf4d85fcc15f9bc6569e00c Signed-off-by: Ittay Stern --- .../filter/PromiseRequestIdFilterTest.java | 27 +--------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'vid-app-common/src/test') 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 f415bfbcb..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 @@ -51,12 +51,9 @@ import javax.servlet.http.HttpServletResponse; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; import org.mockito.stubbing.Answer; -import org.onap.logging.ref.slf4j.ONAPLogConstants.MDCs; import org.onap.portalsdk.core.web.support.UserUtils; import org.onap.vid.logging.RequestIdHeader; -import org.slf4j.MDC; import org.springframework.mock.web.MockHttpServletResponse; -import org.testng.annotations.AfterMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -73,18 +70,10 @@ public class PromiseRequestIdFilterTest { private final PromiseRequestIdFilter promiseRequestIdFilter = new PromiseRequestIdFilter(); - @AfterMethod - public void tearDown() { - MDC.remove(MDCs.REQUEST_ID); - } - @Test - public void givenMdcValueAndRequestIdHeader_headerValueNotChanged() throws IOException, ServletException { + public void givenRequestIdHeader_headerValueNotChanged() throws IOException, ServletException { final String someTxId = "863850e2-8545-4efd-94b8-afba5f52b3d5"; - final String mdcTxId = "ed752ff1-3970-4f18-8219-2d821fa4eaea"; - - MDC.put(MDCs.REQUEST_ID, mdcTxId); final ImmutableMap incomingRequestHeaders = ImmutableMap.of( anotherHeader, anotherValue, @@ -132,20 +121,6 @@ public class PromiseRequestIdFilterTest { buildRequestThenRunThroughFilterAndAssertResultRequestHeaders(incomingRequestHeaders, UserUtils::getRequestId); } - @Test - public void givenMdcValueAndNoRequestIdHeader_headerValueWasFromMDC() throws IOException, ServletException { - - final String mdcTxId = "ed752ff1-3970-4f18-8219-2d821fa4eaea"; - - MDC.put(MDCs.REQUEST_ID, mdcTxId); - - final ImmutableMap incomingRequestHeaders = ImmutableMap.of( - anotherHeader, anotherValue - ); - - buildRequestThenRunThroughFilterAndAssertResultRequestHeaders(incomingRequestHeaders, specificTxId(mdcTxId)); - } - @Test public void givenTwoRequestIdHeader_onapHeaderValueIsUsed() throws IOException, ServletException { -- cgit 1.2.3-korg