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/05 19:49:29 UTC

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

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



##########
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:
       I would separate these into two tests, one for each API.




----------------------------------------------------------------
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