garydgregory commented on a change in pull request #430:
URL: https://github.com/apache/logging-log4j2/pull/430#discussion_r499833503
##########
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:
An edge case worth testing IMO is getting a null key.
----------------------------------------------------------------
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:
[email protected]