File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
log4j-slf4j2-impl/src/test/java/org/apache/logging/slf4j Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1616 */
1717package org .apache .logging .slf4j ;
1818
19- import static org .junit .jupiter .api .Assertions .assertTrue ;
19+ import static org .junit .jupiter .api .Assertions .assertInstanceOf ;
2020
2121import org .junit .jupiter .api .Test ;
2222import org .slf4j .Logger ;
@@ -47,8 +47,9 @@ public void run() {
4747
4848 private void trigger () {
4949 Holder .LOGGER .info ("Attempt to trigger" );
50- assertTrue (
51- Holder .LOGGER instanceof Log4jLogger ,
50+ assertInstanceOf (
51+ Log4jLogger .class ,
52+ Holder .LOGGER ,
5253 "Logger is of type " + Holder .LOGGER .getClass ().getName ());
5354 }
5455 }
Original file line number Diff line number Diff line change 1616 */
1717package org .apache .logging .slf4j ;
1818
19+ import static org .junit .jupiter .api .Assertions .assertInstanceOf ;
1920import static org .junit .jupiter .api .Assertions .assertTrue ;
2021
2122import java .util .Set ;
@@ -35,7 +36,7 @@ public void testCleanup() throws Exception {
3536 factory .getLogger ("test" );
3637 Set <LoggerContext > set = factory .getLoggerContexts ();
3738 final LoggerContext ctx1 = set .toArray (LoggerContext .EMPTY_ARRAY )[0 ];
38- assertTrue ( ctx1 instanceof LifeCycle , "LoggerContext is not enabled for shutdown" );
39+ assertInstanceOf ( LifeCycle . class , ctx1 , "LoggerContext is not enabled for shutdown" );
3940 ((LifeCycle ) ctx1 ).stop ();
4041 set = factory .getLoggerContexts ();
4142 assertTrue (set .isEmpty (), "Expected no LoggerContexts" );
Original file line number Diff line number Diff line change 1818
1919import static org .junit .jupiter .api .Assertions .assertEquals ;
2020import static org .junit .jupiter .api .Assertions .assertFalse ;
21+ import static org .junit .jupiter .api .Assertions .assertInstanceOf ;
2122import static org .junit .jupiter .api .Assertions .assertNotEquals ;
2223import static org .junit .jupiter .api .Assertions .assertTrue ;
2324import static org .junit .jupiter .api .Assertions .fail ;
@@ -59,7 +60,7 @@ public void testAddMarker() {
5960 final Marker log4jParent = MarkerManager .getMarker (parentMarkerName );
6061 final Marker log4jMarker = MarkerManager .getMarker (childMakerName );
6162
62- assertTrue ( slf4jMarker instanceof Log4jMarker , "Incorrect Marker class" );
63+ assertInstanceOf ( Log4jMarker . class , slf4jMarker , "Incorrect Marker class" );
6364 assertTrue (
6465 log4jMarker .isInstanceOf (log4jParent ),
6566 String .format (
You can’t perform that action at this time.
0 commit comments