You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2020/10/06 11:05:32 UTC

[GitHub] [logging-log4j2] SiegfriedTobias1 commented on a change in pull request #430: Fix NPE in MDCContextMap

SiegfriedTobias1 commented on a change in pull request #430:
URL: https://github.com/apache/logging-log4j2/pull/430#discussion_r500188677



##########
File path: log4j-to-slf4j/src/test/java/org/apache/logging/slf4j/LoggerTest.java
##########
@@ -165,5 +166,12 @@ public void mdc() {
         assertThat(list.strList, hasSize(2));
         assertTrue("Incorrect year", list.strList.get(0).startsWith("2010"));
     }
+
+    @Test
+    public void mdcNullBacked() {
+        assertNull("Setup wrong", MDC.getCopyOfContextMap());
+        assertTrue(ThreadContext.isEmpty());
+        assertFalse(ThreadContext.containsKey("something"));
+    }

Review comment:
       Thank you for the feedback! I split the tests and added some tests concerning null keys.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org