2424import org .apache .logging .log4j .core .LoggerContext ;
2525import org .apache .logging .log4j .core .test .appender .ListAppender ;
2626import org .apache .logging .log4j .core .test .junit .LoggerContextSource ;
27- import org .apache .logging .log4j .test .junit .UsingStatusListener ;
2827import org .apache .logging .log4j .util .Strings ;
2928import org .junit .jupiter .api .Test ;
3029
31- @ UsingStatusListener
3230class LoggerTest {
3331
3432 @ Test
@@ -39,20 +37,20 @@ void testFactory() {
3937
4038 @ Test
4139 @ LoggerContextSource ("LoggerTest.xml" )
42- void testLog (final LoggerContext loggerContext ) {
40+ void testLog (final LoggerContext context ) {
4341 final Log logger = LogFactory .getLog ("LoggerTest" );
4442 logger .debug ("Test message" );
45- verify (loggerContext , "o.a.l.l.j.LoggerTest Test message MDC{}" + Strings .LINE_SEPARATOR );
43+ verify (context , "o.a.l.l.j.LoggerTest Test message MDC{}" + Strings .LINE_SEPARATOR );
4644 logger .debug ("Exception: " , new NullPointerException ("Test" ));
47- verify (loggerContext , "o.a.l.l.j.LoggerTest Exception: MDC{}" + Strings .LINE_SEPARATOR );
45+ verify (context , "o.a.l.l.j.LoggerTest Exception: MDC{}" + Strings .LINE_SEPARATOR );
4846 logger .info ("Info Message" );
49- verify (loggerContext , "o.a.l.l.j.LoggerTest Info Message MDC{}" + Strings .LINE_SEPARATOR );
47+ verify (context , "o.a.l.l.j.LoggerTest Info Message MDC{}" + Strings .LINE_SEPARATOR );
5048 logger .info ("Info Message {}" );
51- verify (loggerContext , "o.a.l.l.j.LoggerTest Info Message {} MDC{}" + Strings .LINE_SEPARATOR );
49+ verify (context , "o.a.l.l.j.LoggerTest Info Message {} MDC{}" + Strings .LINE_SEPARATOR );
5250 }
5351
54- private static void verify (final LoggerContext loggerContext , final String expected ) {
55- final ListAppender listApp = loggerContext .getConfiguration ().getAppender ("List" );
52+ private static void verify (final LoggerContext context , final String expected ) {
53+ final ListAppender listApp = context .getConfiguration ().getAppender ("List" );
5654 final List <String > events = listApp .getMessages ();
5755 assertThat (events ).hasSize (1 ).containsExactly (expected );
5856 listApp .clear ();
0 commit comments