From 9c40f569b817e0886d95ad8b1ac235d8644873da Mon Sep 17 00:00:00 2001 From: olegb Date: Mon, 19 Feb 2018 16:19:17 +0200 Subject: Changed logging context API Issue-ID: SDC-772 Change-Id: I9dce63f3a1bb7df067cf06a96158afa7d799319e Signed-off-by: olegb --- .../sdc/logging/api/LoggingContextTest.java | 37 ++++++---------------- 1 file changed, 9 insertions(+), 28 deletions(-) (limited to 'openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp') diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/api/LoggingContextTest.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/api/LoggingContextTest.java index 79252cde0b..bfc53a3146 100644 --- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/api/LoggingContextTest.java +++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/api/LoggingContextTest.java @@ -16,14 +16,12 @@ package org.openecomp.sdc.logging.api; -import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; import java.lang.reflect.Field; import java.util.concurrent.Callable; - -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNull; -import static org.testng.Assert.assertTrue; +import org.testng.annotations.Test; /** * @author EVITALIY @@ -40,36 +38,19 @@ public class LoggingContextTest { "org.openecomp.sdc.logging.api.LoggingContext$NoOpLoggingContextService"); } - @Test - public void putDoesNotHaveEffectWhenNoBinding() { - final String key = "Key"; - LoggingContext.put(key, "Dummy"); - assertNull(LoggingContext.get(key)); - } - @Test(expectedExceptions = NullPointerException.class) - public void throwNpeWhenPutWithKeyNull() { - LoggingContext.put(null, "value"); - } - - @Test - public void getAlwaysReturnsNull() { - assertNull(LoggingContext.get("GetKey")); + public void throwNpeWhenPartnerNameIsNull() { + LoggingContext.putPartnerName(null); } @Test(expectedExceptions = NullPointerException.class) - public void throwNpeWhenGetWithKeyNull() { - LoggingContext.get(null); - } - - @Test - public void removeDoesNotFail() { - LoggingContext.remove("RemoveKey"); + public void throwNpeWhenServiceNameIsNull() { + LoggingContext.putServiceName(null); } @Test(expectedExceptions = NullPointerException.class) - public void throwNpWhenRemoveWithKeyNull() { - LoggingContext.remove(null); + public void throwNpeWhenRequestIdIsNull() { + LoggingContext.putRequestId(null); } @Test -- cgit 1.2.3-korg