aboutsummaryrefslogtreecommitdiffstats
path: root/common-logging/src/test
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-06-29 14:55:27 -0400
committerJim Hahn <jrh3@att.com>2020-06-29 15:01:42 -0400
commitf71f3fcb8c1e3138f92a3c773f19bf3280572def (patch)
tree645ff74ec20cc07d09038139940205bdedeade9a /common-logging/src/test
parent25d1b68c099cedf9ce0bae12cf2b518b8ec39f01 (diff)
Fix new logger sonars in policy-common
Not sure if this was introduced with the new logger version, but now seeing a number of new sonars about using "{}". Fixed those. Issue-ID: POLICY-2650 Change-Id: If36b2e89aa9151700bb9cea2906b6afaad5c4c72 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'common-logging/src/test')
-rw-r--r--common-logging/src/test/java/org/onap/policy/common/logging/eelf/PolicyLoggerTest.java8
-rw-r--r--common-logging/src/test/java/org/onap/policy/common/logging/flexlogger/EelfLoggerTest.java4
2 files changed, 6 insertions, 6 deletions
diff --git a/common-logging/src/test/java/org/onap/policy/common/logging/eelf/PolicyLoggerTest.java b/common-logging/src/test/java/org/onap/policy/common/logging/eelf/PolicyLoggerTest.java
index 8688ea3d..1c412ddc 100644
--- a/common-logging/src/test/java/org/onap/policy/common/logging/eelf/PolicyLoggerTest.java
+++ b/common-logging/src/test/java/org/onap/policy/common/logging/eelf/PolicyLoggerTest.java
@@ -383,7 +383,7 @@ public class PolicyLoggerTest {
EELFLogger mockLogger = Mockito.mock(EELFLogger.class);
Whitebox.setInternalState(PolicyLogger.class, "debugLogger", mockLogger);
PolicyLogger.debug(1);
- Mockito.verify(mockLogger).debug("1");
+ Mockito.verify(mockLogger).debug("{}", 1);
}
@Test
@@ -396,7 +396,7 @@ public class PolicyLoggerTest {
PolicyLogger.audit("PolicyLoggerTest", 1);
assertEquals("PolicyLoggerTest", MDC.get("ClassName"));
assertEquals("COMPLETE", MDC.get("StatusCode"));
- Mockito.verify(mockLogger).info("1");
+ Mockito.verify(mockLogger).info("{}", "1");
}
@Test
@@ -406,7 +406,7 @@ public class PolicyLoggerTest {
PolicyLogger.audit(1);
assertEquals("", MDC.get("ClassName"));
assertEquals("COMPLETE", MDC.get("StatusCode"));
- Mockito.verify(mockLogger).info("1");
+ Mockito.verify(mockLogger).info("{}", 1);
}
@Test
@@ -495,7 +495,7 @@ public class PolicyLoggerTest {
EELFLogger mockLogger = Mockito.mock(EELFLogger.class);
Whitebox.setInternalState(PolicyLogger.class, "debugLogger", mockLogger);
PolicyLogger.trace(1);
- Mockito.verify(mockLogger).trace("1");
+ Mockito.verify(mockLogger).trace("{}", 1);
}
@Test
diff --git a/common-logging/src/test/java/org/onap/policy/common/logging/flexlogger/EelfLoggerTest.java b/common-logging/src/test/java/org/onap/policy/common/logging/flexlogger/EelfLoggerTest.java
index 1245e164..8085aa3a 100644
--- a/common-logging/src/test/java/org/onap/policy/common/logging/flexlogger/EelfLoggerTest.java
+++ b/common-logging/src/test/java/org/onap/policy/common/logging/flexlogger/EelfLoggerTest.java
@@ -252,7 +252,7 @@ public class EelfLoggerTest {
EELFLogger mockLogger = Mockito.mock(EELFLogger.class);
Whitebox.setInternalState(PolicyLogger.class, "debugLogger", mockLogger);
eelfLogger.trace("message", new NullPointerException());
- Mockito.verify(mockLogger).trace("message");
+ Mockito.verify(mockLogger).trace("{}", "message");
}
@Test
@@ -260,7 +260,7 @@ public class EelfLoggerTest {
EELFLogger mockLogger = Mockito.mock(EELFLogger.class);
Whitebox.setInternalState(PolicyLogger.class, "auditLogger", mockLogger);
eelfLogger.audit("message", new NullPointerException());
- Mockito.verify(mockLogger).info("message");
+ Mockito.verify(mockLogger).info("{}", "message");
}
@Test