Skip to content

Commit b6101b3

Browse files
ninetteadhikarivy
authored andcommitted
Migrate log4j-jpl tests to JUnit 5 (#3029)
Signed-off-by: Ninette Adhikari <[email protected]>
1 parent 1a8df6b commit b6101b3

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

log4j-jpl/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,5 @@
5757
<artifactId>junit-jupiter-engine</artifactId>
5858
<scope>test</scope>
5959
</dependency>
60-
<dependency>
61-
<groupId>org.junit.vintage</groupId>
62-
<artifactId>junit-vintage-engine</artifactId>
63-
<scope>test</scope>
64-
</dependency>
6560
</dependencies>
6661
</project>

log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@
1616
*/
1717
package org.apache.logging.log4j.jpl;
1818

19+
import static org.hamcrest.MatcherAssert.assertThat;
1920
import static org.hamcrest.Matchers.equalTo;
2021
import static org.hamcrest.Matchers.hasSize;
2122
import static org.hamcrest.Matchers.instanceOf;
22-
import static org.junit.Assert.assertEquals;
23-
import static org.junit.Assert.assertNotNull;
24-
import static org.junit.Assert.assertSame;
25-
import static org.junit.Assert.assertThat;
23+
import static org.junit.jupiter.api.Assertions.assertEquals;
24+
import static org.junit.jupiter.api.Assertions.assertNotNull;
25+
import static org.junit.jupiter.api.Assertions.assertSame;
2626

2727
import java.lang.System.Logger;
2828
import java.util.List;
2929
import org.apache.logging.log4j.Level;
3030
import org.apache.logging.log4j.core.LogEvent;
3131
import org.apache.logging.log4j.core.impl.MementoLogEvent;
3232
import org.apache.logging.log4j.core.test.appender.ListAppender;
33-
import org.junit.After;
34-
import org.junit.Before;
35-
import org.junit.Test;
33+
import org.junit.jupiter.api.AfterEach;
34+
import org.junit.jupiter.api.BeforeEach;
35+
import org.junit.jupiter.api.Test;
3636

3737
public class Log4jSystemLoggerTest {
3838

@@ -41,7 +41,7 @@ public class Log4jSystemLoggerTest {
4141
protected ListAppender eventAppender;
4242
protected ListAppender stringAppender;
4343

44-
@Before
44+
@BeforeEach
4545
public void setUp() throws Exception {
4646
logger = System.getLogger(LOGGER_NAME);
4747
assertThat(logger, instanceOf(Log4jSystemLogger.class));
@@ -51,7 +51,7 @@ public void setUp() throws Exception {
5151
assertNotNull(stringAppender);
5252
}
5353

54-
@After
54+
@AfterEach
5555
public void tearDown() throws Exception {
5656
if (eventAppender != null) {
5757
eventAppender.clear();

0 commit comments

Comments
 (0)