package org.onap.aai.logging;
-import org.junit.After;
-import org.junit.Test;
-import org.slf4j.MDC;
+import static org.junit.Assert.*;
import java.util.concurrent.TimeUnit;
-import static org.junit.Assert.*;
+import org.junit.After;
+import org.junit.Test;
+import org.slf4j.MDC;
public class LoggingContextTest {
@After
- public void cleanup(){
+ public void cleanup() {
MDC.clear();
}
+
@Test
public void elapsedTimeTest() {
LoggingContext.elapsedTime(300, TimeUnit.MILLISECONDS);
LoggingContext.init();
assertNull(MDC.get(LoggingContext.LoggingField.ELAPSED_TIME.toString()));
}
+
@Test
public void stopWatchTest() {
LoggingContext.init();
assertFalse(LoggingContext.isStopWatchStarted());
assertTrue(elapsedTime > 0);
}
+
@Test
public void putClearTest() {
String testServiceName = "TEST-SVC-NAME";