Apply ThreadContextRule to Log4j1XmlLayoutTest
NDC value is leaking into the test intermittently causing a
comparison to fail.
@@ -21,12 +21,17 @@ import static org.junit.Assert.assertEquals;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.impl.ContextDataFactory;
import org.apache.logging.log4j.core.impl.Log4jLogEvent;
+import org.apache.logging.log4j.junit.ThreadContextRule;
import org.apache.logging.log4j.message.SimpleMessage;
import org.apache.logging.log4j.util.StringMap;
+import org.junit.Rule;
import org.junit.Test;
public class Log4j1XmlLayoutTest {
+ @Rule
+ public ThreadContextRule threadContextRule = new ThreadContextRule();
+
@Test
public void testWithoutThrown() {
final Log4j1XmlLayout layout = Log4j1XmlLayout.createLayout(false, true);
