From 4c288cdd3d1393a18e8ef8d96f73f66e5996b54c Mon Sep 17 00:00:00 2001 From: Eylon Malin Date: Thu, 31 Oct 2019 09:29:10 +0200 Subject: rename class to JaxRsMetricLogClientFilter Issue-ID: VID-253 Change-Id: I47727690015ab0183ba25a57b19fb280231c6fb3 Signed-off-by: Eylon Malin --- .../logging/JaxRsMetricLogClientFilterTest.java | 49 ++++++++++++++++++++++ .../vid/logging/VidMetricLogClientFilterTest.java | 49 ---------------------- 2 files changed, 49 insertions(+), 49 deletions(-) create mode 100644 vid-app-common/src/test/java/org/onap/vid/logging/JaxRsMetricLogClientFilterTest.java delete mode 100644 vid-app-common/src/test/java/org/onap/vid/logging/VidMetricLogClientFilterTest.java (limited to 'vid-app-common/src/test') diff --git a/vid-app-common/src/test/java/org/onap/vid/logging/JaxRsMetricLogClientFilterTest.java b/vid-app-common/src/test/java/org/onap/vid/logging/JaxRsMetricLogClientFilterTest.java new file mode 100644 index 000000000..56efeaf1b --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/logging/JaxRsMetricLogClientFilterTest.java @@ -0,0 +1,49 @@ +/*- + * ============LICENSE_START======================================================= + * VID + * ================================================================================ + * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.vid.logging; + +import static org.testng.Assert.assertEquals; + +import javax.ws.rs.core.MultivaluedHashMap; +import javax.ws.rs.core.MultivaluedMap; +import org.onap.logging.ref.slf4j.ONAPLogConstants; +import org.slf4j.MDC; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class JaxRsMetricLogClientFilterTest { + + JaxRsMetricLogClientFilter metricLogClientFilter; + + @BeforeMethod + public void setup() { + this.metricLogClientFilter = new JaxRsMetricLogClientFilter(); + MDC.clear(); + } + + @Test + public void testAdditionalPre() { + MultivaluedMap headers = new MultivaluedHashMap<>(); + headers.add(ONAPLogConstants.Headers.INVOCATION_ID, "xyz"); + metricLogClientFilter.additionalPre(null, headers); + assertEquals(MDC.get(ONAPLogConstants.MDCs.INVOCATION_ID), "xyz"); + } +} diff --git a/vid-app-common/src/test/java/org/onap/vid/logging/VidMetricLogClientFilterTest.java b/vid-app-common/src/test/java/org/onap/vid/logging/VidMetricLogClientFilterTest.java deleted file mode 100644 index aaf8eaf01..000000000 --- a/vid-app-common/src/test/java/org/onap/vid/logging/VidMetricLogClientFilterTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * VID - * ================================================================================ - * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.vid.logging; - -import static org.testng.Assert.assertEquals; - -import javax.ws.rs.core.MultivaluedHashMap; -import javax.ws.rs.core.MultivaluedMap; -import org.onap.logging.ref.slf4j.ONAPLogConstants; -import org.slf4j.MDC; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - -public class VidMetricLogClientFilterTest { - - VidMetricLogClientFilter metricLogClientFilter; - - @BeforeMethod - public void setup() { - this.metricLogClientFilter = new VidMetricLogClientFilter(); - MDC.clear(); - } - - @Test - public void testAdditionalPre() { - MultivaluedMap headers = new MultivaluedHashMap<>(); - headers.add(ONAPLogConstants.Headers.INVOCATION_ID, "xyz"); - metricLogClientFilter.additionalPre(null, headers); - assertEquals(MDC.get(ONAPLogConstants.MDCs.INVOCATION_ID), "xyz"); - } -} -- cgit 1.2.3-korg