diff options
Diffstat (limited to 'common-logging/src/test/java/org/onap/policy/common/logging/flexlogger/SystemOutLoggerTest.java')
-rw-r--r-- | common-logging/src/test/java/org/onap/policy/common/logging/flexlogger/SystemOutLoggerTest.java | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/common-logging/src/test/java/org/onap/policy/common/logging/flexlogger/SystemOutLoggerTest.java b/common-logging/src/test/java/org/onap/policy/common/logging/flexlogger/SystemOutLoggerTest.java index 92df0297..38c9e0d2 100644 --- a/common-logging/src/test/java/org/onap/policy/common/logging/flexlogger/SystemOutLoggerTest.java +++ b/common-logging/src/test/java/org/onap/policy/common/logging/flexlogger/SystemOutLoggerTest.java @@ -3,7 +3,7 @@ * ONAP-Logging * ================================================================================ * Copyright (C) 2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019-2020 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. @@ -21,16 +21,15 @@ package org.onap.policy.common.logging.flexlogger; +import static org.assertj.core.api.Assertions.assertThatCode; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import com.att.eelf.configuration.EELFLogger.Level; - import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.util.UUID; - import org.junit.Test; import org.onap.policy.common.logging.eelf.MessageCodes; import org.onap.policy.common.logging.eelf.PolicyLogger; @@ -41,7 +40,7 @@ public class SystemOutLoggerTest { @Test public void testSystemOutLoggerClassOfQ() { - new SystemOutLogger(SystemOutLoggerTest.class); + assertThatCode(() -> new SystemOutLogger(SystemOutLoggerTest.class)).doesNotThrowAnyException(); } @Test @@ -426,7 +425,7 @@ public class SystemOutLoggerTest { try { System.setOut(ps); systemOutLogger.setTransId("transactionId"); - systemOutLogger.debug(1, new NullPointerException()); + systemOutLogger.debug("1", new NullPointerException()); assertTrue(baos.toString(), baos.toString().contains("transactionId|SystemOutLoggerTest : 1:java.lang.NullPointerException")); } finally { @@ -443,7 +442,7 @@ public class SystemOutLoggerTest { try { System.setOut(ps); systemOutLogger.setTransId("transactionId"); - systemOutLogger.error(1, new NullPointerException()); + systemOutLogger.error("1", new NullPointerException()); assertTrue(baos.toString(), baos.toString().contains("transactionId|SystemOutLoggerTest : 1:java.lang.NullPointerException")); } finally { @@ -460,7 +459,7 @@ public class SystemOutLoggerTest { try { System.setOut(ps); systemOutLogger.setTransId("transactionId"); - systemOutLogger.info(1, new NullPointerException()); + systemOutLogger.info("1", new NullPointerException()); assertTrue(baos.toString(), baos.toString().contains("transactionId|SystemOutLoggerTest : 1:java.lang.NullPointerException")); } finally { @@ -477,7 +476,7 @@ public class SystemOutLoggerTest { try { System.setOut(ps); systemOutLogger.setTransId("transactionId"); - systemOutLogger.warn(1, new NullPointerException()); + systemOutLogger.warn("1", new NullPointerException()); assertTrue(baos.toString(), baos.toString().contains("transactionId|SystemOutLoggerTest : 1:java.lang.NullPointerException")); } finally { @@ -511,7 +510,7 @@ public class SystemOutLoggerTest { try { System.setOut(ps); systemOutLogger.setTransId("transactionId"); - systemOutLogger.audit(1, new NullPointerException()); + systemOutLogger.audit("1", new NullPointerException()); assertTrue(baos.toString(), baos.toString().contains("transactionId|SystemOutLoggerTest : 1:java.lang.NullPointerException")); } finally { |