diff options
author | Jim Hahn <jrh3@att.com> | 2020-04-06 12:17:11 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2020-04-06 13:00:04 -0400 |
commit | 9f9131575d2e2b1002a3e108f7793a97fa7652ab (patch) | |
tree | 68400e6ac1fb32f01f8338803a7d72bdb41215b1 /common-logging/src/test/java/org/onap/policy/common/logging/flexlogger/Logger4JTest.java | |
parent | a56d3929f2387252525577fb36f9e03933064b8f (diff) |
Address sonar issues in ONAP-logging
Addressed the following sonar issues in ONAP-logging:
- use Map instead of ConcurrentHashMap
- remove unusued fields
- use Map.computeIfAbsent() instead of get()/put() pair
- readObject is unsafe
- use try-with-resources
- junit should assert something
Also removed some unused imports.
Issue-ID: POLICY-2305
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I3480a55da4d0e771f8083c97770a6c9707d871f7
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'common-logging/src/test/java/org/onap/policy/common/logging/flexlogger/Logger4JTest.java')
-rw-r--r-- | common-logging/src/test/java/org/onap/policy/common/logging/flexlogger/Logger4JTest.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common-logging/src/test/java/org/onap/policy/common/logging/flexlogger/Logger4JTest.java b/common-logging/src/test/java/org/onap/policy/common/logging/flexlogger/Logger4JTest.java index 99c343c0..d174aafc 100644 --- a/common-logging/src/test/java/org/onap/policy/common/logging/flexlogger/Logger4JTest.java +++ b/common-logging/src/test/java/org/onap/policy/common/logging/flexlogger/Logger4JTest.java @@ -21,6 +21,7 @@ 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.assertNotEquals; @@ -41,7 +42,7 @@ public class Logger4JTest { @Test public void testLogger4JClassOfQ() { - new Logger4J(this.getClass()); + assertThatCode(() -> new Logger4J(this.getClass())).doesNotThrowAnyException(); } @Test |