You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2020/08/23 02:01:01 UTC

[logging-log4j2] branch release-2.x updated (4513817 -> 47d5066)

This is an automated email from the ASF dual-hosted git repository.

mattsicker pushed a change to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git.


    from 4513817  Add GitHub Actions CI support to release-2.x branch.
     new b9ababc  Remove Travis config in favor of GH Actions
     new b3e3567  [LOG4J2-2653] Add initial JUnit 5 support
     new b034716  [LOG4J2-2653] Simplify JUnit dependencies
     new 3c6c04d  Upgrade org.apache.logging.log4j.message tests
     new ddda12f  [LOG4J2-2653] Migrate api/java9 tests to JUnit 5
     new 47d5066  [LOG4J2-2653] Migrate part of log4j-core to JUnit 5

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .travis-toolchains.xml                             |  53 ----
 .travis.yml                                        |  39 ---
 log4j-1.2-api/pom.xml                              |   9 +-
 log4j-api-java9/pom.xml                            |   5 +-
 log4j-api-java9/src/test/java/module-info.java     |   6 +
 .../log4j/util/{ => java9}/ProcessIdUtilTest.java  |  12 +-
 .../log4j/util/{ => java9}/StackLocatorTest.java   |  90 +++---
 log4j-api/pom.xml                                  |  21 +-
 .../apache/logging/log4j/AbstractLoggerTest.java   | 171 +++++-------
 .../logging/log4j/CloseableThreadContextTest.java  | 144 ++++++----
 .../org/apache/logging/log4j/EventLoggerTest.java  |  21 +-
 .../org/apache/logging/log4j/LambdaLoggerTest.java |  14 +-
 .../java/org/apache/logging/log4j/LevelTest.java   |  10 +-
 .../org/apache/logging/log4j/LogManagerTest.java   |  64 +++--
 .../apache/logging/log4j/LoggerSupplierTest.java   | 215 ++++++---------
 .../java/org/apache/logging/log4j/LoggerTest.java  | 113 ++++----
 .../java/org/apache/logging/log4j/MarkerTest.java  |  35 ++-
 .../logging/log4j/NoopThreadContextTest.java       |  14 +-
 .../log4j/ThreadContextInheritanceTest.java        |  61 +++--
 .../apache/logging/log4j/ThreadContextTest.java    |  54 ++--
 .../logging/log4j/ThreadContextUtilityClass.java   |  12 +-
 .../org/apache/logging/log4j/TraceLoggingTest.java |  28 +-
 .../junit/LogManagerLoggerContextFactoryRule.java  |   2 +
 ...ule.java => LoggerContextFactoryExtension.java} |  31 ++-
 .../log4j/junit/StatusLoggerLevelExtension.java    |  56 ++++
 .../logging/log4j/junit/StatusLoggerRule.java      |   1 +
 .../log4j/message/FormattedMessageTest.java        |  18 +-
 .../log4j/message/LocalizedMessageFactoryTest.java |   7 +-
 .../log4j/message/LocalizedMessageTest.java        |   8 +-
 .../logging/log4j/message/MapMessageTest.java      |  14 +-
 .../log4j/message/MessageFormatMessageTest.java    |  12 +-
 .../log4j/message/MessageFormatsPerfTest.java      |   8 +-
 .../log4j/message/ObjectArrayMessageTest.java      |  10 +-
 .../logging/log4j/message/ObjectMessageTest.java   |   8 +-
 .../log4j/message/ParameterFormatterTest.java      |   5 +-
 .../log4j/message/ParameterizedMessageTest.java    |   8 +-
 .../log4j/message/ReusableMessageFactoryTest.java  |   8 +-
 .../log4j/message/ReusableObjectMessageTest.java   |   4 +-
 .../message/ReusableParameterizedMessageTest.java  |   8 +-
 .../log4j/message/ReusableSimpleMessageTest.java   |   4 +-
 .../logging/log4j/message/SimpleMessageTest.java   |   4 +-
 .../log4j/message/StringFormattedMessageTest.java  |  22 +-
 .../log4j/message/StructuredDataMessageTest.java   |   9 +-
 .../log4j/message/ThreadDumpMessageTest.java       |  22 +-
 .../logging/log4j/simple/SimpleLoggerTest.java     |  14 +-
 .../log4j/spi/DefaultThreadContextMapTest.java     |  11 +-
 .../log4j/spi/DefaultThreadContextStackTest.java   |  25 +-
 .../logging/log4j/spi/LoggerAdapterTest.java       |  13 +-
 .../log4j/spi/MutableThreadContextStackTest.java   |  56 ++--
 .../org/apache/logging/log4j/util/CharsTest.java   |  36 +--
 .../apache/logging/log4j/util/ConstantsTest.java   |   4 +-
 .../log4j/util/EnvironmentPropertySourceTest.java  |  24 +-
 .../apache/logging/log4j/util/LambdaUtilTest.java  |  72 ++---
 .../util/LegacyPropertiesCompatibilityTest.java    |  24 +-
 .../log4j/util/Log4jCharsetsPropertiesTest.java    |  23 +-
 .../logging/log4j/util/ProcessIdUtilTest.java      |  10 +-
 .../log4j/util/PropertiesPropertySourceTest.java   |  21 +-
 .../logging/log4j/util/PropertiesUtilTest.java     |  31 +--
 .../log4j/util/PropertySourceCamelCaseTest.java    |  24 +-
 .../log4j/util/PropertySourceTokenizerTest.java    |  28 +-
 .../logging/log4j/util/ProviderUtilTest.java       |  16 +-
 .../log4j/util/SortedArrayStringMapTest.java       | 301 +++++++++------------
 .../logging/log4j/util/StringBuildersTest.java     |  16 +-
 .../org/apache/logging/log4j/util/StringsTest.java |  54 ++--
 .../util/SystemPropertiesPropertySourceTest.java   |  91 +++----
 .../org/apache/logging/log4j/util/Unbox1Test.java  |  50 ++--
 .../logging/log4j/util/Unbox2ConfigurableTest.java |  31 +--
 log4j-appserver/pom.xml                            |   9 +-
 log4j-cassandra/pom.xml                            |   8 +-
 log4j-core-its/pom.xml                             |   9 +-
 log4j-core/pom.xml                                 |  13 +-
 .../log4j/core/AppenderRefLevelJsonTest.java       |  42 ++-
 .../logging/log4j/core/AppenderRefLevelTest.java   |  49 ++--
 .../logging/log4j/core/BasicLoggingTest.java       |   7 +-
 .../logging/log4j/core/CollectionLoggingTest.java  |  40 ++-
 .../log4j/core/CustomLevelsOverrideTest.java       |  35 +--
 .../logging/log4j/core/CustomLevelsTest.java       |  34 +--
 .../log4j/core/CustomLevelsWithFiltersTest.java    |  31 +--
 .../apache/logging/log4j/core/DeadlockTest.java    |  20 +-
 .../log4j/core/EventParameterMemoryLeakTest.java   |  25 +-
 .../logging/log4j/core/ExtendedLevelTest.java      |  43 ++-
 .../log4j/core/GcFreeAsynchronousLoggingTest.java  |   8 +-
 .../logging/log4j/core/GcFreeLoggingTestUtil.java  |  18 +-
 .../log4j/core/GcFreeMixedSyncAyncLoggingTest.java |   5 +-
 .../log4j/core/GcFreeSynchronousLoggingTest.java   |   5 +-
 .../apache/logging/log4j/core/HostNameTest.java    |  43 ++-
 .../apache/logging/log4j/core/LateConfigTest.java  |  32 +--
 .../org/apache/logging/log4j/core/LevelTest.java   |  60 ++--
 .../apache/logging/log4j/core/Log4j1222Test.java   |   4 +-
 .../logging/log4j/core/LogEventFactoryTest.java    |  37 +--
 .../apache/logging/log4j/core/LogEventTest.java    |  24 +-
 .../apache/logging/log4j/core/LoggerDateTest.java  |  26 +-
 .../org/apache/logging/log4j/core/LoggerTest.java  | 126 ++++-----
 .../logging/log4j/core/LoggerUpdateTest.java       |  54 ++--
 .../org/apache/logging/log4j/core/LoggingTest.java |  68 -----
 .../org/apache/logging/log4j/core/LookupTest.java  |  31 +--
 .../logging/log4j/core/PatternSelectorTest.java    |  56 ++--
 .../log4j/core/PropertiesFileConfigTest.java       |  38 +--
 ...ReusableParameterizedMessageMemoryLeakTest.java |   7 +-
 .../logging/log4j/core/ShutdownDisabledTest.java   |  22 +-
 .../core/ShutdownTimeoutConfigurationTest.java     |  20 +-
 .../logging/log4j/core/StrictXmlConfigTest.java    |  58 ++--
 .../logging/log4j/core/TimestampMessageTest.java   |  35 ++-
 .../org/apache/logging/log4j/core/XmlEvents.java   |  20 +-
 .../selector/ClassLoaderContextSelectorTest.java   |   8 +-
 .../log4j/core/time/MutableInstantTest.java        | 139 +++++-----
 .../log4j/core/tools/GenerateCustomLoggerTest.java |  83 +++---
 .../core/tools/GenerateExtendedLoggerTest.java     |  86 +++---
 .../apache/logging/log4j/core/util/AssertTest.java |  27 +-
 .../logging/log4j/core/util/ClockFactoryTest.java  |  16 +-
 .../log4j/core/util/ContextDataProviderTest.java   |  25 +-
 .../log4j/core/util/CronExpressionTest.java        |  30 +-
 .../logging/log4j/core/util/CyclicBufferTest.java  |  22 +-
 .../log4j/core/util/DummyNanoClockTest.java        |  78 +++---
 .../logging/log4j/core/util/FileUtilsTest.java     |  18 +-
 .../apache/logging/log4j/core/util/InitTest.java   |  17 +-
 .../logging/log4j/core/util/IntegersTest.java      |   4 +-
 .../logging/log4j/core/util/JsonUtilsTest.java     |   4 +-
 .../apache/logging/log4j/core/util/LoaderTest.java |  13 +-
 .../logging/log4j/core/util/NetUtilsTest.java      |  29 +-
 .../core/util/ShutdownCallbackRegistryTest.java    |  29 +-
 .../logging/log4j/core/util/SystemClockTest.java   |   8 +-
 .../log4j/core/util/SystemNanoClockTest.java       |  78 +++---
 .../logging/log4j/core/util/ThrowablesTest.java    |  30 +-
 .../apache/logging/log4j/core/util/UuidTest.java   |  20 +-
 .../logging/log4j/core/util/WatchHttpTest.java     |   2 +-
 .../logging/log4j/core/util/WatchManagerTest.java  |  28 +-
 .../logging/log4j/junit/AppenderResolver.java      |  54 ++++
 .../logging/log4j/junit/ConfigurationResolver.java |  39 +++
 .../logging/log4j/junit/LoggerContextResolver.java | 106 ++++++++
 .../logging/log4j/junit/LoggerContextSource.java}  |  36 ++-
 .../org/apache/logging/log4j/junit/Named.java}     |  16 +-
 .../MutableLogEventWithReusableParamMsgTest.java   |   2 +-
 .../log4j/test/appender/EncodingListAppender.java  |   6 +-
 log4j-couchdb/pom.xml                              |   8 +-
 log4j-flume-ng/pom.xml                             |   9 +-
 log4j-iostreams/pom.xml                            |   9 +-
 log4j-jcl/pom.xml                                  |   9 +-
 log4j-jdbc-dbcp2/pom.xml                           |   8 +-
 log4j-jpa/pom.xml                                  |   8 +-
 log4j-jpl/pom.xml                                  |   9 +-
 log4j-jul/pom.xml                                  |   1 -
 log4j-kubernetes/pom.xml                           |   9 +-
 log4j-layout-json-template/pom.xml                 |   9 +-
 .../template/JsonTemplateLayoutGcFreeTest.java     |   3 +
 log4j-liquibase/pom.xml                            |   9 +-
 log4j-mongodb3/pom.xml                             |   8 +-
 log4j-mongodb4/pom.xml                             |   8 +-
 log4j-osgi/pom.xml                                 |   9 +-
 log4j-slf4j-impl/pom.xml                           |   9 +-
 log4j-slf4j18-impl/pom.xml                         |   9 +-
 log4j-spring-boot/pom.xml                          |  14 +-
 .../log4j-spring-cloud-config-client/pom.xml       |   9 +-
 log4j-taglib/pom.xml                               |   9 +-
 log4j-to-slf4j/pom.xml                             |   9 +-
 log4j-web/pom.xml                                  |   9 +-
 pom.xml                                            |  55 +++-
 157 files changed, 2377 insertions(+), 2512 deletions(-)
 delete mode 100644 .travis-toolchains.xml
 delete mode 100644 .travis.yml
 create mode 100644 log4j-api-java9/src/test/java/module-info.java
 rename log4j-api-java9/src/test/java/org/apache/logging/log4j/util/{ => java9}/ProcessIdUtilTest.java (73%)
 rename log4j-api-java9/src/test/java/org/apache/logging/log4j/util/{ => java9}/StackLocatorTest.java (55%)
 copy log4j-api/src/test/java/org/apache/logging/log4j/junit/{LogManagerLoggerContextFactoryRule.java => LoggerContextFactoryExtension.java} (51%)
 create mode 100644 log4j-api/src/test/java/org/apache/logging/log4j/junit/StatusLoggerLevelExtension.java
 delete mode 100644 log4j-core/src/test/java/org/apache/logging/log4j/core/LoggingTest.java
 create mode 100644 log4j-core/src/test/java/org/apache/logging/log4j/junit/AppenderResolver.java
 create mode 100644 log4j-core/src/test/java/org/apache/logging/log4j/junit/ConfigurationResolver.java
 create mode 100644 log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextResolver.java
 copy log4j-core/src/{main/java/org/apache/logging/log4j/core/config/plugins/PluginElement.java => test/java/org/apache/logging/log4j/junit/LoggerContextSource.java} (51%)
 copy log4j-core/src/{main/java/org/apache/logging/log4j/core/config/plugins/PluginBuilderFactory.java => test/java/org/apache/logging/log4j/junit/Named.java} (80%)


[logging-log4j2] 03/06: [LOG4J2-2653] Simplify JUnit dependencies

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mattsicker pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit b0347161d07bc4a9aba3e30a441ff1d193ce9b47
Author: Matt Sicker <bo...@gmail.com>
AuthorDate: Sun Aug 2 17:07:59 2020 -0500

    [LOG4J2-2653] Simplify JUnit dependencies
---
 log4j-1.2-api/pom.xml                                       |  9 ---------
 log4j-api/pom.xml                                           |  6 +-----
 log4j-appserver/pom.xml                                     |  8 --------
 log4j-cassandra/pom.xml                                     |  8 --------
 log4j-core-its/pom.xml                                      |  8 --------
 log4j-core/pom.xml                                          |  8 --------
 log4j-couchdb/pom.xml                                       |  8 --------
 log4j-flume-ng/pom.xml                                      |  8 --------
 log4j-iostreams/pom.xml                                     |  8 --------
 log4j-jcl/pom.xml                                           |  8 --------
 log4j-jdbc-dbcp2/pom.xml                                    |  8 --------
 log4j-jpa/pom.xml                                           |  8 --------
 log4j-jpl/pom.xml                                           |  8 --------
 log4j-kubernetes/pom.xml                                    |  8 --------
 log4j-layout-json-template/pom.xml                          |  8 --------
 log4j-liquibase/pom.xml                                     |  8 --------
 log4j-mongodb3/pom.xml                                      |  8 --------
 log4j-mongodb4/pom.xml                                      |  8 --------
 log4j-osgi/pom.xml                                          |  8 --------
 log4j-slf4j-impl/pom.xml                                    |  8 --------
 log4j-slf4j18-impl/pom.xml                                  |  8 --------
 log4j-spring-boot/pom.xml                                   | 13 -------------
 .../log4j-spring-cloud-config-client/pom.xml                |  8 --------
 log4j-taglib/pom.xml                                        |  8 --------
 log4j-to-slf4j/pom.xml                                      |  8 --------
 log4j-web/pom.xml                                           |  8 --------
 pom.xml                                                     |  8 ++++----
 27 files changed, 5 insertions(+), 215 deletions(-)

diff --git a/log4j-1.2-api/pom.xml b/log4j-1.2-api/pom.xml
index 8a82c32..4089266 100644
--- a/log4j-1.2-api/pom.xml
+++ b/log4j-1.2-api/pom.xml
@@ -35,20 +35,11 @@
   </properties>
   <dependencies>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <!-- Place Felix before Equinox because Felix is signed. -->
diff --git a/log4j-api/pom.xml b/log4j-api/pom.xml
index e587155..26c0a0a 100644
--- a/log4j-api/pom.xml
+++ b/log4j-api/pom.xml
@@ -51,16 +51,12 @@
       <scope>provided</scope>
     </dependency>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
+      <artifactId>junit-jupiter-migrationsupport</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
diff --git a/log4j-appserver/pom.xml b/log4j-appserver/pom.xml
index 6d1be2d..641699b 100644
--- a/log4j-appserver/pom.xml
+++ b/log4j-appserver/pom.xml
@@ -88,19 +88,11 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
diff --git a/log4j-cassandra/pom.xml b/log4j-cassandra/pom.xml
index 138318f..a8eec60 100644
--- a/log4j-cassandra/pom.xml
+++ b/log4j-cassandra/pom.xml
@@ -47,19 +47,11 @@
     </dependency>
     <!-- Test Dependencies -->
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
diff --git a/log4j-core-its/pom.xml b/log4j-core-its/pom.xml
index dd1364b..30af9f7 100644
--- a/log4j-core-its/pom.xml
+++ b/log4j-core-its/pom.xml
@@ -125,19 +125,11 @@
     </dependency>
     <!-- JUnit, naturally -->
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
diff --git a/log4j-core/pom.xml b/log4j-core/pom.xml
index 960e08e..8b4ba48 100644
--- a/log4j-core/pom.xml
+++ b/log4j-core/pom.xml
@@ -188,19 +188,11 @@
     </dependency>
     <!-- JUnit, naturally -->
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
diff --git a/log4j-couchdb/pom.xml b/log4j-couchdb/pom.xml
index 601833b..68891cc 100644
--- a/log4j-couchdb/pom.xml
+++ b/log4j-couchdb/pom.xml
@@ -47,19 +47,11 @@
     </dependency>
     <!-- Test Dependencies -->
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
diff --git a/log4j-flume-ng/pom.xml b/log4j-flume-ng/pom.xml
index 86981bc..14d2595 100644
--- a/log4j-flume-ng/pom.xml
+++ b/log4j-flume-ng/pom.xml
@@ -68,19 +68,11 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
diff --git a/log4j-iostreams/pom.xml b/log4j-iostreams/pom.xml
index 5a9e760..f067ec3 100644
--- a/log4j-iostreams/pom.xml
+++ b/log4j-iostreams/pom.xml
@@ -54,19 +54,11 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
diff --git a/log4j-jcl/pom.xml b/log4j-jcl/pom.xml
index 3867199..62214a1 100644
--- a/log4j-jcl/pom.xml
+++ b/log4j-jcl/pom.xml
@@ -35,19 +35,11 @@
   </properties>
   <dependencies>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
diff --git a/log4j-jdbc-dbcp2/pom.xml b/log4j-jdbc-dbcp2/pom.xml
index edbc833..3ac0014 100644
--- a/log4j-jdbc-dbcp2/pom.xml
+++ b/log4j-jdbc-dbcp2/pom.xml
@@ -39,19 +39,11 @@
     </dependency>
     <!-- Test Dependencies -->
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
diff --git a/log4j-jpa/pom.xml b/log4j-jpa/pom.xml
index 552c777..208cbf1 100644
--- a/log4j-jpa/pom.xml
+++ b/log4j-jpa/pom.xml
@@ -48,19 +48,11 @@
     </dependency>
     <!-- Test Dependencies -->
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 0a66699..9c98807 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -56,19 +56,11 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
   </dependencies>
diff --git a/log4j-kubernetes/pom.xml b/log4j-kubernetes/pom.xml
index cab9537..e307e95 100644
--- a/log4j-kubernetes/pom.xml
+++ b/log4j-kubernetes/pom.xml
@@ -50,19 +50,11 @@
       <artifactId>kubernetes-client</artifactId>
     </dependency>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
   </dependencies>
diff --git a/log4j-layout-json-template/pom.xml b/log4j-layout-json-template/pom.xml
index 741bcf1..5dbc8c2 100644
--- a/log4j-layout-json-template/pom.xml
+++ b/log4j-layout-json-template/pom.xml
@@ -62,19 +62,11 @@
     </dependency>
 
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
 
diff --git a/log4j-liquibase/pom.xml b/log4j-liquibase/pom.xml
index 484226e..b0a75fa 100644
--- a/log4j-liquibase/pom.xml
+++ b/log4j-liquibase/pom.xml
@@ -64,19 +64,11 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
   </dependencies>
diff --git a/log4j-mongodb3/pom.xml b/log4j-mongodb3/pom.xml
index bd28ca8..81048f8 100644
--- a/log4j-mongodb3/pom.xml
+++ b/log4j-mongodb3/pom.xml
@@ -53,19 +53,11 @@
     </dependency>
     <!-- Test Dependencies -->
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
diff --git a/log4j-mongodb4/pom.xml b/log4j-mongodb4/pom.xml
index 75d48e6..2442af0 100644
--- a/log4j-mongodb4/pom.xml
+++ b/log4j-mongodb4/pom.xml
@@ -53,19 +53,11 @@
     </dependency>
     <!-- Test Dependencies -->
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
diff --git a/log4j-osgi/pom.xml b/log4j-osgi/pom.xml
index 25881a2..35d50fe 100644
--- a/log4j-osgi/pom.xml
+++ b/log4j-osgi/pom.xml
@@ -46,19 +46,11 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
diff --git a/log4j-slf4j-impl/pom.xml b/log4j-slf4j-impl/pom.xml
index 71cc5b5..df66104 100644
--- a/log4j-slf4j-impl/pom.xml
+++ b/log4j-slf4j-impl/pom.xml
@@ -84,19 +84,11 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
   </dependencies>
diff --git a/log4j-slf4j18-impl/pom.xml b/log4j-slf4j18-impl/pom.xml
index dc37a3d..1158f3b 100644
--- a/log4j-slf4j18-impl/pom.xml
+++ b/log4j-slf4j18-impl/pom.xml
@@ -84,19 +84,11 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
   </dependencies>
diff --git a/log4j-spring-boot/pom.xml b/log4j-spring-boot/pom.xml
index 13f3348..23f06fc 100644
--- a/log4j-spring-boot/pom.xml
+++ b/log4j-spring-boot/pom.xml
@@ -53,24 +53,11 @@
   </dependencyManagement>
   <dependencies>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework.boot</groupId>
-      <artifactId>spring-boot</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
diff --git a/log4j-spring-cloud-config/log4j-spring-cloud-config-client/pom.xml b/log4j-spring-cloud-config/log4j-spring-cloud-config-client/pom.xml
index 7566bf8..d82626f 100644
--- a/log4j-spring-cloud-config/log4j-spring-cloud-config-client/pom.xml
+++ b/log4j-spring-cloud-config/log4j-spring-cloud-config-client/pom.xml
@@ -35,19 +35,11 @@
   </properties>
   <dependencies>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
diff --git a/log4j-taglib/pom.xml b/log4j-taglib/pom.xml
index 0d2c45f..4abdd44 100644
--- a/log4j-taglib/pom.xml
+++ b/log4j-taglib/pom.xml
@@ -67,19 +67,11 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
diff --git a/log4j-to-slf4j/pom.xml b/log4j-to-slf4j/pom.xml
index b36c02a..c8f6528 100644
--- a/log4j-to-slf4j/pom.xml
+++ b/log4j-to-slf4j/pom.xml
@@ -59,19 +59,11 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
diff --git a/log4j-web/pom.xml b/log4j-web/pom.xml
index 88b775c..aedceba 100644
--- a/log4j-web/pom.xml
+++ b/log4j-web/pom.xml
@@ -60,19 +60,11 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.junit.vintage</groupId>
       <artifactId>junit-vintage-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
-      <artifactId>junit-jupiter-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
diff --git a/pom.xml b/pom.xml
index fd44d0d..603b2a2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -667,17 +667,17 @@
         <artifactId>jctools-core</artifactId>
         <version>${jctoolsVersion}</version>
       </dependency>
-      <!-- JUnit 5 API dependency -->
+      <!-- JUnit 5 engine -->
       <dependency>
         <groupId>org.junit.jupiter</groupId>
-        <artifactId>junit-jupiter-api</artifactId>
+        <artifactId>junit-jupiter-engine</artifactId>
         <version>5.6.2</version>
         <scope>test</scope>
       </dependency>
-      <!-- JUnit 5 engine -->
+      <!-- JUnit 4 to 5 migration support -->
       <dependency>
         <groupId>org.junit.jupiter</groupId>
-        <artifactId>junit-jupiter-engine</artifactId>
+        <artifactId>junit-jupiter-migrationsupport</artifactId>
         <version>5.6.2</version>
         <scope>test</scope>
       </dependency>


[logging-log4j2] 05/06: [LOG4J2-2653] Migrate api/java9 tests to JUnit 5

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mattsicker pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit ddda12f4ff0caee0f2b642b5e166c4dfefececac
Author: Matt Sicker <bo...@gmail.com>
AuthorDate: Sat Aug 22 20:11:19 2020 -0500

    [LOG4J2-2653] Migrate api/java9 tests to JUnit 5
    
    This is a backport from 3.x.
---
 log4j-api-java9/pom.xml                            |   5 +-
 log4j-api-java9/src/test/java/module-info.java     |   6 +
 .../log4j/util/{ => java9}/ProcessIdUtilTest.java  |  12 +-
 .../log4j/util/{ => java9}/StackLocatorTest.java   |  90 +++---
 log4j-api/pom.xml                                  |   8 +
 .../apache/logging/log4j/AbstractLoggerTest.java   | 171 +++++-------
 .../logging/log4j/CloseableThreadContextTest.java  | 144 ++++++----
 .../org/apache/logging/log4j/EventLoggerTest.java  |  21 +-
 .../org/apache/logging/log4j/LambdaLoggerTest.java |  14 +-
 .../java/org/apache/logging/log4j/LevelTest.java   |  10 +-
 .../org/apache/logging/log4j/LogManagerTest.java   |  64 +++--
 .../apache/logging/log4j/LoggerSupplierTest.java   | 215 ++++++---------
 .../java/org/apache/logging/log4j/LoggerTest.java  | 113 ++++----
 .../java/org/apache/logging/log4j/MarkerTest.java  |  35 ++-
 .../logging/log4j/NoopThreadContextTest.java       |  14 +-
 .../log4j/ThreadContextInheritanceTest.java        |  61 +++--
 .../apache/logging/log4j/ThreadContextTest.java    |  54 ++--
 .../logging/log4j/ThreadContextUtilityClass.java   |  12 +-
 .../org/apache/logging/log4j/TraceLoggingTest.java |  28 +-
 .../junit/LogManagerLoggerContextFactoryRule.java  |   2 +
 ...ule.java => LoggerContextFactoryExtension.java} |  31 ++-
 .../log4j/junit/StatusLoggerLevelExtension.java    |  56 ++++
 .../logging/log4j/junit/StatusLoggerRule.java      |   1 +
 .../logging/log4j/simple/SimpleLoggerTest.java     |  14 +-
 .../log4j/spi/DefaultThreadContextMapTest.java     |  11 +-
 .../log4j/spi/DefaultThreadContextStackTest.java   |  25 +-
 .../logging/log4j/spi/LoggerAdapterTest.java       |  13 +-
 .../log4j/spi/MutableThreadContextStackTest.java   |  56 ++--
 .../org/apache/logging/log4j/util/CharsTest.java   |  36 +--
 .../apache/logging/log4j/util/ConstantsTest.java   |   4 +-
 .../log4j/util/EnvironmentPropertySourceTest.java  |  24 +-
 .../apache/logging/log4j/util/LambdaUtilTest.java  |  72 ++---
 .../util/LegacyPropertiesCompatibilityTest.java    |  24 +-
 .../log4j/util/Log4jCharsetsPropertiesTest.java    |  23 +-
 .../log4j/util/PropertiesPropertySourceTest.java   |  21 +-
 .../logging/log4j/util/PropertiesUtilTest.java     |  31 +--
 .../log4j/util/PropertySourceCamelCaseTest.java    |  24 +-
 .../log4j/util/PropertySourceTokenizerTest.java    |  28 +-
 .../logging/log4j/util/ProviderUtilTest.java       |  16 +-
 .../log4j/util/SortedArrayStringMapTest.java       | 301 +++++++++------------
 .../logging/log4j/util/StringBuildersTest.java     |  16 +-
 .../org/apache/logging/log4j/util/StringsTest.java |  54 ++--
 .../util/SystemPropertiesPropertySourceTest.java   |  91 +++----
 .../org/apache/logging/log4j/util/Unbox1Test.java  |  50 ++--
 .../logging/log4j/util/Unbox2ConfigurableTest.java |  31 +--
 .../apache/logging/log4j/core/util/AssertTest.java |  27 +-
 46 files changed, 999 insertions(+), 1160 deletions(-)

diff --git a/log4j-api-java9/pom.xml b/log4j-api-java9/pom.xml
index a7b36e1..ae176e7 100644
--- a/log4j-api-java9/pom.xml
+++ b/log4j-api-java9/pom.xml
@@ -34,9 +34,8 @@
   </properties>
   <dependencies>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
diff --git a/log4j-api-java9/src/test/java/module-info.java b/log4j-api-java9/src/test/java/module-info.java
new file mode 100644
index 0000000..8121d75
--- /dev/null
+++ b/log4j-api-java9/src/test/java/module-info.java
@@ -0,0 +1,6 @@
+open module org.apache.logging.log4j.java9test {
+    exports org.apache.logging.log4j.util.java9;
+    requires org.apache.logging.log4j;
+    requires transitive org.junit.jupiter.engine;
+    requires transitive org.junit.jupiter.api;
+}
diff --git a/log4j-api-java9/src/test/java/org/apache/logging/log4j/util/ProcessIdUtilTest.java b/log4j-api-java9/src/test/java/org/apache/logging/log4j/util/java9/ProcessIdUtilTest.java
similarity index 73%
rename from log4j-api-java9/src/test/java/org/apache/logging/log4j/util/ProcessIdUtilTest.java
rename to log4j-api-java9/src/test/java/org/apache/logging/log4j/util/java9/ProcessIdUtilTest.java
index 6b5368f..c0f22f0 100644
--- a/log4j-api-java9/src/test/java/org/apache/logging/log4j/util/ProcessIdUtilTest.java
+++ b/log4j-api-java9/src/test/java/org/apache/logging/log4j/util/java9/ProcessIdUtilTest.java
@@ -14,16 +14,18 @@
  * See the license for the specific language governing permissions and
  * limitations under the license.
  */
-package org.apache.logging.log4j.util;
+package org.apache.logging.log4j.util.java9;
 
-import org.junit.Test;
-import static org.junit.Assert.assertFalse;
+import org.apache.logging.log4j.util.ProcessIdUtil;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
 
 public class ProcessIdUtilTest {
 
     @Test
-    public void processIdTest() throws Exception {
+    public void processIdTest() {
         String processId = ProcessIdUtil.getProcessId();
-        assertFalse("ProcessId is default", processId.equals(ProcessIdUtil.DEFAULT_PROCESSID));
+        assertNotEquals(processId, ProcessIdUtil.DEFAULT_PROCESSID, "ProcessId is default");
     }
 }
diff --git a/log4j-api-java9/src/test/java/org/apache/logging/log4j/util/StackLocatorTest.java b/log4j-api-java9/src/test/java/org/apache/logging/log4j/util/java9/StackLocatorTest.java
similarity index 55%
rename from log4j-api-java9/src/test/java/org/apache/logging/log4j/util/StackLocatorTest.java
rename to log4j-api-java9/src/test/java/org/apache/logging/log4j/util/java9/StackLocatorTest.java
index bf76fc0..7cd8c5c 100644
--- a/log4j-api-java9/src/test/java/org/apache/logging/log4j/util/StackLocatorTest.java
+++ b/log4j-api-java9/src/test/java/org/apache/logging/log4j/util/java9/StackLocatorTest.java
@@ -14,35 +14,21 @@
  * See the license for the specific language governing permissions and
  * limitations under the license.
  */
-package org.apache.logging.log4j.util;
+package org.apache.logging.log4j.util.java9;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.BlockJUnit4ClassRunner;
-import org.junit.runners.ParentRunner;
+import org.apache.logging.log4j.util.StackLocator;
+import org.junit.jupiter.api.Test;
 
 import java.util.Stack;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
+import static org.junit.jupiter.api.Assertions.*;
 
-@RunWith(BlockJUnit4ClassRunner.class)
 public class StackLocatorTest {
 
-    private static StackLocator stackLocator;
-
-    @BeforeClass
-    public static void setupClass() {
-
-        stackLocator = StackLocator.getInstance();
-    }
-
     @Test
-    public void testGetCallerClass() throws Exception {
+    public void testGetCallerClass() {
         final Class<?> expected = StackLocatorTest.class;
+        final StackLocator stackLocator = StackLocator.getInstance();
         final Class<?> actual = stackLocator.getCallerClass(1);
         assertSame(expected, actual);
     }
@@ -55,7 +41,8 @@ public class StackLocatorTest {
     }
 
     @Test
-    public void testGetCurrentStackTrace() throws Exception {
+    public void testGetCurrentStackTrace() {
+        final StackLocator stackLocator = StackLocator.getInstance();
         final Stack<Class<?>> classes = stackLocator.getCurrentStackTrace();
         final Stack<Class<?>> reversed = new Stack<>();
         reversed.ensureCapacity(classes.size());
@@ -70,35 +57,43 @@ public class StackLocatorTest {
     }
 
     @Test
-    public void testGetCallerClassViaName() throws Exception {
-        final Class<?> expected = BlockJUnit4ClassRunner.class;
-        final Class<?> actual = stackLocator.getCallerClass("org.junit.runners.ParentRunner");
-        // if this test fails in the future, it's probably because of a JUnit upgrade; check the new stack trace and
-        // update this test accordingly
-        assertSame(expected, actual);
+    public void testGetCallerClassViaName() {
+        Inner.assertCallerClassViaName();
     }
 
     @Test
-    public void testGetCallerClassViaAnchorClass() throws Exception {
-        final Class<?> expected = BlockJUnit4ClassRunner.class;
-        final Class<?> actual = stackLocator.getCallerClass(ParentRunner.class);
-        // if this test fails in the future, it's probably because of a JUnit upgrade; check the new stack trace and
-        // update this test accordingly
-        assertSame(expected, actual);
+    public void testGetCallerClassViaAnchorClass() {
+        Inner.assertCallerClassViaAnchorClass();
+    }
+
+    private static class Inner {
+        private static void assertCallerClassViaName() {
+            final Class<?> expected = StackLocatorTest.class;
+            final StackLocator stackLocator = StackLocator.getInstance();
+            final Class<?> actual = stackLocator.getCallerClass(Inner.class.getName());
+            assertSame(expected, actual);
+        }
+
+        private static void assertCallerClassViaAnchorClass() {
+            final Class<?> expected = StackLocatorTest.class;
+            final StackLocator stackLocator = StackLocator.getInstance();
+            final Class<?> actual = stackLocator.getCallerClass(Inner.class);
+            assertSame(expected, actual);
+        }
     }
 
     @Test
     public void testLocateClass() {
         ClassLocator locator = new ClassLocator();
         Class<?> clazz = locator.locateClass();
-        assertNotNull("Could not locate class", clazz);
-        assertEquals("Incorrect class", this.getClass(), clazz);
+        assertNotNull(clazz, "Could not locate class");
+        assertEquals(this.getClass(), clazz, "Incorrect class");
     }
 
     private final class Foo {
 
         private StackTraceElement foo() {
-            return new Bar().bar();
+            return new Bar().bar(); // <--- testCalcLocation() line
         }
 
     }
@@ -116,35 +111,38 @@ public class StackLocatorTest {
     }
 
     private StackTraceElement quux() {
-        return stackLocator.calcLocation("org.apache.logging.log4j.util.StackLocatorTest$Bar");
+        final StackLocator stackLocator = StackLocator.getInstance();
+        return stackLocator.calcLocation("org.apache.logging.log4j.util.java9.StackLocatorTest$Bar");
     }
 
     @Test
     public void testCalcLocation() {
         /*
          * We are setting up a stack trace that looks like:
-         *  - org.apache.logging.log4j.util.StackLocatorTest#quux(line:118)
-         *  - org.apache.logging.log4j.util.StackLocatorTest$Bar#baz(line:112)
-         *  - org.apache.logging.log4j.util.StackLocatorTest$Bar#bar(line:108)
-         *  - org.apache.logging.log4j.util.StackLocatorTest$Foo(line:100)
+         *  - org.apache.logging.log4j.util.test.StackLocatorTest#quux(line:118)
+         *  - org.apache.logging.log4j.util.test.StackLocatorTest$Bar#baz(line:112)
+         *  - org.apache.logging.log4j.util.test.StackLocatorTest$Bar#bar(line:108)
+         *  - org.apache.logging.log4j.util.test.StackLocatorTest$Foo(line:100)
          *
-         * We are pretending that org.apache.logging.log4j.util.StackLocatorTest$Bar is the logging class, and
-         * org.apache.logging.log4j.util.StackLocatorTest$Foo is where the log line emanated.
+         * We are pretending that org.apache.logging.log4j.util.test.StackLocatorTest$Bar is the logging class, and
+         * org.apache.logging.log4j.util.test.StackLocatorTest$Foo is where the log line emanated.
          */
         final StackTraceElement element = new Foo().foo();
-        assertEquals("org.apache.logging.log4j.util.StackLocatorTest$Foo", element.getClassName());
-        assertEquals(101, element.getLineNumber());
+        assertEquals("org.apache.logging.log4j.util.java9.StackLocatorTest$Foo", element.getClassName());
+        assertEquals(96, element.getLineNumber());
     }
 
     @Test
     public void testCalcLocationWhenNotInTheStack() {
+        final StackLocator stackLocator = StackLocator.getInstance();
         final StackTraceElement stackTraceElement = stackLocator.calcLocation("java.util.Logger");
         assertNull(stackTraceElement);
     }
 
-    class ClassLocator {
+    static class ClassLocator {
 
         public Class<?> locateClass() {
+            final StackLocator stackLocator = StackLocator.getInstance();
             return stackLocator.getCallerClass(ClassLocator.class);
         }
     }
diff --git a/log4j-api/pom.xml b/log4j-api/pom.xml
index 26c0a0a..4c6d990 100644
--- a/log4j-api/pom.xml
+++ b/log4j-api/pom.xml
@@ -60,9 +60,17 @@
     </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-params</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.eclipse.tycho</groupId>
       <artifactId>org.eclipse.osgi</artifactId>
       <scope>test</scope>
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java
index f7d7855..9c13006 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java
@@ -17,14 +17,10 @@
 package org.apache.logging.log4j;
 
 import static org.hamcrest.CoreMatchers.containsString;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import org.apache.logging.log4j.junit.StatusLoggerRule;
+import static org.hamcrest.MatcherAssert.*;
+import static org.junit.jupiter.api.Assertions.*;
+
+import org.apache.logging.log4j.junit.StatusLoggerLevelExtension;
 import org.apache.logging.log4j.message.Message;
 import org.apache.logging.log4j.message.ObjectMessage;
 import org.apache.logging.log4j.message.ParameterizedMessage;
@@ -36,14 +32,11 @@ import org.apache.logging.log4j.status.StatusData;
 import org.apache.logging.log4j.status.StatusLogger;
 import org.apache.logging.log4j.util.MessageSupplier;
 import org.apache.logging.log4j.util.Supplier;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
 import java.util.List;
 
-/**
- *
- */
 public class AbstractLoggerTest {
 
     private static final StringBuilder CHAR_SEQ = new StringBuilder("CharSeq");
@@ -51,24 +44,24 @@ public class AbstractLoggerTest {
     // TODO add proper tests for ReusableMessage
 
     @SuppressWarnings("ThrowableInstanceNeverThrown")
-    private static Throwable t = new UnsupportedOperationException("Test");
+    private static final Throwable t = new UnsupportedOperationException("Test");
 
-    private static Class<AbstractLogger> obj = AbstractLogger.class;
-    private static String pattern = "{}, {}";
-    private static String p1 = "Long Beach";
+    private static final Class<AbstractLogger> obj = AbstractLogger.class;
+    private static final String pattern = "{}, {}";
+    private static final String p1 = "Long Beach";
 
-    private static String p2 = "California";
-    private static Message charSeq = new SimpleMessage(CHAR_SEQ);
-    private static Message simple = new SimpleMessage("Hello");
-    private static Message object = new ObjectMessage(obj);
+    private static final String p2 = "California";
+    private static final Message charSeq = new SimpleMessage(CHAR_SEQ);
+    private static final Message simple = new SimpleMessage("Hello");
+    private static final Message object = new ObjectMessage(obj);
 
-    private static Message param = new ParameterizedMessage(pattern, p1, p2);
+    private static final Message param = new ParameterizedMessage(pattern, p1, p2);
 
     private static final Marker MARKER = MarkerManager.getMarker("TEST");
     private static final String MARKER_NAME = "TEST";
 
-    @Rule
-    public StatusLoggerRule status = new StatusLoggerRule(Level.WARN);
+    @RegisterExtension
+    public StatusLoggerLevelExtension status = new StatusLoggerLevelExtension(Level.WARN);
 
     private static final LogEvent[] EVENTS = new LogEvent[] {
         new LogEvent(null, simple, null),
@@ -148,8 +141,8 @@ public class AbstractLoggerTest {
         logger.setCurrentEvent(EVENTS[18]);
         logger.debug(MARKER, CHAR_SEQ, t);
 
-        assertEquals("log(CharSeq) invocations", 4, logger.getCharSeqCount());
-        assertEquals("log(Object) invocations", 5, logger.getObjectCount());
+        assertEquals(4, logger.getCharSeqCount(), "log(CharSeq) invocations");
+        assertEquals(5, logger.getObjectCount(), "log(Object) invocations");
     }
 
     @Test
@@ -203,8 +196,8 @@ public class AbstractLoggerTest {
         logger.setCurrentEvent(EVENTS[18]);
         logger.error(MARKER, CHAR_SEQ, t);
 
-        assertEquals("log(CharSeq) invocations", 4, logger.getCharSeqCount());
-        assertEquals("log(Object) invocations", 5, logger.getObjectCount());
+        assertEquals(4, logger.getCharSeqCount(), "log(CharSeq) invocations");
+        assertEquals(5, logger.getObjectCount(), "log(Object) invocations");
     }
 
     @Test
@@ -258,8 +251,8 @@ public class AbstractLoggerTest {
         logger.setCurrentEvent(EVENTS[18]);
         logger.fatal(MARKER, CHAR_SEQ, t);
 
-        assertEquals("log(CharSeq) invocations", 4, logger.getCharSeqCount());
-        assertEquals("log(Object) invocations", 5, logger.getObjectCount());
+        assertEquals(4, logger.getCharSeqCount(), "log(CharSeq) invocations");
+        assertEquals(5, logger.getObjectCount(), "log(Object) invocations");
     }
 
     @Test
@@ -313,8 +306,8 @@ public class AbstractLoggerTest {
         logger.setCurrentEvent(EVENTS[18]);
         logger.info(MARKER, CHAR_SEQ, t);
 
-        assertEquals("log(CharSeq) invocations", 4, logger.getCharSeqCount());
-        assertEquals("log(Object) invocations", 5, logger.getObjectCount());
+        assertEquals(4, logger.getCharSeqCount(), "log(CharSeq) invocations");
+        assertEquals(5, logger.getObjectCount(), "log(Object) invocations");
     }
 
     @Test
@@ -368,8 +361,8 @@ public class AbstractLoggerTest {
         logger.setCurrentEvent(EVENTS[18]);
         logger.log(Level.DEBUG, MARKER, CHAR_SEQ, t);
 
-        assertEquals("log(CharSeq) invocations", 4, logger.getCharSeqCount());
-        assertEquals("log(Object) invocations", 5, logger.getObjectCount());
+        assertEquals(4, logger.getCharSeqCount(), "log(CharSeq) invocations");
+        assertEquals(5, logger.getObjectCount(), "log(Object) invocations");
     }
 
     @Test
@@ -423,8 +416,8 @@ public class AbstractLoggerTest {
         logger.setCurrentEvent(EVENTS[18]);
         logger.log(Level.ERROR, MARKER, CHAR_SEQ, t);
 
-        assertEquals("log(CharSeq) invocations", 4, logger.getCharSeqCount());
-        assertEquals("log(Object) invocations", 5, logger.getObjectCount());
+        assertEquals(4, logger.getCharSeqCount(), "log(CharSeq) invocations");
+        assertEquals(5, logger.getObjectCount(), "log(Object) invocations");
     }
 
     @Test
@@ -478,8 +471,8 @@ public class AbstractLoggerTest {
         logger.setCurrentEvent(EVENTS[18]);
         logger.log(Level.FATAL, MARKER, CHAR_SEQ, t);
 
-        assertEquals("log(CharSeq) invocations", 4, logger.getCharSeqCount());
-        assertEquals("log(Object) invocations", 5, logger.getObjectCount());
+        assertEquals(4, logger.getCharSeqCount(), "log(CharSeq) invocations");
+        assertEquals(5, logger.getObjectCount(), "log(Object) invocations");
     }
 
     @Test
@@ -533,8 +526,8 @@ public class AbstractLoggerTest {
         logger.setCurrentEvent(EVENTS[18]);
         logger.log(Level.INFO, MARKER, CHAR_SEQ, t);
 
-        assertEquals("log(CharSeq) invocations", 4, logger.getCharSeqCount());
-        assertEquals("log(Object) invocations", 5, logger.getObjectCount());
+        assertEquals(4, logger.getCharSeqCount(), "log(CharSeq) invocations");
+        assertEquals(5, logger.getObjectCount(), "log(Object) invocations");
     }
 
     @Test
@@ -588,8 +581,8 @@ public class AbstractLoggerTest {
         logger.setCurrentEvent(EVENTS[18]);
         logger.log(Level.TRACE, MARKER, CHAR_SEQ, t);
 
-        assertEquals("log(CharSeq) invocations", 4, logger.getCharSeqCount());
-        assertEquals("log(Object) invocations", 5, logger.getObjectCount());
+        assertEquals(4, logger.getCharSeqCount(), "log(CharSeq) invocations");
+        assertEquals(5, logger.getObjectCount(), "log(Object) invocations");
     }
 
     @Test
@@ -643,8 +636,8 @@ public class AbstractLoggerTest {
         logger.setCurrentEvent(EVENTS[18]);
         logger.log(Level.WARN, MARKER, CHAR_SEQ, t);
 
-        assertEquals("log(CharSeq) invocations", 4, logger.getCharSeqCount());
-        assertEquals("log(Object) invocations", 5, logger.getObjectCount());
+        assertEquals(4, logger.getCharSeqCount(), "log(CharSeq) invocations");
+        assertEquals(5, logger.getObjectCount(), "log(Object) invocations");
     }
 
     @Test
@@ -698,8 +691,8 @@ public class AbstractLoggerTest {
         logger.setCurrentEvent(EVENTS[18]);
         logger.trace(MARKER, CHAR_SEQ, t);
 
-        assertEquals("log(CharSeq) invocations", 4, logger.getCharSeqCount());
-        assertEquals("log(Object) invocations", 5, logger.getObjectCount());
+        assertEquals(4, logger.getCharSeqCount(), "log(CharSeq) invocations");
+        assertEquals(5, logger.getObjectCount(), "log(Object) invocations");
     }
 
     @Test
@@ -753,8 +746,8 @@ public class AbstractLoggerTest {
         logger.setCurrentEvent(EVENTS[18]);
         logger.warn(MARKER, CHAR_SEQ, t);
 
-        assertEquals("log(CharSeq) invocations", 4, logger.getCharSeqCount());
-        assertEquals("log(Object) invocations", 5, logger.getObjectCount());
+        assertEquals(4, logger.getCharSeqCount(), "log(CharSeq) invocations");
+        assertEquals(5, logger.getObjectCount(), "log(Object) invocations");
     }
 
     @Test
@@ -805,12 +798,7 @@ public class AbstractLoggerTest {
     public void testMessageSupplierWithThrowable() {
         final ThrowableExpectingLogger logger = new ThrowableExpectingLogger(true);
         final ThrowableMessage message = new ThrowableMessage(t);
-        final MessageSupplier supplier = new MessageSupplier() {
-            @Override
-            public Message get() {
-                return message;
-            }
-        };
+        final MessageSupplier supplier = () -> message;
 
         logger.debug(supplier);
         logger.error(supplier);
@@ -833,12 +821,7 @@ public class AbstractLoggerTest {
     public void testMessageSupplierWithoutThrowable() {
         final ThrowableExpectingLogger logger = new ThrowableExpectingLogger(false);
         final ThrowableMessage message = new ThrowableMessage(null);
-        final MessageSupplier supplier = new MessageSupplier() {
-            @Override
-            public Message get() {
-                return message;
-            }
-        };
+        final MessageSupplier supplier = () -> message;
 
         logger.debug(supplier);
         logger.error(supplier);
@@ -861,12 +844,7 @@ public class AbstractLoggerTest {
     public void testSupplierWithThrowable() {
         final ThrowableExpectingLogger logger = new ThrowableExpectingLogger(true);
         final ThrowableMessage message = new ThrowableMessage(t);
-        final Supplier<Message> supplier = new Supplier<Message>() {
-            @Override
-            public Message get() {
-                return message;
-            }
-        };
+        final Supplier<Message> supplier = () -> message;
 
         logger.debug(supplier);
         logger.error(supplier);
@@ -916,11 +894,8 @@ public class AbstractLoggerTest {
     @Test
     public void testMessageThrows() {
         final ThrowableExpectingLogger logger = new ThrowableExpectingLogger(false);
-        logger.error(new TestMessage(new TestMessage.FormattedMessageSupplier() {
-            @Override
-            public String getFormattedMessage() {
-                throw new IllegalStateException("Oops!");
-            }
+        logger.error(new TestMessage(() -> {
+            throw new IllegalStateException("Oops!");
         }, "Message Format"));
         final List<StatusData> statusDatalist = StatusLogger.getLogger().getStatusData();
         final StatusData mostRecent = statusDatalist.get(statusDatalist.size() - 1);
@@ -933,11 +908,8 @@ public class AbstractLoggerTest {
     @Test
     public void testMessageThrowsAndNullFormat() {
         final ThrowableExpectingLogger logger = new ThrowableExpectingLogger(false);
-        logger.error(new TestMessage(new TestMessage.FormattedMessageSupplier() {
-            @Override
-            public String getFormattedMessage() {
-                throw new IllegalStateException("Oops!");
-            }
+        logger.error(new TestMessage(() -> {
+            throw new IllegalStateException("Oops!");
         }, null /* format */));
         final List<StatusData> statusDatalist = StatusLogger.getLogger().getStatusData();
         final StatusData mostRecent = statusDatalist.get(statusDatalist.size() - 1);
@@ -1015,7 +987,7 @@ public class AbstractLoggerTest {
 
         @Override
         public boolean isEnabled(final Level level, final Marker marker, final Message data, final Throwable t) {
-            assertTrue("Incorrect Level. Expected " + currentLevel + ", actual " + level, level.equals(currentLevel));
+            assertEquals(level, currentLevel, "Incorrect Level. Expected " + currentLevel + ", actual " + level);
             if (marker == null) {
                 if (currentEvent.markerName != null) {
                     fail("Incorrect marker. Expected " + currentEvent.markerName + ", actual is null");
@@ -1024,8 +996,8 @@ public class AbstractLoggerTest {
                 if (currentEvent.markerName == null) {
                     fail("Incorrect marker. Expected null. Actual is " + marker.getName());
                 } else {
-                    assertTrue("Incorrect marker. Expected " + currentEvent.markerName + ", actual " +
-                            marker.getName(), currentEvent.markerName.equals(marker.getName()));
+                    assertEquals(currentEvent.markerName, marker.getName(),
+                            "Incorrect marker. Expected " + currentEvent.markerName + ", actual " + marker.getName());
                 }
             }
             if (data == null) {
@@ -1036,11 +1008,12 @@ public class AbstractLoggerTest {
                 if (currentEvent.data == null) {
                     fail("Incorrect message. Expected null. Actual is " + data.getFormattedMessage());
                 } else {
-                    assertTrue("Incorrect message type. Expected " + currentEvent.data + ", actual " + data,
-                            data.getClass().isAssignableFrom(currentEvent.data.getClass()));
-                    assertTrue("Incorrect message. Expected " + currentEvent.data.getFormattedMessage() + ", actual " +
-                                    data.getFormattedMessage(),
-                            currentEvent.data.getFormattedMessage().equals(data.getFormattedMessage()));
+                    assertTrue(
+                            data.getClass().isAssignableFrom(currentEvent.data.getClass()),
+                            "Incorrect message type. Expected " + currentEvent.data + ", actual " + data);
+                    assertEquals(currentEvent.data.getFormattedMessage(), data.getFormattedMessage(),
+                            "Incorrect message. Expected " + currentEvent.data.getFormattedMessage() + ", actual " +
+                                    data.getFormattedMessage());
                 }
             }
             if (t == null) {
@@ -1051,8 +1024,7 @@ public class AbstractLoggerTest {
                 if (currentEvent.t == null) {
                     fail("Incorrect Throwable. Expected null. Actual is " + t);
                 } else {
-                    assertTrue("Incorrect Throwable. Expected " + currentEvent.t + ", actual " + t,
-                            currentEvent.t.equals(t));
+                    assertEquals(currentEvent.t, t, "Incorrect Throwable. Expected " + currentEvent.t + ", actual " + t);
                 }
             }
             return true;
@@ -1156,7 +1128,7 @@ public class AbstractLoggerTest {
 
         @Override
         public void logMessage(final String fqcn, final Level level, final Marker marker, final Message data, final Throwable t) {
-            assertTrue("Incorrect Level. Expected " + currentLevel + ", actual " + level, level.equals(currentLevel));
+            assertEquals(level, currentLevel, "Incorrect Level. Expected " + currentLevel + ", actual " + level);
             if (marker == null) {
                 if (currentEvent.markerName != null) {
                     fail("Incorrect marker. Expected " + currentEvent.markerName + ", actual is null");
@@ -1165,8 +1137,8 @@ public class AbstractLoggerTest {
                 if (currentEvent.markerName == null) {
                     fail("Incorrect marker. Expected null. Actual is " + marker.getName());
                 } else {
-                    assertTrue("Incorrect marker. Expected " + currentEvent.markerName + ", actual " +
-                            marker.getName(), currentEvent.markerName.equals(marker.getName()));
+                    assertEquals(currentEvent.markerName, marker.getName(),
+                            "Incorrect marker. Expected " + currentEvent.markerName + ", actual " + marker.getName());
                 }
             }
             if (data == null) {
@@ -1177,11 +1149,12 @@ public class AbstractLoggerTest {
                 if (currentEvent.data == null) {
                     fail("Incorrect message. Expected null. Actual is " + data.getFormattedMessage());
                 } else {
-                    assertTrue("Incorrect message type. Expected " + currentEvent.data + ", actual " + data,
-                            data.getClass().isAssignableFrom(currentEvent.data.getClass()));
-                    assertTrue("Incorrect message. Expected " + currentEvent.data.getFormattedMessage() + ", actual " +
-                                    data.getFormattedMessage(),
-                            currentEvent.data.getFormattedMessage().equals(data.getFormattedMessage()));
+                    assertTrue(
+                            data.getClass().isAssignableFrom(currentEvent.data.getClass()),
+                            "Incorrect message type. Expected " + currentEvent.data + ", actual " + data);
+                    assertEquals(currentEvent.data.getFormattedMessage(), data.getFormattedMessage(),
+                            "Incorrect message. Expected " + currentEvent.data.getFormattedMessage() + ", actual " +
+                                    data.getFormattedMessage());
                 }
             }
             if (t == null) {
@@ -1192,8 +1165,7 @@ public class AbstractLoggerTest {
                 if (currentEvent.t == null) {
                     fail("Incorrect Throwable. Expected null. Actual is " + t);
                 } else {
-                    assertTrue("Incorrect Throwable. Expected " + currentEvent.t + ", actual " + t,
-                            currentEvent.t.equals(t));
+                    assertEquals(currentEvent.t, t, "Incorrect Throwable. Expected " + currentEvent.t + ", actual " + t);
                 }
             }
         }
@@ -1303,9 +1275,9 @@ public class AbstractLoggerTest {
         @Override
         public void logMessage(final String fqcn, final Level level, final Marker marker, final Message message, final Throwable t) {
             if(expectingThrowables) {
-                assertNotNull("Expected a Throwable but received null!", t);
+                assertNotNull(t, "Expected a Throwable but received null!");
             } else {
-                assertNull("Expected null but received a Throwable! "+t, t);
+                assertNull(t, "Expected null but received a Throwable! "+t);
             }
             if (message != null) {
                 message.getFormattedMessage();
@@ -1319,9 +1291,6 @@ public class AbstractLoggerTest {
     }
 
     private static class ThrowableMessage implements Message {
-        /**
-         * 
-         */
         private static final long serialVersionUID = 1L;
         private final Throwable throwable;
 
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/CloseableThreadContextTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/CloseableThreadContextTest.java
index c5e84e0..ce06907 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/CloseableThreadContextTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/CloseableThreadContextTest.java
@@ -16,16 +16,15 @@
  */
 package org.apache.logging.log4j;
 
-import org.apache.logging.log4j.junit.ThreadContextRule;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests {@link CloseableThreadContext}.
@@ -37,139 +36,161 @@ public class CloseableThreadContextTest {
     private final String key = "key";
     private final String value = "value";
 
-    @Rule
-    public final ThreadContextRule threadContextRule = new ThreadContextRule();
+    private ThreadContextHolder threadContextHolder;
+
+    @BeforeEach
+    void clearThreadContext() {
+        threadContextHolder = new ThreadContextHolder(true, true);
+        ThreadContext.clearAll();
+    }
+
+    @AfterEach
+    void restoreThreadContext() {
+        threadContextHolder.restore();
+    }
 
     @Test
-    public void shouldAddAnEntryToTheMap() throws Exception {
+    public void shouldAddAnEntryToTheMap() {
         try (final CloseableThreadContext.Instance ignored = CloseableThreadContext.put(key, value)) {
-            assertThat(ThreadContext.get(key), is(value));
+            assertNotNull(ignored);
+            assertEquals(value, ThreadContext.get(key));
         }
     }
 
     @Test
-    public void shouldAddTwoEntriesToTheMap() throws Exception {
+    public void shouldAddTwoEntriesToTheMap() {
         final String key2 = "key2";
         final String value2 = "value2";
         try (final CloseableThreadContext.Instance ignored = CloseableThreadContext.put(key, value).put(key2, value2)) {
-            assertThat(ThreadContext.get(key), is(value));
-            assertThat(ThreadContext.get(key2), is(value2));
+            assertNotNull(ignored);
+            assertEquals(value, ThreadContext.get(key));
+            assertEquals(value2, ThreadContext.get(key2));
         }
     }
 
     @Test
-    public void shouldNestEntries() throws Exception {
+    public void shouldNestEntries() {
         final String oldValue = "oldValue";
         final String innerValue = "innerValue";
         ThreadContext.put(key, oldValue);
         try (final CloseableThreadContext.Instance ignored = CloseableThreadContext.put(key, value)) {
-            assertThat(ThreadContext.get(key), is(value));
+            assertNotNull(ignored);
+            assertEquals(value, ThreadContext.get(key));
             try (final CloseableThreadContext.Instance ignored2 = CloseableThreadContext.put(key, innerValue)) {
-                assertThat(ThreadContext.get(key), is(innerValue));
+                assertNotNull(ignored2);
+                assertEquals(innerValue, ThreadContext.get(key));
             }
-            assertThat(ThreadContext.get(key), is(value));
+            assertEquals(value, ThreadContext.get(key));
         }
-        assertThat(ThreadContext.get(key), is(oldValue));
+        assertEquals(oldValue, ThreadContext.get(key));
     }
 
     @Test
-    public void shouldPreserveOldEntriesFromTheMapWhenAutoClosed() throws Exception {
+    public void shouldPreserveOldEntriesFromTheMapWhenAutoClosed() {
         final String oldValue = "oldValue";
         ThreadContext.put(key, oldValue);
         try (final CloseableThreadContext.Instance ignored = CloseableThreadContext.put(key, value)) {
-            assertThat(ThreadContext.get(key), is(value));
+            assertNotNull(ignored);
+            assertEquals(value, ThreadContext.get(key));
         }
-        assertThat(ThreadContext.get(key), is(oldValue));
+        assertEquals(oldValue, ThreadContext.get(key));
     }
 
     @Test
-    public void ifTheSameKeyIsAddedTwiceTheOriginalShouldBeUsed() throws Exception {
+    public void ifTheSameKeyIsAddedTwiceTheOriginalShouldBeUsed() {
         final String oldValue = "oldValue";
         final String secondValue = "innerValue";
         ThreadContext.put(key, oldValue);
         try (final CloseableThreadContext.Instance ignored = CloseableThreadContext.put(key, value).put(key, secondValue)) {
-            assertThat(ThreadContext.get(key), is(secondValue));
+            assertNotNull(ignored);
+            assertEquals(secondValue, ThreadContext.get(key));
         }
-        assertThat(ThreadContext.get(key), is(oldValue));
+        assertEquals(oldValue, ThreadContext.get(key));
     }
 
     @Test
-    public void shouldPushAndPopAnEntryToTheStack() throws Exception {
+    public void shouldPushAndPopAnEntryToTheStack() {
         final String message = "message";
         try (final CloseableThreadContext.Instance ignored = CloseableThreadContext.push(message)) {
-            assertThat(ThreadContext.peek(), is(message));
+            assertNotNull(ignored);
+            assertEquals(message, ThreadContext.peek());
         }
-        assertThat(ThreadContext.peek(), is(""));
+        assertEquals("", ThreadContext.peek());
     }
 
     @Test
-    public void shouldPushAndPopTwoEntriesToTheStack() throws Exception {
+    public void shouldPushAndPopTwoEntriesToTheStack() {
         final String message1 = "message1";
         final String message2 = "message2";
         try (final CloseableThreadContext.Instance ignored = CloseableThreadContext.push(message1).push(message2)) {
-            assertThat(ThreadContext.peek(), is(message2));
+            assertNotNull(ignored);
+            assertEquals(message2, ThreadContext.peek());
         }
-        assertThat(ThreadContext.peek(), is(""));
+        assertEquals("", ThreadContext.peek());
     }
 
     @Test
-    public void shouldPushAndPopAParameterizedEntryToTheStack() throws Exception {
+    public void shouldPushAndPopAParameterizedEntryToTheStack() {
         final String parameterizedMessage = "message {}";
         final String parameterizedMessageParameter = "param";
         final String formattedMessage = parameterizedMessage.replace("{}", parameterizedMessageParameter);
         try (final CloseableThreadContext.Instance ignored = CloseableThreadContext.push(parameterizedMessage,
                 parameterizedMessageParameter)) {
-            assertThat(ThreadContext.peek(), is(formattedMessage));
+            assertNotNull(ignored);
+            assertEquals(formattedMessage, ThreadContext.peek());
         }
-        assertThat(ThreadContext.peek(), is(""));
+        assertEquals("", ThreadContext.peek());
     }
 
     @Test
-    public void shouldRemoveAnEntryFromTheMapWhenAutoClosed() throws Exception {
+    public void shouldRemoveAnEntryFromTheMapWhenAutoClosed() {
         try (final CloseableThreadContext.Instance ignored = CloseableThreadContext.put(key, value)) {
-            assertThat(ThreadContext.get(key), is(value));
+            assertNotNull(ignored);
+            assertEquals(value, ThreadContext.get(key));
         }
-        assertThat(ThreadContext.containsKey(key), is(false));
+        assertFalse(ThreadContext.containsKey(key));
     }
 
     @Test
-    public void shouldAddEntriesToBothStackAndMap() throws Exception {
+    public void shouldAddEntriesToBothStackAndMap() {
         final String stackValue = "something";
         try (final CloseableThreadContext.Instance ignored = CloseableThreadContext.put(key, value).push(stackValue)) {
-            assertThat(ThreadContext.get(key), is(value));
-            assertThat(ThreadContext.peek(), is(stackValue));
+            assertNotNull(ignored);
+            assertEquals(value, ThreadContext.get(key));
+            assertEquals(stackValue, ThreadContext.peek());
         }
-        assertThat(ThreadContext.containsKey(key), is(false));
-        assertThat(ThreadContext.peek(), is(""));
+        assertFalse(ThreadContext.containsKey(key));
+        assertEquals("", ThreadContext.peek());
     }
 
     @Test
-    public void canReuseCloseableThreadContext() throws Exception {
+    public void canReuseCloseableThreadContext() {
         final String stackValue = "something";
         // Create a ctc and close it
         final CloseableThreadContext.Instance ctc = CloseableThreadContext.push(stackValue).put(key, value);
-        assertThat(ThreadContext.get(key), is(value));
-        assertThat(ThreadContext.peek(), is(stackValue));
+        assertNotNull(ctc);
+        assertEquals(value, ThreadContext.get(key));
+        assertEquals(stackValue, ThreadContext.peek());
         ctc.close();
 
-        assertThat(ThreadContext.containsKey(key), is(false));
-        assertThat(ThreadContext.peek(), is(""));
+        assertFalse(ThreadContext.containsKey(key));
+        assertEquals("", ThreadContext.peek());
 
         final String anotherKey = "key2";
         final String anotherValue = "value2";
         final String anotherStackValue = "something else";
         // Use it again
         ctc.push(anotherStackValue).put(anotherKey, anotherValue);
-        assertThat(ThreadContext.get(anotherKey), is(anotherValue));
-        assertThat(ThreadContext.peek(), is(anotherStackValue));
+        assertEquals(anotherValue, ThreadContext.get(anotherKey));
+        assertEquals(anotherStackValue, ThreadContext.peek());
         ctc.close();
 
-        assertThat(ThreadContext.containsKey(anotherKey), is(false));
-        assertThat(ThreadContext.peek(), is(""));
+        assertFalse(ThreadContext.containsKey(anotherKey));
+        assertEquals("", ThreadContext.peek());
     }
 
     @Test
-    public void closeIsIdempotent() throws Exception {
+    public void closeIsIdempotent() {
 
         final String originalMapValue = "map to keep";
         final String originalStackValue = "stack to keep";
@@ -179,18 +200,19 @@ public class CloseableThreadContextTest {
         final String newMapValue = "temp map value";
         final String newStackValue = "temp stack to keep";
         final CloseableThreadContext.Instance ctc = CloseableThreadContext.push(newStackValue).put(key, newMapValue);
+        assertNotNull(ctc);
 
         ctc.close();
-        assertThat(ThreadContext.get(key), is(originalMapValue));
-        assertThat(ThreadContext.peek(), is(originalStackValue));
+        assertEquals(originalMapValue, ThreadContext.get(key));
+        assertEquals(originalStackValue, ThreadContext.peek());
 
         ctc.close();
-        assertThat(ThreadContext.get(key), is(originalMapValue));
-        assertThat(ThreadContext.peek(), is(originalStackValue));
+        assertEquals(originalMapValue, ThreadContext.get(key));
+        assertEquals(originalStackValue, ThreadContext.peek());
     }
 
     @Test
-    public void putAllWillPutAllValues() throws Exception {
+    public void putAllWillPutAllValues() {
 
         final String oldValue = "oldValue";
         ThreadContext.put(key, oldValue);
@@ -199,23 +221,25 @@ public class CloseableThreadContextTest {
         valuesToPut.put(key, value);
 
         try (final CloseableThreadContext.Instance ignored = CloseableThreadContext.putAll(valuesToPut)) {
-            assertThat(ThreadContext.get(key), is(value));
+            assertNotNull(ignored);
+            assertEquals(value, ThreadContext.get(key));
         }
-        assertThat(ThreadContext.get(key), is(oldValue));
+        assertEquals(oldValue, ThreadContext.get(key));
 
     }
 
     @Test
-    public void pushAllWillPushAllValues() throws Exception {
+    public void pushAllWillPushAllValues() {
 
         ThreadContext.push(key);
         final List<String> messages = ThreadContext.getImmutableStack().asList();
         ThreadContext.pop();
 
         try (final CloseableThreadContext.Instance ignored = CloseableThreadContext.pushAll(messages)) {
-            assertThat(ThreadContext.peek(), is(key));
+            assertNotNull(ignored);
+            assertEquals(key, ThreadContext.peek());
         }
-        assertThat(ThreadContext.peek(), is(""));
+        assertEquals("", ThreadContext.peek());
 
     }
 
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/EventLoggerTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/EventLoggerTest.java
index 181a344..a778a45 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/EventLoggerTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/EventLoggerTest.java
@@ -16,26 +16,21 @@
  */
 package org.apache.logging.log4j;
 
-import java.util.List;
-import java.util.Locale;
-
 import org.apache.logging.log4j.message.StructuredDataMessage;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
-import static org.hamcrest.CoreMatchers.*;
+import java.util.List;
+import java.util.Locale;
 
-import static org.junit.Assert.*;
+import static org.assertj.core.api.Assertions.assertThat;
 
-/**
- *
- */
 public class EventLoggerTest {
 
     TestLogger logger = (TestLogger) LogManager.getLogger("EventLogger");
     List<String> results = logger.getEntries();
 
-    @Before
+    @BeforeEach
     public void setup() {
         results.clear();
     }
@@ -51,9 +46,9 @@ public class EventLoggerTest {
         msg.put("Amount", "200.00");
         EventLogger.logEvent(msg);
         ThreadContext.clearMap();
-        assertEquals(1, results.size());
+        assertThat(results).hasSize(1);
         final String expected = "EVENT OFF Audit [Transfer@18060 Amount=\"200.00\" FromAccount=\"123457\" ToAccount=\"123456\"] Transfer Complete";
-        assertThat("Incorrect structured data", results.get(0), startsWith(expected));
+        assertThat(results.get(0)).startsWith(expected);
     }
 
 }
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/LambdaLoggerTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/LambdaLoggerTest.java
index b532171..422eacd 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/LambdaLoggerTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/LambdaLoggerTest.java
@@ -17,18 +17,18 @@
 
 package org.apache.logging.log4j;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import org.apache.logging.log4j.message.Message;
 import org.apache.logging.log4j.message.ReusableMessage;
 import org.apache.logging.log4j.message.SimpleMessage;
 import org.apache.logging.log4j.spi.AbstractLogger;
 import org.apache.logging.log4j.util.Supplier;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.util.ArrayList;
+import java.util.List;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests the AbstractLogger implementation of the Logger2 interface.
@@ -212,7 +212,7 @@ public class LambdaLoggerTest {
     final Supplier[] supplierArray1 = new Supplier[] {supplier};
     final Supplier[] supplierArray2 = new Supplier[] {supplier, supplier2};
 
-    @Before
+    @BeforeEach
     public void beforeEachTest() {
         logger2.list.clear();
         supplier.invoked = false;
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/LevelTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/LevelTest.java
index 5691e0e..0e46488 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/LevelTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/LevelTest.java
@@ -16,16 +16,10 @@
  */
 package org.apache.logging.log4j;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import org.junit.jupiter.api.Test;
 
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.*;
 
-/**
- *
- */
 public class LevelTest {
 
     @Test
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/LogManagerTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/LogManagerTest.java
index a3164d1..8aa150d 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/LogManagerTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/LogManagerTest.java
@@ -16,26 +16,24 @@
  */
 package org.apache.logging.log4j;
 
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import org.apache.logging.log4j.message.ParameterizedMessageFactory;
+import org.apache.logging.log4j.spi.LoggerContext;
+import org.junit.jupiter.api.Test;
 
 import java.io.Closeable;
 import java.io.IOException;
 
-import org.apache.logging.log4j.message.ParameterizedMessageFactory;
-import org.apache.logging.log4j.spi.LoggerContext;
-import org.junit.Assert;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-/**
- *
- */
 public class LogManagerTest {
 
+    @SuppressWarnings("InnerClassMayBeStatic")
     class Inner {
         final Logger LOGGER = LogManager.getLogger();
     }
     
+    @SuppressWarnings("InnerClassMayBeStatic")
     class InnerByClass {
         final Logger LOGGER = LogManager.getLogger(InnerByClass.class);
     }
@@ -51,40 +49,40 @@ public class LogManagerTest {
     @Test
     public void testGetLogger() {
         Logger logger = LogManager.getLogger();
-        assertNotNull("No Logger returned", logger);
-        assertTrue("Incorrect Logger name: " + logger.getName(),LogManagerTest.class.getName().equals(logger.getName()));
+        assertNotNull(logger, "No Logger returned");
+        assertEquals(LogManagerTest.class.getName(), logger.getName(), "Incorrect Logger name: " + logger.getName());
         logger = LogManager.getLogger(ParameterizedMessageFactory.INSTANCE);
-        assertNotNull("No Logger returned", logger);
-        assertTrue("Incorrect Logger name: " + logger.getName(),LogManagerTest.class.getName().equals(logger.getName()));
+        assertNotNull(logger, "No Logger returned");
+        assertEquals(LogManagerTest.class.getName(), logger.getName(), "Incorrect Logger name: " + logger.getName());
         logger = LogManager.getLogger((Class<?>) null);
-        assertNotNull("No Logger returned", logger);
-        assertTrue("Incorrect Logger name: " + logger.getName(),LogManagerTest.class.getName().equals(logger.getName()));
+        assertNotNull(logger, "No Logger returned");
+        assertEquals(LogManagerTest.class.getName(), logger.getName(), "Incorrect Logger name: " + logger.getName());
         logger = LogManager.getLogger((Class<?>) null, ParameterizedMessageFactory.INSTANCE);
-        assertNotNull("No Logger returned", logger);
-        assertTrue("Incorrect Logger name: " + logger.getName(),LogManagerTest.class.getName().equals(logger.getName()));
+        assertNotNull(logger, "No Logger returned");
+        assertEquals(LogManagerTest.class.getName(), logger.getName(), "Incorrect Logger name: " + logger.getName());
         logger = LogManager.getLogger((String) null);
-        assertNotNull("No Logger returned", logger);
-        assertTrue("Incorrect Logger name: " + logger.getName(),LogManagerTest.class.getName().equals(logger.getName()));
+        assertNotNull(logger, "No Logger returned");
+        assertEquals(LogManagerTest.class.getName(), logger.getName(), "Incorrect Logger name: " + logger.getName());
         logger = LogManager.getLogger((String) null, ParameterizedMessageFactory.INSTANCE);
-        assertNotNull("No Logger returned", logger);
-        assertTrue("Incorrect Logger name: " + logger.getName(),LogManagerTest.class.getName().equals(logger.getName()));
+        assertNotNull(logger, "No Logger returned");
+        assertEquals(LogManagerTest.class.getName(), logger.getName(), "Incorrect Logger name: " + logger.getName());
         logger = LogManager.getLogger((Object) null);
-        assertNotNull("No Logger returned", logger);
-        assertTrue("Incorrect Logger name: " + logger.getName(),LogManagerTest.class.getName().equals(logger.getName()));
+        assertNotNull(logger, "No Logger returned");
+        assertEquals(LogManagerTest.class.getName(), logger.getName(), "Incorrect Logger name: " + logger.getName());
         logger = LogManager.getLogger((Object) null, ParameterizedMessageFactory.INSTANCE);
-        assertNotNull("No Logger returned", logger);
-        assertTrue("Incorrect Logger name: " + logger.getName(),LogManagerTest.class.getName().equals(logger.getName()));
+        assertNotNull(logger, "No Logger returned");
+        assertEquals(LogManagerTest.class.getName(), logger.getName(), "Incorrect Logger name: " + logger.getName());
     }
 
     @Test
     public void testGetLoggerForAnonymousInnerClass1() throws IOException {
         final Closeable closeable = new Closeable() {
             
-            Logger LOGGER = LogManager.getLogger();
+            final Logger LOGGER = LogManager.getLogger();
             
             @Override
             public void close() throws IOException {
-                Assert.assertEquals("org.apache.logging.log4j.LogManagerTest$1", LOGGER.getName());
+                assertEquals("org.apache.logging.log4j.LogManagerTest$1", LOGGER.getName());
             }
         };
         closeable.close();
@@ -94,11 +92,11 @@ public class LogManagerTest {
     public void testGetLoggerForAnonymousInnerClass2() throws IOException {
         final Closeable closeable = new Closeable() {
             
-            Logger LOGGER = LogManager.getLogger(getClass());
+            final Logger LOGGER = LogManager.getLogger(getClass());
             
             @Override
             public void close() throws IOException {
-                Assert.assertEquals("org.apache.logging.log4j.LogManagerTest$2", LOGGER.getName());
+                assertEquals("org.apache.logging.log4j.LogManagerTest$2", LOGGER.getName());
             }
         };
         closeable.close();
@@ -106,22 +104,22 @@ public class LogManagerTest {
 
     @Test
     public void testGetLoggerForInner() {
-        Assert.assertEquals("org.apache.logging.log4j.LogManagerTest.Inner", new Inner().LOGGER.getName());
+        assertEquals("org.apache.logging.log4j.LogManagerTest.Inner", new Inner().LOGGER.getName());
     }
 
     @Test
     public void testGetLoggerForInnerByClass() {
-        Assert.assertEquals("org.apache.logging.log4j.LogManagerTest.InnerByClass", new InnerByClass().LOGGER.getName());
+        assertEquals("org.apache.logging.log4j.LogManagerTest.InnerByClass", new InnerByClass().LOGGER.getName());
     }
 
     @Test
     public void testGetLoggerForStaticInner() {
-        Assert.assertEquals("org.apache.logging.log4j.LogManagerTest.StaticInner", StaticInner.LOGGER.getName());
+        assertEquals("org.apache.logging.log4j.LogManagerTest.StaticInner", StaticInner.LOGGER.getName());
     }
 
     @Test
     public void testGetLoggerForStaticInnerByClass() {
-        Assert.assertEquals("org.apache.logging.log4j.LogManagerTest.StaticInnerByClass", StaticInnerByClass.LOGGER.getName());
+        assertEquals("org.apache.logging.log4j.LogManagerTest.StaticInnerByClass", StaticInnerByClass.LOGGER.getName());
     }
 
     @Test
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/LoggerSupplierTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/LoggerSupplierTest.java
index 7b78fe1..e8c7b39 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/LoggerSupplierTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/LoggerSupplierTest.java
@@ -16,15 +16,6 @@
  */
 package org.apache.logging.log4j;
 
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.startsWith;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
-
-import java.util.List;
-import java.util.Locale;
-
 import org.apache.logging.log4j.message.FormattedMessage;
 import org.apache.logging.log4j.message.JsonMessage;
 import org.apache.logging.log4j.message.LocalizedMessage;
@@ -36,9 +27,14 @@ import org.apache.logging.log4j.message.SimpleMessage;
 import org.apache.logging.log4j.message.StringFormattedMessage;
 import org.apache.logging.log4j.message.ThreadDumpMessage;
 import org.apache.logging.log4j.util.Supplier;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.util.List;
+import java.util.Locale;
+
+import static org.assertj.core.api.Assertions.assertThat;
 
 /**
  * Tests Logger APIs with {@link Supplier}.
@@ -53,181 +49,130 @@ public class LoggerSupplierTest {
 
     @Test
     public void flowTracing_SupplierOfFormattedMessage() {
-        logger.traceEntry(new Supplier<FormattedMessage>() {
-            @Override
-            public FormattedMessage get() {
-                return new FormattedMessage("int foo={}", 1234567890);
-            }
-        });
-        assertEquals(1, results.size());
-        assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
-        assertThat("Missing entry data", results.get(0), containsString("(int foo=1234567890)"));
-        assertThat("Bad toString()", results.get(0), not(containsString("FormattedMessage")));
+        logger.traceEntry(() -> new FormattedMessage("int foo={}", 1234567890));
+        assertThat(results).hasSize(1);
+        String entry = results.get(0);
+        assertThat(entry).startsWith("ENTER[ FLOW ] TRACE Enter")
+                .contains("(int foo=1234567890)")
+                .doesNotContain("FormattedMessage");
     }
 
     @Test
     public void flowTracing_SupplierOfJsonMessage() {
-        logger.traceEntry(new Supplier<JsonMessage>() {
-            @Override
-            public JsonMessage get() {
-                return new JsonMessage(System.getProperties());
-            }
-        });
-        assertEquals(1, results.size());
-        assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
-        assertThat("Missing entry data", results.get(0), containsString("\"java.runtime.name\":"));
-        assertThat("Bad toString()", results.get(0), not(containsString("JsonMessage")));
+        logger.traceEntry(() -> new JsonMessage(System.getProperties()));
+        assertThat(results).hasSize(1);
+        String entry = results.get(0);
+        assertThat(entry).startsWith("ENTER[ FLOW ] TRACE Enter")
+                .contains("\"java.runtime.name\":")
+                .doesNotContain("JsonMessage");
     }
 
     @Test
     public void flowTracing_SupplierOfLocalizedMessage() {
-        logger.traceEntry(new Supplier<LocalizedMessage>() {
-            @Override
-            public LocalizedMessage get() {
-                return new LocalizedMessage("int foo={}", 1234567890);
-            }
-        });
-        assertEquals(1, results.size());
-        assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
-        assertThat("Missing entry data", results.get(0), containsString("(int foo=1234567890)"));
-        assertThat("Bad toString()", results.get(0), not(containsString("LocalizedMessage")));
+        logger.traceEntry(() -> new LocalizedMessage("int foo={}", 1234567890));
+        assertThat(results).hasSize(1);
+        String entry = results.get(0);
+        assertThat(entry).startsWith("ENTER[ FLOW ] TRACE Enter")
+                .contains("(int foo=1234567890)")
+                .doesNotContain("LocalizedMessage");
     }
 
     @Test
     public void flowTracing_SupplierOfLong() {
-        logger.traceEntry(new Supplier<Long>() {
-            @Override
-            public Long get() {
-                return Long.valueOf(1234567890);
-            }
-        });
-        assertEquals(1, results.size());
-        assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
-        assertThat("Missing entry data", results.get(0), containsString("(1234567890)"));
-        assertThat("Bad toString()", results.get(0), not(containsString("SimpleMessage")));
+        logger.traceEntry(() -> 1234567890L);
+        assertThat(results).hasSize(1);
+        String entry = results.get(0);
+        assertThat(entry).startsWith("ENTER[ FLOW ] TRACE Enter")
+                .contains("(1234567890)")
+                .doesNotContain("SimpleMessage");
     }
 
     @Test
     public void flowTracing_SupplierOfMessageFormatMessage() {
-        logger.traceEntry(new Supplier<MessageFormatMessage>() {
-            @Override
-            public MessageFormatMessage get() {
-                return new MessageFormatMessage("int foo={0}", 1234567890);
-            }
-        });
-        assertEquals(1, results.size());
-        assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
-        assertThat("Missing entry data", results.get(0), containsString("(int foo=1,234,567,890)"));
-        assertThat("Bad toString()", results.get(0), not(containsString("MessageFormatMessage")));
+        logger.traceEntry(() -> new MessageFormatMessage("int foo={0}", 1234567890));
+        assertThat(results).hasSize(1);
+        String entry = results.get(0);
+        assertThat(entry).startsWith("ENTER[ FLOW ] TRACE Enter")
+                .contains("(int foo=1,234,567,890)")
+                .doesNotContain("MessageFormatMessage");
     }
 
     @Test
     public void flowTracing_SupplierOfObjectArrayMessage() {
-        logger.traceEntry(new Supplier<ObjectArrayMessage>() {
-            @Override
-            public ObjectArrayMessage get() {
-                return new ObjectArrayMessage(1234567890);
-            }
-        });
-        assertEquals(1, results.size());
-        assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
-        assertThat("Missing Enter data", results.get(0), containsString("([1234567890])"));
-        assertThat("Bad toString()", results.get(0), not(containsString("ObjectArrayMessage")));
+        logger.traceEntry(() -> new ObjectArrayMessage(1234567890));
+        assertThat(results).hasSize(1);
+        String entry = results.get(0);
+        assertThat(entry).startsWith("ENTER[ FLOW ] TRACE Enter")
+                .contains("([1234567890])")
+                .doesNotContain("ObjectArrayMessage");
     }
 
     @Test
     public void flowTracing_SupplierOfObjectMessage() {
-        logger.traceEntry(new Supplier<ObjectMessage>() {
-            @Override
-            public ObjectMessage get() {
-                return new ObjectMessage(1234567890);
-            }
-        });
-        assertEquals(1, results.size());
-        assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
-        assertThat("Missing entry data", results.get(0), containsString("(1234567890)"));
-        assertThat("Bad toString()", results.get(0), not(containsString("ObjectMessage")));
+        logger.traceEntry(() -> new ObjectMessage(1234567890));
+        assertThat(results).hasSize(1);
+        String entry = results.get(0);
+        assertThat(entry).startsWith("ENTER[ FLOW ] TRACE Enter")
+                .contains("(1234567890)")
+                .doesNotContain("ObjectMessage");
     }
 
     @Test
     public void flowTracing_SupplierOfParameterizedMessage() {
-        logger.traceEntry(new Supplier<ParameterizedMessage>() {
-            @Override
-            public ParameterizedMessage get() {
-                return new ParameterizedMessage("int foo={}", 1234567890);
-            }
-        });
-        assertEquals(1, results.size());
-        assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
-        assertThat("Missing entry data", results.get(0), containsString("(int foo=1234567890)"));
-        assertThat("Bad toString()", results.get(0), not(containsString("ParameterizedMessage")));
+        logger.traceEntry(() -> new ParameterizedMessage("int foo={}", 1234567890));
+        assertThat(results).hasSize(1);
+        String entry = results.get(0);
+        assertThat(entry).startsWith("ENTER[ FLOW ] TRACE Enter")
+                .contains("(int foo=1234567890)")
+                .doesNotContain("ParameterizedMessage");
     }
 
     @Test
     public void flowTracing_SupplierOfSimpleMessage() {
-        logger.traceEntry(new Supplier<SimpleMessage>() {
-            @Override
-            public SimpleMessage get() {
-                return new SimpleMessage("1234567890");
-            }
-        });
-        assertEquals(1, results.size());
-        assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
-        assertThat("Missing entry data", results.get(0), containsString("(1234567890)"));
-        assertThat("Bad toString()", results.get(0), not(containsString("SimpleMessage")));
+        logger.traceEntry(() -> new SimpleMessage("1234567890"));
+        assertThat(results).hasSize(1);
+        String entry = results.get(0);
+        assertThat(entry).startsWith("ENTER[ FLOW ] TRACE Enter")
+                .contains("(1234567890)")
+                .doesNotContain("SimpleMessage");
     }
 
     @Test
     public void flowTracing_SupplierOfString() {
-        logger.traceEntry(new Supplier<String>() {
-            @Override
-            public String get() {
-                return "1234567890";
-            }
-        });
-        assertEquals(1, results.size());
-        assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
-        assertThat("Missing entry data", results.get(0), containsString("(1234567890)"));
-        assertThat("Bad toString()", results.get(0), not(containsString("SimpleMessage")));
+        logger.traceEntry(() -> "1234567890");
+        assertThat(results).hasSize(1);
+        String entry = results.get(0);
+        assertThat(entry).startsWith("ENTER[ FLOW ] TRACE Enter")
+                .contains("(1234567890)")
+                .doesNotContain("SimpleMessage");
     }
 
     @Test
     public void flowTracing_SupplierOfStringFormattedMessage() {
-        logger.traceEntry(new Supplier<StringFormattedMessage>() {
-            @Override
-            public StringFormattedMessage get() {
-                return new StringFormattedMessage("int foo=%,d", 1234567890);
-            }
-        });
-        assertEquals(1, results.size());
-        assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
-        assertThat("Missing entry data", results.get(0), containsString("(int foo=1,234,567,890)"));
-        assertThat("Bad toString()", results.get(0), not(containsString("StringFormattedMessage")));
+        logger.traceEntry(() -> new StringFormattedMessage("int foo=%,d", 1234567890));
+        assertThat(results).hasSize(1);
+        String entry = results.get(0);
+        assertThat(entry).startsWith("ENTER[ FLOW ] TRACE Enter")
+                .contains("(int foo=1,234,567,890)")
+                .doesNotContain("StringFormattedMessage");
     }
 
     @Test
     public void flowTracing_SupplierOfThreadDumpMessage() {
-        logger.traceEntry(new Supplier<ThreadDumpMessage>() {
-            @Override
-            public ThreadDumpMessage get() {
-                return new ThreadDumpMessage("Title of ...");
-            }
-        });
-        assertEquals(1, results.size());
-        assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
-        assertThat("Missing entry data", results.get(0), containsString("RUNNABLE"));
-        assertThat("Missing entry data", results.get(0), containsString("Title of ..."));
-        assertThat("Missing entry data", results.get(0), containsString(getClass().getName()));
+        logger.traceEntry(() -> new ThreadDumpMessage("Title of ..."));
+        assertThat(results).hasSize(1);
+        String entry = results.get(0);
+        assertThat(entry).startsWith("ENTER[ FLOW ] TRACE Enter").contains("RUNNABLE", "Title of ...", getClass().getName());
     }
     
-    @Before
+    @BeforeEach
     public void setup() {
         results.clear();
         defaultLocale = Locale.getDefault(Locale.Category.FORMAT);
         Locale.setDefault(Locale.Category.FORMAT, java.util.Locale.US);
     }
     
-    @After
+    @AfterEach
     public void tearDown() {
         Locale.setDefault(Locale.Category.FORMAT, defaultLocale);
     }
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/LoggerTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/LoggerTest.java
index 4a6af6c..803c8d7 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/LoggerTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/LoggerTest.java
@@ -16,10 +16,6 @@
  */
 package org.apache.logging.log4j;
 
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-
 import org.apache.logging.log4j.message.EntryMessage;
 import org.apache.logging.log4j.message.JsonMessage;
 import org.apache.logging.log4j.message.Message;
@@ -33,17 +29,17 @@ import org.apache.logging.log4j.message.StructuredDataMessage;
 import org.apache.logging.log4j.spi.MessageFactory2Adapter;
 import org.apache.logging.log4j.util.Strings;
 import org.apache.logging.log4j.util.Supplier;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.CoreMatchers.endsWith;
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.startsWith;
-import static org.junit.Assert.*;
-/**
- *
- */
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+
+import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.*;
+
 public class LoggerTest {
 
     private static class TestParameterizedMessageFactory {
@@ -65,12 +61,12 @@ public class LoggerTest {
         logger.atWarn().withThrowable(new Throwable("This is a test")).log((Message) new SimpleMessage("Log4j rocks!"));
         assertEquals(3, results.size());
         assertThat("Incorrect message 1", results.get(0),
-                equalTo(" DEBUG org.apache.logging.log4j.LoggerTest.builder(LoggerTest.java:63) Hello"));
+                equalTo(" DEBUG org.apache.logging.log4j.LoggerTest.builder(LoggerTest.java:59) Hello"));
         assertThat("Incorrect message 2", results.get(1), equalTo("test ERROR Hello John"));
         assertThat("Incorrect message 3", results.get(2),
                 startsWith(" WARN Log4j rocks! java.lang.Throwable: This is a test"));
         assertThat("Throwable incorrect in message 3", results.get(2),
-                containsString("at org.apache.logging.log4j.LoggerTest.builder(LoggerTest.java:65)"));
+                containsString("at org.apache.logging.log4j.LoggerTest.builder(LoggerTest.java:61)"));
     }
 
     @Test
@@ -215,29 +211,30 @@ public class LoggerTest {
     public void debug() {
         logger.debug("Debug message");
         assertEquals(1, results.size());
-        assertTrue("Incorrect message", results.get(0).startsWith(" DEBUG Debug message"));
+        assertTrue(results.get(0).startsWith(" DEBUG Debug message"), "Incorrect message");
     }
 
     @Test
     public void debugObject() {
         logger.debug(new Date());
         assertEquals(1, results.size());
-        assertTrue("Invalid length", results.get(0).length() > 7);
+        assertTrue(results.get(0).length() > 7, "Invalid length");
     }
 
     @Test
     public void debugWithParms() {
         logger.debug("Hello, {}", "World");
         assertEquals(1, results.size());
-        assertTrue("Incorrect substitution", results.get(0).startsWith(" DEBUG Hello, World"));
+        assertTrue(results.get(0).startsWith(" DEBUG Hello, World"), "Incorrect substitution");
     }
 
     @Test
     public void debugWithParmsAndThrowable() {
         logger.debug("Hello, {}", "World", new RuntimeException("Test Exception"));
         assertEquals(1, results.size());
-        assertTrue("Unexpected results: " + results.get(0),
-            results.get(0).startsWith(" DEBUG Hello, World java.lang.RuntimeException: Test Exception"));
+        assertTrue(
+                results.get(0).startsWith(" DEBUG Hello, World java.lang.RuntimeException: Test Exception"),
+                "Unexpected results: " + results.get(0));
     }
 
     @Test
@@ -459,94 +456,94 @@ public class LoggerTest {
 
     @Test
     public void isAllEnabled() {
-        assertTrue("Incorrect level", logger.isEnabled(Level.ALL));
+        assertTrue(logger.isEnabled(Level.ALL), "Incorrect level");
     }
 
     @Test
     public void isDebugEnabled() {
-        assertTrue("Incorrect level", logger.isDebugEnabled());
-        assertTrue("Incorrect level", logger.isEnabled(Level.DEBUG));
+        assertTrue(logger.isDebugEnabled(), "Incorrect level");
+        assertTrue(logger.isEnabled(Level.DEBUG), "Incorrect level");
     }
 
     @Test
     public void isErrorEnabled() {
-        assertTrue("Incorrect level", logger.isErrorEnabled());
-        assertTrue("Incorrect level", logger.isEnabled(Level.ERROR));
+        assertTrue(logger.isErrorEnabled(), "Incorrect level");
+        assertTrue(logger.isEnabled(Level.ERROR), "Incorrect level");
     }
 
     @Test
     public void isFatalEnabled() {
-        assertTrue("Incorrect level", logger.isFatalEnabled());
-        assertTrue("Incorrect level", logger.isEnabled(Level.FATAL));
+        assertTrue(logger.isFatalEnabled(), "Incorrect level");
+        assertTrue(logger.isEnabled(Level.FATAL), "Incorrect level");
     }
 
     @Test
     public void isInfoEnabled() {
-        assertTrue("Incorrect level", logger.isInfoEnabled());
-        assertTrue("Incorrect level", logger.isEnabled(Level.INFO));
+        assertTrue(logger.isInfoEnabled(), "Incorrect level");
+        assertTrue(logger.isEnabled(Level.INFO), "Incorrect level");
     }
 
     @Test
     public void isOffEnabled() {
-        assertTrue("Incorrect level", logger.isEnabled(Level.OFF));
+        assertTrue(logger.isEnabled(Level.OFF), "Incorrect level");
     }
 
     @Test
     public void isTraceEnabled() {
-        assertTrue("Incorrect level", logger.isTraceEnabled());
-        assertTrue("Incorrect level", logger.isEnabled(Level.TRACE));
+        assertTrue(logger.isTraceEnabled(), "Incorrect level");
+        assertTrue(logger.isEnabled(Level.TRACE), "Incorrect level");
     }
 
     @Test
     public void isWarnEnabled() {
-        assertTrue("Incorrect level", logger.isWarnEnabled());
-        assertTrue("Incorrect level", logger.isEnabled(Level.WARN));
+        assertTrue(logger.isWarnEnabled(), "Incorrect level");
+        assertTrue(logger.isEnabled(Level.WARN), "Incorrect level");
     }
 
     @Test
     public void isAllEnabledWithMarker() {
-        assertTrue("Incorrect level", logger.isEnabled(Level.ALL, marker));
+        assertTrue(logger.isEnabled(Level.ALL, marker), "Incorrect level");
     }
 
     @Test
     public void isDebugEnabledWithMarker() {
-        assertTrue("Incorrect level", logger.isDebugEnabled(marker));
-        assertTrue("Incorrect level", logger.isEnabled(Level.DEBUG, marker));
+        assertTrue(logger.isDebugEnabled(marker), "Incorrect level");
+        assertTrue(logger.isEnabled(Level.DEBUG, marker), "Incorrect level");
     }
 
     @Test
     public void isErrorEnabledWithMarker() {
-        assertTrue("Incorrect level", logger.isErrorEnabled(marker));
-        assertTrue("Incorrect level", logger.isEnabled(Level.ERROR, marker));
+        assertTrue(logger.isErrorEnabled(marker), "Incorrect level");
+        assertTrue(logger.isEnabled(Level.ERROR, marker), "Incorrect level");
     }
 
     @Test
     public void isFatalEnabledWithMarker() {
-        assertTrue("Incorrect level", logger.isFatalEnabled(marker));
-        assertTrue("Incorrect level", logger.isEnabled(Level.FATAL, marker));
+        assertTrue(logger.isFatalEnabled(marker), "Incorrect level");
+        assertTrue(logger.isEnabled(Level.FATAL, marker), "Incorrect level");
     }
 
     @Test
     public void isInfoEnabledWithMarker() {
-        assertTrue("Incorrect level", logger.isInfoEnabled(marker));
-        assertTrue("Incorrect level", logger.isEnabled(Level.INFO, marker));
+        assertTrue(logger.isInfoEnabled(marker), "Incorrect level");
+        assertTrue(logger.isEnabled(Level.INFO, marker), "Incorrect level");
     }
 
     @Test
     public void isOffEnabledWithMarker() {
-        assertTrue("Incorrect level", logger.isEnabled(Level.OFF, marker));
+        assertTrue(logger.isEnabled(Level.OFF, marker), "Incorrect level");
     }
 
     @Test
     public void isTraceEnabledWithMarker() {
-        assertTrue("Incorrect level", logger.isTraceEnabled(marker));
-        assertTrue("Incorrect level", logger.isEnabled(Level.TRACE, marker));
+        assertTrue(logger.isTraceEnabled(marker), "Incorrect level");
+        assertTrue(logger.isEnabled(Level.TRACE, marker), "Incorrect level");
     }
 
     @Test
     public void isWarnEnabledWithMarker() {
-        assertTrue("Incorrect level", logger.isWarnEnabled(marker));
-        assertTrue("Incorrect level", logger.isEnabled(Level.WARN, marker));
+        assertTrue(logger.isWarnEnabled(marker), "Incorrect level");
+        assertTrue(logger.isEnabled(Level.WARN, marker), "Incorrect level");
     }
 
     @Test
@@ -555,17 +552,17 @@ public class LoggerTest {
         ThreadContext.put("TestYear", Integer.valueOf(2010).toString());
         logger.debug("Debug message");
         final String testYear = ThreadContext.get("TestYear");
-        assertNotNull("Test Year is null", testYear);
-        assertEquals("Incorrect test year: " + testYear, "2010", testYear);
+        assertNotNull(testYear, "Test Year is null");
+        assertEquals("2010", testYear, "Incorrect test year: " + testYear);
         ThreadContext.clearMap();
         logger.debug("Debug message");
         assertEquals(2, results.size());
         System.out.println("Log line 1: " + results.get(0));
         System.out.println("log line 2: " + results.get(1));
-        assertTrue("Incorrect MDC: " + results.get(0),
-            results.get(0).startsWith(" DEBUG Debug message {TestYear=2010}"));
-        assertTrue("MDC not cleared?: " + results.get(1),
-            results.get(1).startsWith(" DEBUG Debug message"));
+        assertTrue(
+                results.get(0).startsWith(" DEBUG Debug message {TestYear=2010}"), "Incorrect MDC: " + results.get(0));
+        assertTrue(
+                results.get(1).startsWith(" DEBUG Debug message"), "MDC not cleared?: " + results.get(1));
     }
 
     @Test
@@ -577,7 +574,7 @@ public class LoggerTest {
         assertThat("Incorrect message", results.get(1), startsWith("Test DEBUG Debug message 2"));
     }
 
-    @Before
+    @BeforeEach
     public void setup() {
         results.clear();
     }
@@ -607,7 +604,7 @@ public class LoggerTest {
     }
 
 
-    private class Response {
+    private static class Response {
         int status;
         String message;
 
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/MarkerTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/MarkerTest.java
index 2874016..1b6f251 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/MarkerTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/MarkerTest.java
@@ -16,17 +16,14 @@
  */
 package org.apache.logging.log4j;
 
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
-/**
- *
- */
 public class MarkerTest {
 
-    @Before
+    @BeforeEach
     public void setUp() {
         MarkerManager.clear();
     }
@@ -62,8 +59,8 @@ public class MarkerTest {
         final Marker parent = MarkerManager.getMarker("PARENT");
         final Marker test1 = MarkerManager.getMarker("TEST1").setParents(parent);
         final Marker test2 = MarkerManager.getMarker("TEST2").addParents(parent);
-        assertTrue("TEST1 is not an instance of PARENT", test1.isInstanceOf(parent));
-        assertTrue("TEST2 is not an instance of PARENT", test2.isInstanceOf(parent));
+        assertTrue(test1.isInstanceOf(parent), "TEST1 is not an instance of PARENT");
+        assertTrue(test2.isInstanceOf(parent), "TEST2 is not an instance of PARENT");
     }
 
     @Test
@@ -72,10 +69,10 @@ public class MarkerTest {
         final Marker parent2 = MarkerManager.getMarker("PARENT2");
         final Marker test1 = MarkerManager.getMarker("TEST1").setParents(parent1, parent2);
         final Marker test2 = MarkerManager.getMarker("TEST2").addParents(parent1, parent2);
-        assertTrue("TEST1 is not an instance of PARENT1", test1.isInstanceOf(parent1));
-        assertTrue("TEST1 is not an instance of PARENT2", test1.isInstanceOf(parent2));
-        assertTrue("TEST2 is not an instance of PARENT1", test2.isInstanceOf(parent1));
-        assertTrue("TEST2 is not an instance of PARENT2", test2.isInstanceOf(parent2));
+        assertTrue(test1.isInstanceOf(parent1), "TEST1 is not an instance of PARENT1");
+        assertTrue(test1.isInstanceOf(parent2), "TEST1 is not an instance of PARENT2");
+        assertTrue(test2.isInstanceOf(parent1), "TEST2 is not an instance of PARENT1");
+        assertTrue(test2.isInstanceOf(parent2), "TEST2 is not an instance of PARENT2");
     }
 
     @Test
@@ -84,8 +81,8 @@ public class MarkerTest {
         final Marker existing = MarkerManager.getMarker("EXISTING");
         final Marker test1 = MarkerManager.getMarker("TEST1").setParents(existing);
         test1.addParents(parent);
-        assertTrue("TEST1 is not an instance of PARENT", test1.isInstanceOf(parent));
-        assertTrue("TEST1 is not an instance of EXISTING", test1.isInstanceOf(existing));
+        assertTrue(test1.isInstanceOf(parent), "TEST1 is not an instance of PARENT");
+        assertTrue(test1.isInstanceOf(existing), "TEST1 is not an instance of EXISTING");
     }
 
 
@@ -97,10 +94,10 @@ public class MarkerTest {
         test1.addParents(parent);
         final Marker[] parents = test1.getParents();
         test1.addParents(existing);
-        assertTrue("duplicate add allowed", parents.length == test1.getParents().length);
+        assertEquals(parents.length, test1.getParents().length, "duplicate add allowed");
         test1.addParents(existing, MarkerManager.getMarker("EXTRA"));
-        assertTrue("incorrect add", parents.length + 1 == test1.getParents().length);
-        assertTrue("TEST1 is not an instance of PARENT", test1.isInstanceOf(parent));
-        assertTrue("TEST1 is not an instance of EXISTING", test1.isInstanceOf(existing));
+        assertEquals(parents.length + 1, test1.getParents().length, "incorrect add");
+        assertTrue(test1.isInstanceOf(parent), "TEST1 is not an instance of PARENT");
+        assertTrue(test1.isInstanceOf(existing), "TEST1 is not an instance of EXISTING");
     }
 }
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/NoopThreadContextTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/NoopThreadContextTest.java
index f465224..992b13c 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/NoopThreadContextTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/NoopThreadContextTest.java
@@ -16,11 +16,11 @@
  */
 package org.apache.logging.log4j;
 
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 /**
  * Tests {@link ThreadContext}.
@@ -31,14 +31,14 @@ public class NoopThreadContextTest {
     private static final String PROPERY_KEY_ALL = "disableThreadContext";
     private static final String PROPERY_KEY_MAP = "disableThreadContextMap";
 
-    @BeforeClass
+    @BeforeAll
     public static void before() {
         System.setProperty(PROPERY_KEY_ALL, TRUE);
         System.setProperty(PROPERY_KEY_MAP, TRUE);
         ThreadContext.init();
     }
 
-    @AfterClass
+    @AfterAll
     public static void after() {
         System.clearProperty(PROPERY_KEY_ALL);
         System.clearProperty(PROPERY_KEY_MAP);
@@ -49,7 +49,7 @@ public class NoopThreadContextTest {
     public void testNoop() {
         ThreadContext.put("Test", "Test");
         final String value = ThreadContext.get("Test");
-        assertNull("value was saved", value);
+        assertNull(value, "value was saved");
     }
 
 
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/ThreadContextInheritanceTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/ThreadContextInheritanceTest.java
index 8b41ea6..5bcc1eb 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/ThreadContextInheritanceTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/ThreadContextInheritanceTest.java
@@ -16,33 +16,41 @@
  */
 package org.apache.logging.log4j;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import org.apache.logging.log4j.junit.ThreadContextRule;
 import org.apache.logging.log4j.spi.DefaultThreadContextMap;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests {@link ThreadContext}.
  */
 public class ThreadContextInheritanceTest {
 
-    @Rule
-    public ThreadContextRule threadContextRule = new ThreadContextRule();
+    private ThreadContextHolder threadContextHolder;
+
+    @BeforeEach
+    void clearThreadContext() {
+        threadContextHolder = new ThreadContextHolder(true, true);
+        ThreadContext.clearAll();
+    }
+
+    @AfterEach
+    void restoreThreadContext() {
+        threadContextHolder.restore();
+    }
 
-    @BeforeClass
+    @BeforeAll
     public static void setupClass() {
         System.setProperty(DefaultThreadContextMap.INHERITABLE_MAP, "true");
         ThreadContext.init();
     }
 
-    @AfterClass
+    @AfterAll
     public static void tearDownClass() {
         System.clearProperty(DefaultThreadContextMap.INHERITABLE_MAP);
         ThreadContext.init();
@@ -51,12 +59,10 @@ public class ThreadContextInheritanceTest {
     @Test
     public void testPush() {
         ThreadContext.push("Hello");
-        ThreadContext.push("{} is {}", ThreadContextInheritanceTest.class.getSimpleName(),
-                "running");
-        assertEquals("Incorrect parameterized stack value",
-                ThreadContext.pop(), "ThreadContextInheritanceTest is running");
-        assertEquals("Incorrect simple stack value", ThreadContext.pop(),
-                "Hello");
+        ThreadContext.push("{} is {}", ThreadContextInheritanceTest.class.getSimpleName(), "running");
+        assertEquals(
+                ThreadContext.pop(), "ThreadContextInheritanceTest is running", "Incorrect parameterized stack value");
+        assertEquals(ThreadContext.pop(), "Hello", "Incorrect simple stack value");
     }
 
     @Test
@@ -71,22 +77,21 @@ public class ThreadContextInheritanceTest {
             thread.start();
             thread.join();
             String str = sb.toString();
-            assertTrue("Unexpected ThreadContext value. Expected Hello. Actual "
-                    + str, "Hello".equals(str));
+            assertEquals("Hello", str, "Unexpected ThreadContext value. Expected Hello. Actual " + str);
             sb = new StringBuilder();
             thread = new TestThread(sb);
             thread.start();
             thread.join();
             str = sb.toString();
-            assertTrue("Unexpected ThreadContext value. Expected Hello. Actual "
-                    + str, "Hello".equals(str));
+            assertEquals("Hello", str, "Unexpected ThreadContext value. Expected Hello. Actual " + str);
         } finally {
             System.clearProperty(DefaultThreadContextMap.INHERITABLE_MAP);
         }
     }
 
     @Test
-    public void perfTest() throws Exception {
+    @Tag("performance")
+    public void perfTest() {
         ThreadContextUtilityClass.perfTest();
     }
 
@@ -105,12 +110,12 @@ public class ThreadContextInheritanceTest {
         ThreadContextUtilityClass.testGetImmutableContextReturnsEmptyMapIfEmpty();
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testGetImmutableContextReturnsImmutableMapIfNonEmpty() {
         ThreadContextUtilityClass.testGetImmutableContextReturnsImmutableMapIfNonEmpty();
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testGetImmutableContextReturnsImmutableMapIfEmpty() {
         ThreadContextUtilityClass.testGetImmutableContextReturnsImmutableMapIfEmpty();
     }
@@ -148,7 +153,7 @@ public class ThreadContextInheritanceTest {
         assertFalse(ThreadContext.containsKey("testKey"));
     }
 
-    private class TestThread extends Thread {
+    private static class TestThread extends Thread {
 
         private final StringBuilder sb;
 
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/ThreadContextTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/ThreadContextTest.java
index 63f21df..636b53d 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/ThreadContextTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/ThreadContextTest.java
@@ -20,32 +20,37 @@ import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.logging.log4j.junit.ThreadContextRule;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
-/**
- *
- */
 public class ThreadContextTest {
     public static void reinitThreadContext() {
         ThreadContext.init();
     }
 
-    @Rule
-    public ThreadContextRule threadContextRule = new ThreadContextRule();
+    private ThreadContextHolder threadContextHolder;
+
+    @BeforeEach
+    void clearThreadContext() {
+        threadContextHolder = new ThreadContextHolder(true, true);
+        ThreadContext.clearAll();
+    }
+
+    @AfterEach
+    void restoreThreadContext() {
+        threadContextHolder.restore();
+    }
 
     @Test
     public void testPush() {
         ThreadContext.push("Hello");
-        ThreadContext.push("{} is {}", ThreadContextTest.class.getSimpleName(),
-                "running");
-        assertEquals("Incorrect parameterized stack value",
-                ThreadContext.pop(), "ThreadContextTest is running");
-        assertEquals("Incorrect simple stack value", ThreadContext.pop(),
-                "Hello");
+        ThreadContext.push("{} is {}", ThreadContextTest.class.getSimpleName(), "running");
+        assertEquals(ThreadContext.pop(), "ThreadContextTest is running", "Incorrect parameterized stack value");
+        assertEquals(ThreadContext.pop(), "Hello", "Incorrect simple stack value");
     }
 
     @Test
@@ -56,19 +61,18 @@ public class ThreadContextTest {
         thread.start();
         thread.join();
         String str = sb.toString();
-        assertTrue("Unexpected ThreadContext value. Expected null. Actual "
-                + str, "null".equals(str));
+        assertEquals("null", str, "Unexpected ThreadContext value. Expected null. Actual " + str);
         sb = new StringBuilder();
         thread = new TestThread(sb);
         thread.start();
         thread.join();
         str = sb.toString();
-        assertTrue("Unexpected ThreadContext value. Expected null. Actual "
-                + str, "null".equals(str));
+        assertEquals("null", str, "Unexpected ThreadContext value. Expected null. Actual " + str);
     }
 
     @Test
-    public void perfTest() throws Exception {
+    @Tag("performance")
+    public void perfTest() {
         ThreadContextUtilityClass.perfTest();
     }
 
@@ -87,12 +91,12 @@ public class ThreadContextTest {
         ThreadContextUtilityClass.testGetImmutableContextReturnsEmptyMapIfEmpty();
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testGetImmutableContextReturnsImmutableMapIfNonEmpty() {
         ThreadContextUtilityClass.testGetImmutableContextReturnsImmutableMapIfNonEmpty();
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testGetImmutableContextReturnsImmutableMapIfEmpty() {
         ThreadContextUtilityClass.testGetImmutableContextReturnsImmutableMapIfEmpty();
     }
@@ -113,9 +117,9 @@ public class ThreadContextTest {
         assertNull(ThreadContext.get("testKey"));
         ThreadContext.put("testKey", "testValue");
         assertEquals("testValue", ThreadContext.get("testKey"));
-        assertEquals("Incorrect value in test key", "testValue", ThreadContext.get("testKey"));
+        assertEquals("testValue", ThreadContext.get("testKey"), "Incorrect value in test key");
         ThreadContext.putIfNull("testKey", "new Value");
-        assertEquals("Incorrect value in test key", "testValue", ThreadContext.get("testKey"));
+        assertEquals("testValue", ThreadContext.get("testKey"), "Incorrect value in test key");
         ThreadContext.clearMap();
     }
 
@@ -171,7 +175,7 @@ public class ThreadContextTest {
         assertFalse(ThreadContext.containsKey("testKey"));
     }
 
-    private class TestThread extends Thread {
+    private static class TestThread extends Thread {
 
         private final StringBuilder sb;
 
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/ThreadContextUtilityClass.java b/log4j-api/src/test/java/org/apache/logging/log4j/ThreadContextUtilityClass.java
index d695bb2..00d1786 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/ThreadContextUtilityClass.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/ThreadContextUtilityClass.java
@@ -16,17 +16,15 @@
  */
 package org.apache.logging.log4j;
 
-import java.util.Map;
-
 import org.apache.logging.log4j.util.Timer;
 
-import static org.junit.Assert.*;
-
+import java.util.Map;
 
+import static org.junit.jupiter.api.Assertions.*;
 
 public class ThreadContextUtilityClass {
 
-    public static void perfTest() throws Exception {
+    public static void perfTest() {
         ThreadContext.clearMap();
         final Timer complete = new Timer("ThreadContextTest");
         complete.start();
@@ -92,13 +90,13 @@ public class ThreadContextUtilityClass {
         ThreadContext.clearMap();
         ThreadContext.put("key", "val");
         final Map<String, String> immutable = ThreadContext.getImmutableContext();
-        immutable.put("otherkey", "otherval");
+        assertThrows(UnsupportedOperationException.class, () -> immutable.put("otherkey", "otherval"));
     }
 
     public static void testGetImmutableContextReturnsImmutableMapIfEmpty() {
         ThreadContext.clearMap();
         final Map<String, String> immutable = ThreadContext.getImmutableContext();
-        immutable.put("otherkey", "otherval");
+        assertThrows(UnsupportedOperationException.class, () -> immutable.put("otherkey", "otherval"));
     }
 
     public static void testGetImmutableStackReturnsEmptyStackIfEmpty() {
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/TraceLoggingTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/TraceLoggingTest.java
index 81a2ca1..82cc261 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/TraceLoggingTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/TraceLoggingTest.java
@@ -26,13 +26,10 @@ import org.apache.logging.log4j.message.ReusableParameterizedMessage;
 import org.apache.logging.log4j.message.ReusableParameterizedMessageTest;
 import org.apache.logging.log4j.message.SimpleMessage;
 import org.apache.logging.log4j.spi.AbstractLogger;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
-/**
- *
- */
 public class TraceLoggingTest extends AbstractLogger {
     static final StringBuilder CHAR_SEQ = new StringBuilder("CharSeq");
     private int charSeqCount;
@@ -221,7 +218,7 @@ public class TraceLoggingTest extends AbstractLogger {
 
     @Override
     public void logMessage(final String fqcn, final Level level, final Marker marker, final Message data, final Throwable t) {
-        assertTrue("Incorrect Level. Expected " + currentLevel + ", actual " + level, level.equals(currentLevel));
+        assertEquals(level, currentLevel, "Incorrect Level. Expected " + currentLevel + ", actual " + level);
         if (marker == null) {
             if (currentEvent.markerName != null) {
                 fail("Incorrect marker. Expected " + currentEvent.markerName + ", actual is null");
@@ -230,8 +227,9 @@ public class TraceLoggingTest extends AbstractLogger {
             if (currentEvent.markerName == null) {
                 fail("Incorrect marker. Expected null. Actual is " + marker.getName());
             } else {
-                assertTrue("Incorrect marker. Expected " + currentEvent.markerName + ", actual " +
-                    marker.getName(), currentEvent.markerName.equals(marker.getName()));
+                assertEquals(currentEvent.markerName, marker.getName(),
+                        "Incorrect marker. Expected " + currentEvent.markerName + ", actual " +
+                                marker.getName());
             }
         }
         if (data == null) {
@@ -242,11 +240,12 @@ public class TraceLoggingTest extends AbstractLogger {
             if (currentEvent.data == null) {
                 fail("Incorrect message. Expected null. Actual is " + data.getFormattedMessage());
             } else {
-                assertTrue("Incorrect message type. Expected " + currentEvent.data + ", actual " + data,
-                    data.getClass().isAssignableFrom(currentEvent.data.getClass()));
-                assertTrue("Incorrect message. Expected " + currentEvent.data.getFormattedMessage() + ", actual " +
-                    data.getFormattedMessage(),
-                    currentEvent.data.getFormattedMessage().equals(data.getFormattedMessage()));
+                assertTrue(
+                        data.getClass().isAssignableFrom(currentEvent.data.getClass()),
+                        "Incorrect message type. Expected " + currentEvent.data + ", actual " + data);
+                assertEquals(currentEvent.data.getFormattedMessage(), data.getFormattedMessage(),
+                        "Incorrect message. Expected " + currentEvent.data.getFormattedMessage() + ", actual " +
+                                data.getFormattedMessage());
             }
         }
         if (t == null) {
@@ -257,8 +256,7 @@ public class TraceLoggingTest extends AbstractLogger {
             if (currentEvent.t == null) {
                 fail("Incorrect Throwable. Expected null. Actual is " + t);
             } else {
-                assertTrue("Incorrect Throwable. Expected " + currentEvent.t + ", actual " + t,
-                    currentEvent.t.equals(t));
+                assertEquals(currentEvent.t, t, "Incorrect Throwable. Expected " + currentEvent.t + ", actual " + t);
             }
         }
     }
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/junit/LogManagerLoggerContextFactoryRule.java b/log4j-api/src/test/java/org/apache/logging/log4j/junit/LogManagerLoggerContextFactoryRule.java
index 98735ab..c7c157f 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/junit/LogManagerLoggerContextFactoryRule.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/junit/LogManagerLoggerContextFactoryRule.java
@@ -23,6 +23,8 @@ import org.junit.rules.ExternalResource;
 /**
  * Sets the {@link LogManager}'s {@link LoggerContextFactory} to the given instance before the test and restores it to
  * the original value after the test.
+ *
+ * @deprecated Use {@link LoggerContextFactoryExtension}
  */
 public class LogManagerLoggerContextFactoryRule extends ExternalResource {
 
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/junit/LogManagerLoggerContextFactoryRule.java b/log4j-api/src/test/java/org/apache/logging/log4j/junit/LoggerContextFactoryExtension.java
similarity index 51%
copy from log4j-api/src/test/java/org/apache/logging/log4j/junit/LogManagerLoggerContextFactoryRule.java
copy to log4j-api/src/test/java/org/apache/logging/log4j/junit/LoggerContextFactoryExtension.java
index 98735ab..9cb557a 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/junit/LogManagerLoggerContextFactoryRule.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/junit/LoggerContextFactoryExtension.java
@@ -14,36 +14,41 @@
  * See the license for the specific language governing permissions and
  * limitations under the license.
  */
+
 package org.apache.logging.log4j.junit;
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.spi.LoggerContextFactory;
-import org.junit.rules.ExternalResource;
+import org.junit.jupiter.api.extension.AfterAllCallback;
+import org.junit.jupiter.api.extension.BeforeAllCallback;
+import org.junit.jupiter.api.extension.ExtensionContext;
 
 /**
- * Sets the {@link LogManager}'s {@link LoggerContextFactory} to the given instance before the test and restores it to
- * the original value after the test.
+ * JUnit 5 extension that sets a particular {@link LoggerContextFactory} for the entire run of tests in a class.
+ *
+ * @since 3.0.0
  */
-public class LogManagerLoggerContextFactoryRule extends ExternalResource {
+public class LoggerContextFactoryExtension implements BeforeAllCallback, AfterAllCallback {
 
+    private static final String KEY = "previousFactory";
     private final LoggerContextFactory loggerContextFactory;
 
-    private LoggerContextFactory restoreLoggerContextFactory;
-
-    public LogManagerLoggerContextFactoryRule(final LoggerContextFactory loggerContextFactory) {
-        super();
+    public LoggerContextFactoryExtension(LoggerContextFactory loggerContextFactory) {
         this.loggerContextFactory = loggerContextFactory;
     }
 
     @Override
-    protected void after() {
-        LogManager.setFactory(this.restoreLoggerContextFactory);
+    public void beforeAll(ExtensionContext context) throws Exception {
+        getStore(context).put(KEY, LogManager.getFactory());
+        LogManager.setFactory(loggerContextFactory);
     }
 
     @Override
-    protected void before() throws Throwable {
-        this.restoreLoggerContextFactory = LogManager.getFactory();
-        LogManager.setFactory(this.loggerContextFactory);
+    public void afterAll(ExtensionContext context) throws Exception {
+        LogManager.setFactory(getStore(context).get(KEY, LoggerContextFactory.class));
     }
 
+    private ExtensionContext.Store getStore(ExtensionContext context) {
+        return context.getStore(ExtensionContext.Namespace.create(getClass(), context.getRequiredTestClass()));
+    }
 }
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/junit/StatusLoggerLevelExtension.java b/log4j-api/src/test/java/org/apache/logging/log4j/junit/StatusLoggerLevelExtension.java
new file mode 100644
index 0000000..f112652
--- /dev/null
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/junit/StatusLoggerLevelExtension.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.junit;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.status.StatusLogger;
+import org.junit.jupiter.api.extension.AfterEachCallback;
+import org.junit.jupiter.api.extension.BeforeEachCallback;
+import org.junit.jupiter.api.extension.ExtensionContext;
+
+/**
+ * JUnit 5 test extension that sets a specific StatusLogger logging level for each test.
+ *
+ * @since 3.0.0
+ */
+public class StatusLoggerLevelExtension implements BeforeEachCallback, AfterEachCallback {
+
+    private static final String KEY = "previousLevel";
+    private final Level level;
+
+    public StatusLoggerLevelExtension(Level level) {
+        this.level = level;
+    }
+
+    @Override
+    public void beforeEach(ExtensionContext context) throws Exception {
+        final StatusLogger logger = StatusLogger.getLogger();
+        getStore(context).put(KEY, logger.getLevel());
+        logger.setLevel(level);
+    }
+
+    @Override
+    public void afterEach(ExtensionContext context) throws Exception {
+        StatusLogger.getLogger().setLevel(getStore(context).get(KEY, Level.class));
+    }
+
+    private ExtensionContext.Store getStore(ExtensionContext context) {
+        return context.getStore(ExtensionContext.Namespace
+                .create(getClass(), context.getRequiredTestInstance(), context.getRequiredTestMethod()));
+    }
+}
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/junit/StatusLoggerRule.java b/log4j-api/src/test/java/org/apache/logging/log4j/junit/StatusLoggerRule.java
index 11f945a..a424933 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/junit/StatusLoggerRule.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/junit/StatusLoggerRule.java
@@ -25,6 +25,7 @@ import org.junit.rules.ExternalResource;
  * Log4j configuration file.
  *
  * @since 2.8
+ * @deprecated Use {@link StatusLoggerLevelExtension}
  */
 public class StatusLoggerRule extends ExternalResource {
 
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/simple/SimpleLoggerTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/simple/SimpleLoggerTest.java
index 0d57e5e..ac42497 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/simple/SimpleLoggerTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/simple/SimpleLoggerTest.java
@@ -18,15 +18,17 @@ package org.apache.logging.log4j.simple;
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.junit.LogManagerLoggerContextFactoryRule;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.apache.logging.log4j.junit.LoggerContextFactoryExtension;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 
+@Tag("smoke")
 public class SimpleLoggerTest {
 
-    @ClassRule
-    public static final LogManagerLoggerContextFactoryRule rule = new LogManagerLoggerContextFactoryRule(
-            new SimpleLoggerContextFactory());
+    @RegisterExtension
+    public static final LoggerContextFactoryExtension EXTENSION =
+            new LoggerContextFactoryExtension(new SimpleLoggerContextFactory());
 
     private final Logger logger = LogManager.getLogger("TestError");
 
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/spi/DefaultThreadContextMapTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/spi/DefaultThreadContextMapTest.java
index e783e1b..a894293 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/spi/DefaultThreadContextMapTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/spi/DefaultThreadContextMapTest.java
@@ -16,15 +16,12 @@
  */
 package org.apache.logging.log4j.spi;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import org.junit.jupiter.api.Test;
 
 import java.util.HashMap;
 import java.util.Map;
 
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests the {@code DefaultThreadContextMap} class.
@@ -171,7 +168,7 @@ public class DefaultThreadContextMapTest {
         assertNull(map.getImmutableMapOrNull());
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testGetImmutableMapReturnsImmutableMapIfNonEmpty() {
         final DefaultThreadContextMap map = new DefaultThreadContextMap(true);
         map.put("key1", "value1");
@@ -181,7 +178,7 @@ public class DefaultThreadContextMapTest {
         assertEquals("value1", immutable.get("key1")); // copy has values too
 
         // immutable
-        immutable.put("key", "value"); // error
+        assertThrows(UnsupportedOperationException.class, () -> immutable.put("key", "value"));
     }
 
     @Test
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/spi/DefaultThreadContextStackTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/spi/DefaultThreadContextStackTest.java
index 2c893aa..be6ebe3 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/spi/DefaultThreadContextStackTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/spi/DefaultThreadContextStackTest.java
@@ -17,17 +17,18 @@
 package org.apache.logging.log4j.spi;
 
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.Iterator;
 
 import org.apache.logging.log4j.ThreadContext.ContextStack;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 public class DefaultThreadContextStackTest {
 
-    @Before
+    @BeforeEach
     public void before() {
         // clear the thread-local map
         new DefaultThreadContextMap(true).clear();
@@ -45,8 +46,8 @@ public class DefaultThreadContextStackTest {
 
     @Test
     public void testEqualsVsMutable() {
-        final DefaultThreadContextStack stack1 = createStack();
-        final MutableThreadContextStack stack2 = MutableThreadContextStackTest.createStack();
+        final ThreadContextStack stack1 = createStack();
+        final ThreadContextStack stack2 = MutableThreadContextStackTest.createStack();
         assertEquals(stack1, stack1);
         assertEquals(stack2, stack2);
         assertEquals(stack1, stack2);
@@ -64,7 +65,7 @@ public class DefaultThreadContextStackTest {
     public void testImmutableOrNullReturnsNullIfUseStackIsFalse() {
         final DefaultThreadContextStack stack = new DefaultThreadContextStack(false);
         stack.clear();
-        assertEquals(null, stack.getImmutableStackOrNull());
+        assertNull(stack.getImmutableStackOrNull());
     }
 
     @Test
@@ -72,19 +73,19 @@ public class DefaultThreadContextStackTest {
         final DefaultThreadContextStack stack = new DefaultThreadContextStack(true);
         stack.clear();
         assertTrue(stack.isEmpty());
-        assertEquals(null, stack.getImmutableStackOrNull());
+        assertNull(stack.getImmutableStackOrNull());
     }
 
     @Test
     public void testImmutableOrNullReturnsCopyOfContents() {
         final DefaultThreadContextStack stack = createStack();
-        assertTrue(!stack.isEmpty());
+        assertFalse(stack.isEmpty());
         final ContextStack actual = stack.getImmutableStackOrNull();
         assertNotNull(actual);
         assertEquals(stack, actual);
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test //(expected = UnsupportedOperationException.class)
     public void testModifyingImmutableOrNullThrowsException() {
         final DefaultThreadContextStack stack = createStack();
         final int originalSize = stack.size();
@@ -92,7 +93,7 @@ public class DefaultThreadContextStackTest {
         final ContextStack actual = stack.getImmutableStackOrNull();
         assertEquals(originalSize, actual.size());
 
-        actual.pop();
+        assertThrows(UnsupportedOperationException.class, () -> actual.pop());
     }
 
     @Test
@@ -277,7 +278,7 @@ public class DefaultThreadContextStackTest {
 
         stack.remove("msg3");
         assertEquals(1, stack.size());
-        assertTrue(stack.containsAll(Arrays.asList("msg2")));
+        assertTrue(stack.containsAll(Collections.singletonList("msg2")));
         assertEquals("msg2", stack.peek());
     }
 
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/spi/LoggerAdapterTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/spi/LoggerAdapterTest.java
index b2beb1d..a69ac6a 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/spi/LoggerAdapterTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/spi/LoggerAdapterTest.java
@@ -21,7 +21,7 @@ import org.apache.logging.log4j.TestLogger;
 import org.apache.logging.log4j.TestLoggerContext;
 import org.apache.logging.log4j.TestLoggerContextFactory;
 import org.apache.logging.log4j.simple.SimpleLoggerContext;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.util.HashSet;
 import java.util.Map;
@@ -29,15 +29,14 @@ import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.CountDownLatch;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Created by Pavel.Sivolobtchik@uxpsystems.com on 2016-10-19.
  */
 public class LoggerAdapterTest {
 
-    private class RunnableThreadTest implements Runnable {
+    private static class RunnableThreadTest implements Runnable {
         private final AbstractLoggerAdapter<Logger> adapter;
         private final LoggerContext context;
         private final CountDownLatch doneSignal;
@@ -138,12 +137,12 @@ public class LoggerAdapterTest {
             LoggerContext lc = adapter.getContext(Integer.toString(i));
             lc.getLogger(Integer.toString(i));
         }
-        assertEquals("Expected 5 LoggerContexts", 5, adapter.registry.size());
+        assertEquals(5, adapter.registry.size(), "Expected 5 LoggerContexts");
         Set<LoggerContext> contexts = new HashSet<>(adapter.registry.keySet());
         for (LoggerContext context : contexts) {
             ((TestLoggerContext2) context).shutdown();
         }
-        assertEquals("Expected 0 LoggerContexts", 0, adapter.registry.size());
+        assertEquals(0, adapter.registry.size(), "Expected 0 LoggerContexts");
     }
 
 
@@ -180,7 +179,7 @@ public class LoggerAdapterTest {
             //maps for the same context should be the same instance
             final Map<String, Logger> resultMap1 = instances[i].getResultMap();
             final Map<String, Logger> resultMap2 = instances[i + 1].getResultMap();
-            assertSame("not the same map for instances" + i + " and " + (i + 1) + ":", resultMap1, resultMap2);
+            assertSame(resultMap1, resultMap2, "not the same map for instances" + i + " and " + (i + 1) + ":");
             assertEquals(2, resultMap1.size());
         }
     }
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/spi/MutableThreadContextStackTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/spi/MutableThreadContextStackTest.java
index 7592067..4a4a428 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/spi/MutableThreadContextStackTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/spi/MutableThreadContextStackTest.java
@@ -16,20 +16,20 @@
  */
 package org.apache.logging.log4j.spi;
 
+import org.junit.jupiter.api.Test;
+
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
 
-import org.junit.Test;
-
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 public class MutableThreadContextStackTest {
 
     @Test
     public void testEmptyIfConstructedWithEmptyList() {
-        final MutableThreadContextStack stack = new MutableThreadContextStack(new ArrayList<String>());
+        final MutableThreadContextStack stack = new MutableThreadContextStack(new ArrayList<>());
         assertTrue(stack.isEmpty());
     }
 
@@ -43,7 +43,7 @@ public class MutableThreadContextStackTest {
 
     @Test
     public void testPushAndAddIncreaseStack() {
-        final MutableThreadContextStack stack = new MutableThreadContextStack(new ArrayList<String>());
+        final MutableThreadContextStack stack = new MutableThreadContextStack(new ArrayList<>());
         stack.clear();
         assertTrue(stack.isEmpty());
         stack.push("msg1");
@@ -54,7 +54,7 @@ public class MutableThreadContextStackTest {
 
     @Test
     public void testPeekReturnsLastAddedItem() {
-        final MutableThreadContextStack stack = new MutableThreadContextStack(new ArrayList<String>());
+        final MutableThreadContextStack stack = new MutableThreadContextStack(new ArrayList<>());
         stack.clear();
         assertTrue(stack.isEmpty());
         stack.push("msg1");
@@ -87,7 +87,7 @@ public class MutableThreadContextStackTest {
 
     @Test
     public void testAsList() {
-        final MutableThreadContextStack stack = new MutableThreadContextStack(new ArrayList<String>());
+        final MutableThreadContextStack stack = new MutableThreadContextStack(new ArrayList<>());
         stack.clear();
         assertTrue(stack.isEmpty());
         stack.push("msg1");
@@ -165,7 +165,7 @@ public class MutableThreadContextStackTest {
      * @return
      */
     static MutableThreadContextStack createStack() {
-        final MutableThreadContextStack stack1 = new MutableThreadContextStack(new ArrayList<String>());
+        final MutableThreadContextStack stack1 = new MutableThreadContextStack(new ArrayList<>());
         stack1.clear();
         assertTrue(stack1.isEmpty());
         stack1.push("msg1");
@@ -228,7 +228,7 @@ public class MutableThreadContextStackTest {
 
         stack.remove("msg3");
         assertEquals(1, stack.size());
-        assertTrue(stack.containsAll(Arrays.asList("msg2")));
+        assertTrue(stack.contains("msg2"));
         assertEquals("msg2", stack.peek());
     }
 
@@ -276,7 +276,7 @@ public class MutableThreadContextStackTest {
 
     @Test
     public void testToStringShowsListContents() {
-        final MutableThreadContextStack stack = new MutableThreadContextStack(new ArrayList<String>());
+        final MutableThreadContextStack stack = new MutableThreadContextStack(new ArrayList<>());
         assertEquals("[]", stack.toString());
 
         stack.push("msg1");
@@ -302,66 +302,66 @@ public class MutableThreadContextStackTest {
         assertTrue(stack.isFrozen());
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testAddAllOnFrozenStackThrowsException() {
         final MutableThreadContextStack stack = new MutableThreadContextStack();
         stack.freeze();
-        stack.addAll(Arrays.asList("a", "b", "c"));
+        assertThrows(UnsupportedOperationException.class, () -> stack.addAll(Arrays.asList("a", "b", "c")));
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testAddOnFrozenStackThrowsException() {
         final MutableThreadContextStack stack = new MutableThreadContextStack();
         stack.freeze();
-        stack.add("a");
+        assertThrows(UnsupportedOperationException.class, () -> stack.add("a"));
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testClearOnFrozenStackThrowsException() {
         final MutableThreadContextStack stack = new MutableThreadContextStack();
         stack.freeze();
-        stack.clear();
+        assertThrows(UnsupportedOperationException.class, stack::clear);
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testPopOnFrozenStackThrowsException() {
         final MutableThreadContextStack stack = new MutableThreadContextStack();
         stack.freeze();
-        stack.pop();
+        assertThrows(UnsupportedOperationException.class, stack::pop);
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testPushOnFrozenStackThrowsException() {
         final MutableThreadContextStack stack = new MutableThreadContextStack();
         stack.freeze();
-        stack.push("a");
+        assertThrows(UnsupportedOperationException.class, () -> stack.push("a"));
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testRemoveOnFrozenStackThrowsException() {
         final MutableThreadContextStack stack = new MutableThreadContextStack();
         stack.freeze();
-        stack.remove("a");
+        assertThrows(UnsupportedOperationException.class, () -> stack.remove("a"));
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testRemoveAllOnFrozenStackThrowsException() {
         final MutableThreadContextStack stack = new MutableThreadContextStack();
         stack.freeze();
-        stack.removeAll(Arrays.asList("a", "b"));
+        assertThrows(UnsupportedOperationException.class, () -> stack.removeAll(Arrays.asList("a", "b")));
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testRetainAllOnFrozenStackThrowsException() {
         final MutableThreadContextStack stack = new MutableThreadContextStack();
         stack.freeze();
-        stack.retainAll(Arrays.asList("a", "b"));
+        assertThrows(UnsupportedOperationException.class, () -> stack.retainAll(Arrays.asList("a", "b")));
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testTrimOnFrozenStackThrowsException() {
         final MutableThreadContextStack stack = new MutableThreadContextStack();
         stack.freeze();
-        stack.trim(3);
+        assertThrows(UnsupportedOperationException.class, () -> stack.trim(3));
     }
 }
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/CharsTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/CharsTest.java
index d1447f2..0288218 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/CharsTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/CharsTest.java
@@ -16,31 +16,31 @@
  */
 package org.apache.logging.log4j.util;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
 
-import static org.junit.Assert.assertEquals;
+import java.util.stream.IntStream;
+
+import static org.junit.jupiter.api.Assertions.*;
 
-/**
- *
- */
 public class CharsTest {
-    @Test
-    public void invalidDigitReturnsNullCharacter() throws Exception {
-        assertEquals('\0', Chars.getUpperCaseHex(-1));
-        assertEquals('\0', Chars.getUpperCaseHex(16));
-        assertEquals('\0', Chars.getUpperCaseHex(400));
-        assertEquals('\0', Chars.getLowerCaseHex(-1));
-        assertEquals('\0', Chars.getLowerCaseHex(16));
-        assertEquals('\0', Chars.getLowerCaseHex(400));
+    @ParameterizedTest
+    @ValueSource(ints = {-1, 16, 400, -1, 16, 400})
+    public void invalidDigitReturnsNullCharacter(int invalidDigit) {
+        assertAll(
+                () -> assertEquals('\0', Chars.getUpperCaseHex(invalidDigit)),
+                () -> assertEquals('\0', Chars.getLowerCaseHex(invalidDigit))
+        );
     }
 
     @Test
-    public void validDigitReturnsProperCharacter() throws Exception {
+    public void validDigitReturnsProperCharacter() {
         final char[] expectedLower = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
         final char[] expectedUpper = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
-        for (int i = 0; i < 16; i++) {
-            assertEquals(String.format("Expected %x", i), expectedLower[i], Chars.getLowerCaseHex(i));
-            assertEquals(String.format("Expected %X", i), expectedUpper[i], Chars.getUpperCaseHex(i));
-        }
+        assertAll(IntStream.range(0, 16).mapToObj(i -> () -> assertAll(
+                () -> assertEquals(expectedLower[i], Chars.getLowerCaseHex(i), String.format("Expected %x", i)),
+                () -> assertEquals(expectedUpper[i], Chars.getUpperCaseHex(i), String.format("Expected %X", i))
+        )));
     }
 }
\ No newline at end of file
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/ConstantsTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/ConstantsTest.java
index ef2a5b9..050b2bd 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/ConstantsTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/ConstantsTest.java
@@ -16,9 +16,9 @@
  */
 package org.apache.logging.log4j.util;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 public class ConstantsTest {
 
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/EnvironmentPropertySourceTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/EnvironmentPropertySourceTest.java
index 3beea89..045c595 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/EnvironmentPropertySourceTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/EnvironmentPropertySourceTest.java
@@ -20,28 +20,15 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-/**
- *
- */
-@RunWith(Parameterized.class)
 public class EnvironmentPropertySourceTest {
 
     private final PropertySource source = new EnvironmentPropertySource();
-    private final CharSequence expected;
-    private final List<? extends CharSequence> tokens;
-
-    public EnvironmentPropertySourceTest(final CharSequence expected, final List<? extends CharSequence> tokens) {
-        this.expected = expected;
-        this.tokens = tokens;
-    }
 
-    @Parameterized.Parameters(name = "{0}")
     public static Object[][] data() {
         return new Object[][]{
             {"LOG4J_CONFIGURATION_FILE", Arrays.asList("configuration", "file")},
@@ -51,8 +38,9 @@ public class EnvironmentPropertySourceTest {
         };
     }
 
-    @Test
-    public void testNormalFormFollowsEnvironmentVariableConventions() throws Exception {
+    @ParameterizedTest
+    @MethodSource("data")
+    public void testNormalFormFollowsEnvironmentVariableConventions(CharSequence expected, List<? extends CharSequence> tokens) {
         assertEquals(expected, source.getNormalForm(tokens));
     }
 }
\ No newline at end of file
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/LambdaUtilTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/LambdaUtilTest.java
index 1972e14..a4671ca 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/LambdaUtilTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/LambdaUtilTest.java
@@ -19,9 +19,9 @@ package org.apache.logging.log4j.util;
 
 import org.apache.logging.log4j.message.Message;
 import org.apache.logging.log4j.message.SimpleMessage;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests the LambdaUtil class.
@@ -31,24 +31,14 @@ public class LambdaUtilTest {
     @Test
     public void testGetSupplierResultOfSupplier() {
         final String expected = "result";
-        final Object actual = LambdaUtil.get(new Supplier<String>() {
-            @Override
-            public String get() {
-                return expected;
-            }
-        });
+        final Object actual = LambdaUtil.get((Supplier<String>) () -> expected);
         assertSame(expected, actual);
     }
 
     @Test
     public void testGetMessageSupplierResultOfSupplier() {
         final Message expected = new SimpleMessage("hi");
-        final Message actual = LambdaUtil.get(new MessageSupplier() {
-            @Override
-            public Message get() {
-                return expected;
-            }
-        });
+        final Message actual = LambdaUtil.get(() -> expected);
         assertSame(expected, actual);
     }
 
@@ -64,42 +54,26 @@ public class LambdaUtilTest {
         assertNull(actual);
     }
 
-    @Test(expected = RuntimeException.class)
+    @Test
     public void testGetSupplierExceptionIfSupplierThrowsException() {
-        LambdaUtil.get(new Supplier<String>() {
-            @Override
-            public String get() {
-                throw new RuntimeException();
-            }
-        });
+        assertThrows(RuntimeException.class, () -> LambdaUtil.get((Supplier<String>) () -> {
+            throw new RuntimeException();
+        }));
     }
 
-    @Test(expected = RuntimeException.class)
+    @Test
     public void testGetMessageSupplierExceptionIfSupplierThrowsException() {
-        LambdaUtil.get(new MessageSupplier() {
-            @Override
-            public Message get() {
-                throw new RuntimeException();
-            }
-        });
+        assertThrows(RuntimeException.class, () -> LambdaUtil.get(() -> {
+            throw new RuntimeException();
+        }));
     }
 
     @Test
     public void testGetAllReturnsResultOfSuppliers() {
         final String expected1 = "result1";
-        final Supplier<String> function1 = new Supplier<String>() {
-            @Override
-            public String get() {
-                return expected1;
-            }
-        };
+        final Supplier<String> function1 = () -> expected1;
         final String expected2 = "result2";
-        final Supplier<String> function2 = new Supplier<String>() {
-            @Override
-            public String get() {
-                return expected2;
-            }
-        };
+        final Supplier<String> function2 = () -> expected2;
 
         final Supplier<?>[] functions = { function1, function2 };
         final Object[] actual = LambdaUtil.getAll(functions);
@@ -124,22 +98,14 @@ public class LambdaUtilTest {
         }
     }
 
-    @Test(expected = RuntimeException.class)
+    @Test
     public void testGetAllThrowsExceptionIfAnyOfTheSuppliersThrowsException() {
-        final Supplier<String> function1 = new Supplier<String>() {
-            @Override
-            public String get() {
-                return "abc";
-            }
-        };
-        final Supplier<String> function2 = new Supplier<String>() {
-            @Override
-            public String get() {
-                throw new RuntimeException();
-            }
+        final Supplier<String> function1 = () -> "abc";
+        final Supplier<String> function2 = () -> {
+            throw new RuntimeException();
         };
 
         final Supplier<?>[] functions = { function1, function2 };
-        LambdaUtil.getAll(functions);
+        assertThrows(RuntimeException.class, () -> LambdaUtil.getAll(functions));
     }
 }
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/LegacyPropertiesCompatibilityTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/LegacyPropertiesCompatibilityTest.java
index 2d60fbd..89b6011 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/LegacyPropertiesCompatibilityTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/LegacyPropertiesCompatibilityTest.java
@@ -16,26 +16,15 @@
  */
 package org.apache.logging.log4j.util;
 
-import java.util.List;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
 
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
+import java.util.List;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-@RunWith(Parameterized.class)
 public class LegacyPropertiesCompatibilityTest {
 
-    private final CharSequence newName;
-    private final CharSequence oldName;
-
-    public LegacyPropertiesCompatibilityTest(final CharSequence newName, final CharSequence oldName) {
-        this.newName = newName;
-        this.oldName = oldName;
-    }
-
-    @Parameterized.Parameters(name = "New: {0}; Old: {1}")
     public static Object[][] data() {
         return new Object[][]{
             {"log4j2.configurationFile", "log4j.configurationFile"},
@@ -94,8 +83,9 @@ public class LegacyPropertiesCompatibilityTest {
         };
     }
 
-    @Test
-    public void compareNewWithOldName() throws Exception {
+    @ParameterizedTest
+    @MethodSource("data")
+    public void compareNewWithOldName(final String newName, final String oldName) {
         final List<CharSequence> newTokens = PropertySource.Util.tokenize(newName);
         final List<CharSequence> oldTokens = PropertySource.Util.tokenize(oldName);
         assertEquals(oldTokens, newTokens);
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/Log4jCharsetsPropertiesTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/Log4jCharsetsPropertiesTest.java
index 916521b..4c71bab 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/Log4jCharsetsPropertiesTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/Log4jCharsetsPropertiesTest.java
@@ -17,12 +17,14 @@
 
 package org.apache.logging.log4j.util;
 
+import org.junit.jupiter.api.Test;
+
 import java.nio.charset.Charset;
 import java.util.Enumeration;
 import java.util.ResourceBundle;
 
-import org.junit.Assert;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class Log4jCharsetsPropertiesTest {
 
@@ -31,15 +33,16 @@ public class Log4jCharsetsPropertiesTest {
      */
     @Test
     public void testLoadAll() {
-        final ResourceBundle resourceBundle = PropertiesUtil.getCharsetsResourceBundle();
-        final Enumeration<String> keys = resourceBundle.getKeys();
+        ResourceBundle resourceBundle = PropertiesUtil.getCharsetsResourceBundle();
+        Enumeration<String> keys = resourceBundle.getKeys();
         while (keys.hasMoreElements()) {
-            final String key = keys.nextElement();
-            Assert.assertFalse(String.format("The Charset %s is available and should not be mapped", key),
-                    Charset.isSupported(key));
-            final String value = resourceBundle.getString(key);
-            Assert.assertTrue(String.format("The Charset %s is is not available and is mapped from %s", value, key),
-                    Charset.isSupported(value));
+            String key = keys.nextElement();
+            assertFalse(
+                    Charset.isSupported(key), String.format("The Charset %s is available and should not be mapped", key));
+            String value = resourceBundle.getString(key);
+            assertTrue(
+                    Charset.isSupported(value),
+                    String.format("The Charset %s is is not available and is mapped from %s", value, key));
         }
     }
 }
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertiesPropertySourceTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertiesPropertySourceTest.java
index c1c97ef..41b0287 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertiesPropertySourceTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertiesPropertySourceTest.java
@@ -16,30 +16,20 @@
  */
 package org.apache.logging.log4j.util;
 
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
+
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.Properties;
 
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-
 import static org.junit.Assert.assertEquals;
 
-@RunWith(Parameterized.class)
 public class PropertiesPropertySourceTest {
 
     private final PropertySource source = new PropertiesPropertySource(new Properties());
-    private final CharSequence expected;
-    private final List<? extends CharSequence> tokens;
-
-    public PropertiesPropertySourceTest(final String expected, final List<CharSequence> tokens) {
-        this.expected = expected;
-        this.tokens = tokens;
-    }
 
-    @Parameterized.Parameters(name = "{0}")
     public static Object[][] data() {
         return new Object[][]{
             {"log4j2.configurationFile", Arrays.asList("configuration", "file")},
@@ -49,8 +39,9 @@ public class PropertiesPropertySourceTest {
         };
     }
 
-    @Test
-    public void testNormalFormFollowsCamelCaseConventions() throws Exception {
+    @ParameterizedTest
+    @MethodSource("data")
+    public void testNormalFormFollowsCamelCaseConventions(final String expected, final List<CharSequence> tokens) {
         assertEquals(expected, source.getNormalForm(tokens));
     }
 }
\ No newline at end of file
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertiesUtilTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertiesUtilTest.java
index a5dc873..617487e 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertiesUtilTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertiesUtilTest.java
@@ -17,32 +17,27 @@
 
 package org.apache.logging.log4j.util;
 
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 import java.util.Map;
 import java.util.Properties;
 
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.*;
 
-/**
- *
- */
 public class PropertiesUtilTest {
 
     private final Properties properties = new Properties();
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         properties.load(ClassLoader.getSystemResourceAsStream("PropertiesUtilTest.properties"));
     }
 
     @Test
-    public void testExtractSubset() throws Exception {
+    public void testExtractSubset() {
         assertHasAllProperties(PropertiesUtil.extractSubset(properties, "a"));
         assertHasAllProperties(PropertiesUtil.extractSubset(properties, "b."));
         assertHasAllProperties(PropertiesUtil.extractSubset(properties, "c.1"));
@@ -51,7 +46,7 @@ public class PropertiesUtilTest {
     }
 
     @Test
-    public void testPartitionOnCommonPrefix() throws Exception {
+    public void testPartitionOnCommonPrefix() {
         final Map<String, Properties> parts = PropertiesUtil.partitionOnCommonPrefixes(properties);
         assertEquals(4, parts.size());
         assertHasAllProperties(parts.get("a"));
@@ -69,7 +64,7 @@ public class PropertiesUtilTest {
 
 
     @Test
-    public void testGetCharsetProperty() throws Exception {
+    public void testGetCharsetProperty() {
         final Properties p = new Properties();
         p.setProperty("e.1", StandardCharsets.US_ASCII.name());
         p.setProperty("e.2", "wrong-charset-name");
@@ -83,21 +78,21 @@ public class PropertiesUtilTest {
     @Test
     public void testGetMappedProperty_sun_stdout_encoding() {
         final PropertiesUtil pu = new PropertiesUtil(System.getProperties());
-        final Charset expected = System.console() == null ? Charset.defaultCharset() : StandardCharsets.UTF_8;
+        Charset expected = System.console() == null ? Charset.defaultCharset() : StandardCharsets.UTF_8;
         assertEquals(expected, pu.getCharsetProperty("sun.stdout.encoding"));
     }
 
     @Test
     public void testGetMappedProperty_sun_stderr_encoding() {
         final PropertiesUtil pu = new PropertiesUtil(System.getProperties());
-        final Charset expected = System.console() == null ? Charset.defaultCharset() : StandardCharsets.UTF_8;
+        Charset expected = System.console() == null ? Charset.defaultCharset() : StandardCharsets.UTF_8;
         assertEquals(expected, pu.getCharsetProperty("sun.err.encoding"));
     }
 
     @Test
     public void testNonStringSystemProperties() {
-        final Object key1 = "1";
-        final Object key2 = new Object();
+        Object key1 = "1";
+        Object key2 = new Object();
         System.getProperties().put(key1, new Object());
         System.getProperties().put(key2, "value-2");
         try {
@@ -114,7 +109,7 @@ public class PropertiesUtilTest {
         final Properties props = new Properties();
         final PropertiesUtil util = new PropertiesUtil(props);
         String value = System.getProperty("Application");
-        assertNotNull("System property was not published", value);
+        assertNotNull(value, "System property was not published");
         assertEquals("Log4j", value);
     }
 }
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertySourceCamelCaseTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertySourceCamelCaseTest.java
index a197085..f4af123 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertySourceCamelCaseTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertySourceCamelCaseTest.java
@@ -16,28 +16,17 @@
  */
 package org.apache.logging.log4j.util;
 
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
+
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-@RunWith(Parameterized.class)
 public class PropertySourceCamelCaseTest {
 
-    private final CharSequence expected;
-    private final List<String> tokens;
-
-    public PropertySourceCamelCaseTest(final CharSequence expected, final List<String> tokens) {
-        this.expected = expected;
-        this.tokens = tokens;
-    }
-
-    @Parameterized.Parameters(name = "{0}")
     public static Object[][] data() {
         return new Object[][]{
             {"", Collections.singletonList("")},
@@ -47,8 +36,9 @@ public class PropertySourceCamelCaseTest {
         };
     }
 
-    @Test
-    public void testJoinAsCamelCase() throws Exception {
+    @ParameterizedTest
+    @MethodSource("data")
+    public void testJoinAsCamelCase(final CharSequence expected, final List<String> tokens) {
         assertEquals(expected, PropertySource.Util.joinAsCamelCase(tokens));
     }
 }
\ No newline at end of file
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertySourceTokenizerTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertySourceTokenizerTest.java
index 38afa0f..f73c402 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertySourceTokenizerTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/PropertySourceTokenizerTest.java
@@ -16,28 +16,17 @@
  */
 package org.apache.logging.log4j.util;
 
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
+
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-@RunWith(Parameterized.class)
 public class PropertySourceTokenizerTest {
 
-    private final CharSequence value;
-    private final List<CharSequence> expectedTokens;
-
-    public PropertySourceTokenizerTest(final CharSequence value, final List<CharSequence> expectedTokens) {
-        this.value = value;
-        this.expectedTokens = expectedTokens;
-    }
-
-    @Parameterized.Parameters(name = "{0}")
     public static Object[][] data() {
         return new Object[][]{
             {"log4j.simple", Collections.singletonList("simple")},
@@ -58,9 +47,10 @@ public class PropertySourceTokenizerTest {
         };
     }
 
-    @Test
-    public void testTokenize() throws Exception {
-        final List<CharSequence> tokens = PropertySource.Util.tokenize(value);
+    @ParameterizedTest
+    @MethodSource("data")
+    public void testTokenize(final CharSequence value, final List<CharSequence> expectedTokens) {
+        List<CharSequence> tokens = PropertySource.Util.tokenize(value);
         assertEquals(expectedTokens, tokens);
     }
-}
\ No newline at end of file
+}
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/ProviderUtilTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/ProviderUtilTest.java
index 6c03f81..075363e 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/ProviderUtilTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/ProviderUtilTest.java
@@ -16,16 +16,16 @@
  */
 package org.apache.logging.log4j.util;
 
-import java.io.File;
-import java.net.URL;
-import java.net.URLClassLoader;
-
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.TestLoggerContext;
 import org.apache.logging.log4j.spi.LoggerContext;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import java.io.File;
+import java.net.URL;
+import java.net.URLClassLoader;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class ProviderUtilTest {
 
@@ -37,10 +37,10 @@ public class ProviderUtilTest {
         worker.setContextClassLoader(classLoader);
         worker.start();
         worker.join();
-        assertTrue("Incorrect LoggerContext", worker.context instanceof TestLoggerContext);
+        assertTrue(worker.context instanceof TestLoggerContext, "Incorrect LoggerContext");
     }
 
-    private class Worker extends Thread {
+    private static class Worker extends Thread {
         LoggerContext context = null;
 
         @Override
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/SortedArrayStringMapTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/SortedArrayStringMapTest.java
index 54e5ccb..82db1a1 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/SortedArrayStringMapTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/SortedArrayStringMapTest.java
@@ -16,6 +16,8 @@
  */
 package org.apache.logging.log4j.util;
 
+import org.junit.jupiter.api.Test;
+
 import java.io.BufferedReader;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -29,31 +31,31 @@ import java.lang.reflect.Field;
 import java.net.URL;
 import java.net.URLDecoder;
 import java.nio.charset.Charset;
+import java.util.Arrays;
 import java.util.ConcurrentModificationException;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.junit.Test;
-
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests the SortedArrayStringMap class.
  */
 public class SortedArrayStringMapTest {
 
-    @Test(expected = IllegalArgumentException.class)
-    public void testConstructorDisallowsNegativeCapacity() throws Exception {
-        new SortedArrayStringMap(-1);
+    @Test
+    public void testConstructorDisallowsNegativeCapacity() {
+        assertThrows(IllegalArgumentException.class, () -> new SortedArrayStringMap(-1));
     }
 
-    public void testConstructorAllowsZeroCapacity() throws Exception {
-        final SortedArrayStringMap sortedArrayStringMap = new SortedArrayStringMap(0);
+    @Test
+    public void testConstructorAllowsZeroCapacity() {
+        SortedArrayStringMap sortedArrayStringMap = new SortedArrayStringMap(0);
         assertEquals(0, sortedArrayStringMap.size());
     }
 
     @Test
-    public void testConstructorIgnoresNull() throws Exception {
+    public void testConstructorIgnoresNull() {
         assertEquals(0, new SortedArrayStringMap((SortedArrayStringMap) null).size());
     }
 
@@ -174,7 +176,7 @@ public class SortedArrayStringMapTest {
     }
 
     @Test
-    public void testPutAll() throws Exception {
+    public void testPutAll() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "avalue");
         original.putValue("B", "Bvalue");
@@ -195,7 +197,7 @@ public class SortedArrayStringMapTest {
     }
 
     @Test
-    public void testPutAll_overwritesSameKeys2() throws Exception {
+    public void testPutAll_overwritesSameKeys2() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "aORIG");
         original.putValue("b", "bORIG");
@@ -210,7 +212,7 @@ public class SortedArrayStringMapTest {
         other.putValue("c", "cc");
         original.putAll(other);
 
-        assertEquals("size after put other", 7, original.size());
+        assertEquals(7, original.size(), "size after put other");
         assertEquals("aa", original.getValue("a"));
         assertEquals("bORIG", original.getValue("b"));
         assertEquals("cc", original.getValue("c"));
@@ -221,7 +223,7 @@ public class SortedArrayStringMapTest {
     }
 
     @Test
-    public void testPutAll_nullKeyInLargeOriginal() throws Exception {
+    public void testPutAll_nullKeyInLargeOriginal() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue(null, "nullORIG");
         original.putValue("a", "aORIG");
@@ -235,7 +237,7 @@ public class SortedArrayStringMapTest {
         other.putValue("a", "aa");
         original.putAll(other);
 
-        assertEquals("size after put other", 7, original.size());
+        assertEquals(7, original.size(), "size after put other");
         assertEquals("aa", original.getValue("a"));
         assertEquals("bORIG", original.getValue("b"));
         assertEquals("cORIG", original.getValue("c"));
@@ -246,7 +248,7 @@ public class SortedArrayStringMapTest {
     }
 
     @Test
-    public void testPutAll_nullKeyInSmallOriginal() throws Exception {
+    public void testPutAll_nullKeyInSmallOriginal() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue(null, "nullORIG");
         original.putValue("a", "aORIG");
@@ -259,7 +261,7 @@ public class SortedArrayStringMapTest {
         other.putValue("a", "aa");
         original.putAll(other);
 
-        assertEquals("size after put other", 6, original.size());
+        assertEquals(6, original.size(), "size after put other");
         assertEquals("aa", original.getValue("a"));
         assertEquals("bORIG", original.getValue("b"));
         assertEquals("11", original.getValue("1"));
@@ -269,7 +271,7 @@ public class SortedArrayStringMapTest {
     }
 
     @Test
-    public void testPutAll_nullKeyInSmallAdditional() throws Exception {
+    public void testPutAll_nullKeyInSmallAdditional() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "aORIG");
         original.putValue("b", "bORIG");
@@ -283,7 +285,7 @@ public class SortedArrayStringMapTest {
         other.putValue("a", "aa");
         original.putAll(other);
 
-        assertEquals("size after put other", 7, original.size());
+        assertEquals(7, original.size(), "size after put other");
         assertEquals("aa", original.getValue("a"));
         assertEquals("bORIG", original.getValue("b"));
         assertEquals("cORIG", original.getValue("c"));
@@ -294,7 +296,7 @@ public class SortedArrayStringMapTest {
     }
 
     @Test
-    public void testPutAll_nullKeyInLargeAdditional() throws Exception {
+    public void testPutAll_nullKeyInLargeAdditional() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "aORIG");
         original.putValue("b", "bORIG");
@@ -307,7 +309,7 @@ public class SortedArrayStringMapTest {
         other.putValue("a", "aa");
         original.putAll(other);
 
-        assertEquals("size after put other", 6, original.size());
+        assertEquals(6, original.size(), "size after put other");
         assertEquals("aa", original.getValue("a"));
         assertEquals("bORIG", original.getValue("b"));
         assertEquals("11", original.getValue("1"));
@@ -317,7 +319,7 @@ public class SortedArrayStringMapTest {
     }
 
     @Test
-    public void testPutAll_nullKeyInBoth_LargeOriginal() throws Exception {
+    public void testPutAll_nullKeyInBoth_LargeOriginal() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue(null, "nullORIG");
         original.putValue("a", "aORIG");
@@ -332,7 +334,7 @@ public class SortedArrayStringMapTest {
         other.putValue("a", "aa");
         original.putAll(other);
 
-        assertEquals("size after put other", 7, original.size());
+        assertEquals(7, original.size(), "size after put other");
         assertEquals("aa", original.getValue("a"));
         assertEquals("bORIG", original.getValue("b"));
         assertEquals("cORIG", original.getValue("c"));
@@ -343,7 +345,7 @@ public class SortedArrayStringMapTest {
     }
 
     @Test
-    public void testPutAll_nullKeyInBoth_SmallOriginal() throws Exception {
+    public void testPutAll_nullKeyInBoth_SmallOriginal() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue(null, "nullORIG");
         original.putValue("a", "aORIG");
@@ -357,7 +359,7 @@ public class SortedArrayStringMapTest {
         other.putValue("a", "aa");
         original.putAll(other);
 
-        assertEquals("size after put other", 6, original.size());
+        assertEquals(6, original.size(), "size after put other");
         assertEquals("aa", original.getValue("a"));
         assertEquals("bORIG", original.getValue("b"));
         assertEquals("11", original.getValue("1"));
@@ -367,7 +369,7 @@ public class SortedArrayStringMapTest {
     }
 
     @Test
-    public void testPutAll_overwritesSameKeys1() throws Exception {
+    public void testPutAll_overwritesSameKeys1() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "aORIG");
         original.putValue("b", "bORIG");
@@ -380,7 +382,7 @@ public class SortedArrayStringMapTest {
         other.putValue("c", "cc");
         original.putAll(other);
 
-        assertEquals("size after put other", 5, original.size());
+        assertEquals(5, original.size(), "size after put other");
         assertEquals("aa", original.getValue("a"));
         assertEquals("bORIG", original.getValue("b"));
         assertEquals("cc", original.getValue("c"));
@@ -417,7 +419,7 @@ public class SortedArrayStringMapTest {
     }
 
     @Test
-    public void testToMap() throws Exception {
+    public void testToMap() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "avalue");
         original.putValue("B", "Bvalue");
@@ -430,11 +432,7 @@ public class SortedArrayStringMapTest {
 
         assertEquals(expected, original.toMap());
 
-        try {
-            original.toMap().put("abc", "xyz");
-        } catch (final UnsupportedOperationException ex) {
-            fail("Expected map to be mutable, but " + ex);
-        }
+        assertDoesNotThrow(() -> original.toMap().put("abc", "xyz"), "Expected map to be mutable");
     }
 
     @Test
@@ -443,11 +441,11 @@ public class SortedArrayStringMapTest {
         original.putValue("a", "aaa");
         original.putValue("b", "bbb");
         original.putValue("c", "ccc");
-        assertEquals("size", 3, original.size());
+        assertEquals(3, original.size(), "size");
 
         // add empty context data
         original.putAll(new SortedArrayStringMap());
-        assertEquals("size after put empty", 3, original.size());
+        assertEquals(3, original.size(), "size after put empty");
         assertEquals("aaa", original.getValue("a"));
         assertEquals("bbb", original.getValue("b"));
         assertEquals("ccc", original.getValue("c"));
@@ -458,7 +456,7 @@ public class SortedArrayStringMapTest {
         other.putValue("3", "333");
         original.putAll(other);
 
-        assertEquals("size after put other", 6, original.size());
+        assertEquals(6, original.size(), "size after put other");
         assertEquals("aaa", original.getValue("a"));
         assertEquals("bbb", original.getValue("b"));
         assertEquals("ccc", original.getValue("c"));
@@ -474,11 +472,11 @@ public class SortedArrayStringMapTest {
         original.putValue("b", "bbb");
         original.putValue("c", "ccc");
         original.putValue("d", "ddd");
-        assertEquals("size", 4, original.size());
+        assertEquals(4, original.size(), "size");
 
         // add empty context data
         original.putAll(new SortedArrayStringMap());
-        assertEquals("size after put empty", 4, original.size());
+        assertEquals(4, original.size(), "size after put empty");
         assertEquals("aaa", original.getValue("a"));
         assertEquals("bbb", original.getValue("b"));
         assertEquals("ccc", original.getValue("c"));
@@ -491,7 +489,7 @@ public class SortedArrayStringMapTest {
         other.putValue("4", "444");
         original.putAll(other);
 
-        assertEquals("size after put other", 8, original.size());
+        assertEquals(8, original.size(), "size after put other");
         assertEquals("aaa", original.getValue("a"));
         assertEquals("bbb", original.getValue("b"));
         assertEquals("ccc", original.getValue("c"));
@@ -510,7 +508,7 @@ public class SortedArrayStringMapTest {
         original.putValue("b", "bbb");
         original.putValue("c", "ccc");
         original.putValue("d", "ddd");
-        assertEquals("size", 5, original.size());
+        assertEquals(5, original.size(), "size");
 
         final SortedArrayStringMap other = new SortedArrayStringMap();
         for (int i = 0 ; i < 500; i++) {
@@ -519,7 +517,7 @@ public class SortedArrayStringMapTest {
         other.putValue(null, "otherVal");
         original.putAll(other);
 
-        assertEquals("size after put other", 505, original.size());
+        assertEquals(505, original.size(), "size after put other");
         assertEquals("otherVal", original.getValue(null));
         assertEquals("aaa", original.getValue("a"));
         assertEquals("bbb", original.getValue("b"));
@@ -536,110 +534,70 @@ public class SortedArrayStringMapTest {
         original.putValue("a", "aaa");
         original.putValue("b", "bbb");
         original.putValue("c", "ccc");
-        assertEquals("size", 3, original.size());
+        assertEquals(3, original.size(), "size");
 
         // putAll with self
         original.putAll(original);
-        assertEquals("size after put empty", 3, original.size());
+        assertEquals(3, original.size(), "size after put empty");
         assertEquals("aaa", original.getValue("a"));
         assertEquals("bbb", original.getValue("b"));
         assertEquals("ccc", original.getValue("c"));
     }
 
-    @Test(expected = ConcurrentModificationException.class)
+    @Test
     public void testConcurrentModificationBiConsumerPut() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "aaa");
-        original.forEach(new BiConsumer<String, Object>() {
-            @Override
-            public void accept(final String s, final Object o) {
-                original.putValue("c", "other");
-            }
-        });
+        assertThrows(ConcurrentModificationException.class, () -> original.forEach((s, o) -> original.putValue("c", "other")));
     }
 
-    @Test(expected = ConcurrentModificationException.class)
+    @Test
     public void testConcurrentModificationBiConsumerPutValue() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "aaa");
-        original.forEach(new BiConsumer<String, Object>() {
-            @Override
-            public void accept(final String s, final Object o) {
-                original.putValue("c", "other");
-            }
-        });
+        assertThrows(ConcurrentModificationException.class, () -> original.forEach((s, o) -> original.putValue("c", "other")));
     }
 
-    @Test(expected = ConcurrentModificationException.class)
+    @Test
     public void testConcurrentModificationBiConsumerRemove() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "aaa");
-        original.forEach(new BiConsumer<String, Object>() {
-            @Override
-            public void accept(final String s, final Object o) {
-                original.remove("a");
-            }
-        });
+        assertThrows(ConcurrentModificationException.class, () -> original.forEach((s, o) -> original.remove("a")));
     }
 
-    @Test(expected = ConcurrentModificationException.class)
+    @Test
     public void testConcurrentModificationBiConsumerClear() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "aaa");
-        original.forEach(new BiConsumer<String, Object>() {
-            @Override
-            public void accept(final String s, final Object o) {
-                original.clear();
-            }
-        });
+        assertThrows(ConcurrentModificationException.class, () -> original.forEach((s, o) -> original.clear()));
     }
 
-    @Test(expected = ConcurrentModificationException.class)
+    @Test
     public void testConcurrentModificationTriConsumerPut() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "aaa");
-        original.forEach(new TriConsumer<String, Object, Object>() {
-            @Override
-            public void accept(final String s, final Object o, final Object o2) {
-                original.putValue("c", "other");
-            }
-        }, null);
+        assertThrows(ConcurrentModificationException.class, () -> original.forEach((s, o, o2) -> original.putValue("c", "other"), null));
     }
 
-    @Test(expected = ConcurrentModificationException.class)
+    @Test
     public void testConcurrentModificationTriConsumerPutValue() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "aaa");
-        original.forEach(new TriConsumer<String, Object, Object>() {
-            @Override
-            public void accept(final String s, final Object o, final Object o2) {
-                original.putValue("c", "other");
-            }
-        }, null);
+        assertThrows(ConcurrentModificationException.class, () -> original.forEach((s, o, o2) -> original.putValue("c", "other"), null));
     }
 
-    @Test(expected = ConcurrentModificationException.class)
+    @Test
     public void testConcurrentModificationTriConsumerRemove() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "aaa");
-        original.forEach(new TriConsumer<String, Object, Object>() {
-            @Override
-            public void accept(final String s, final Object o, final Object o2) {
-                original.remove("a");
-            }
-        }, null);
+        assertThrows(ConcurrentModificationException.class, () -> original.forEach((s, o, o2) -> original.remove("a"), null));
     }
 
-    @Test(expected = ConcurrentModificationException.class)
+    @Test
     public void testConcurrentModificationTriConsumerClear() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "aaa");
-        original.forEach(new TriConsumer<String, Object, Object>() {
-            @Override
-            public void accept(final String s, final Object o, final Object o2) {
-                original.clear();
-            }
-        }, null);
+        assertThrows(ConcurrentModificationException.class, () -> original.forEach((s, o, o2) -> original.clear(), null));
     }
 
     @Test
@@ -650,24 +608,24 @@ public class SortedArrayStringMapTest {
     @Test
     public void testIsFrozenAfterCallingFreeze() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
-        assertFalse("before freeze", original.isFrozen());
+        assertFalse(original.isFrozen(), "before freeze");
         original.freeze();
-        assertTrue("after freeze", original.isFrozen());
+        assertTrue(original.isFrozen(), "after freeze");
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testFreezeProhibitsPutValue() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.freeze();
-        original.putValue("a", "aaa");
+        assertThrows(UnsupportedOperationException.class, () -> original.putValue("a", "aaa"));
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testFreezeProhibitsRemove() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("b", "bbb");
         original.freeze();
-        original.remove("b"); // existing key: modifies the collection
+        assertThrows(UnsupportedOperationException.class, () -> original.remove("b")); // existing key: modifies the collection
     }
 
     @Test
@@ -675,33 +633,33 @@ public class SortedArrayStringMapTest {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("b", "bbb");
         original.freeze();
-        original.remove("a"); // no actual modification
+        assertDoesNotThrow(() -> original.remove("a"));
     }
 
     @Test
     public void testFreezeAllowsRemoveIfEmpty() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.freeze();
-        original.remove("a"); // no exception
+        assertDoesNotThrow(() -> original.remove("a"));
     }
 
-    @Test(expected = UnsupportedOperationException.class)
+    @Test
     public void testFreezeProhibitsClear() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "aaa");
         original.freeze();
-        original.clear();
+        assertThrows(UnsupportedOperationException.class, original::clear);
     }
 
     @Test
     public void testFreezeAllowsClearIfEmpty() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.freeze();
-        original.clear();
+        assertDoesNotThrow(original::clear);
     }
 
     @Test
-    public void testPutInsertsInAlphabeticOrder() throws Exception {
+    public void testPutInsertsInAlphabeticOrder() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "avalue");
         original.putValue("B", "Bvalue");
@@ -726,7 +684,7 @@ public class SortedArrayStringMapTest {
     }
 
     @Test
-    public void testPutValueInsertsInAlphabeticOrder() throws Exception {
+    public void testPutValueInsertsInAlphabeticOrder() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "avalue");
         original.putValue("B", "Bvalue");
@@ -794,27 +752,27 @@ public class SortedArrayStringMapTest {
         expected.put("3", "3value");
         expected.put("c", "cvalue");
         expected.put("d", "dvalue");
-        assertEquals("initial", expected, original.toMap());
+        assertEquals(expected, original.toMap(), "initial");
 
         original.putValue(null, "nullvalue");
         expected.put(null, "nullvalue");
         assertEquals(6, original.size());
-        assertEquals("with null key", expected, original.toMap());
+        assertEquals(expected, original.toMap(), "with null key");
 
         original.putValue(null, "otherNullvalue");
         expected.put(null, "otherNullvalue");
         assertEquals(6, original.size());
-        assertEquals("with null key value2", expected, original.toMap());
+        assertEquals(expected, original.toMap(), "with null key value2");
 
         original.putValue(null, "nullvalue");
         expected.put(null, "nullvalue");
         assertEquals(6, original.size());
-        assertEquals("with null key value1 again", expected, original.toMap());
+        assertEquals(expected, original.toMap(), "with null key value1 again");
 
         original.putValue(null, "abc");
         expected.put(null, "abc");
         assertEquals(6, original.size());
-        assertEquals("with null key value3", expected, original.toMap());
+        assertEquals(expected, original.toMap(), "with null key value3");
     }
 
     @Test
@@ -826,11 +784,11 @@ public class SortedArrayStringMapTest {
 
         original.remove("a");
         assertEquals(0, original.size());
-        assertNull("no a val", original.getValue("a"));
+        assertNull(original.getValue("a"), "no a val");
 
         original.remove("B");
         assertEquals(0, original.size());
-        assertNull("no B val", original.getValue("B"));
+        assertNull(original.getValue("B"), "no B val");
     }
 
     @Test
@@ -850,13 +808,11 @@ public class SortedArrayStringMapTest {
         final Field f = SortedArrayStringMap.class.getDeclaredField("values");
         f.setAccessible(true);
         final Object[] values = (Object[]) f.get(original);
-        for (int i = 0; i < values.length; i++) {
-            assertNull(values[i]);
-        }
+        assertAll(Arrays.stream(values).map(value -> () -> assertNull(value)));
     }
 
     @Test
-    public void testRemoveWhenFull() throws Exception {
+    public void testRemoveWhenFull() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "avalue");
         original.putValue("b", "bvalue");
@@ -874,15 +830,15 @@ public class SortedArrayStringMapTest {
 
         original.putValue("a", null);
         assertEquals(1, original.size());
-        assertNull("no a val", original.getValue("a"));
+        assertNull(original.getValue("a"), "no a val");
 
         original.putValue("B", null);
         assertEquals(2, original.size());
-        assertNull("no B val", original.getValue("B"));
+        assertNull(original.getValue("B"), "no B val");
     }
 
     @Test
-    public void testGet() throws Exception {
+    public void testGet() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "avalue");
         original.putValue("B", "Bvalue");
@@ -900,7 +856,7 @@ public class SortedArrayStringMapTest {
     }
 
     @Test
-    public void testGetValue_GetValueAt() throws Exception {
+    public void testGetValue_GetValueAt() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "avalue");
         original.putValue("B", "Bvalue");
@@ -941,13 +897,11 @@ public class SortedArrayStringMapTest {
         final Field f = SortedArrayStringMap.class.getDeclaredField("values");
         f.setAccessible(true);
         final Object[] values = (Object[]) f.get(original);
-        for (int i = 0; i < values.length; i++) {
-            assertNull(values[i]);
-        }
+        assertAll(Arrays.stream(values).map(value -> () -> assertNull(value)));
     }
 
     @Test
-    public void testIndexOfKey() throws Exception {
+    public void testIndexOfKey() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "avalue");
         assertEquals(0, original.indexOfKey("a"));
@@ -984,40 +938,40 @@ public class SortedArrayStringMapTest {
     }
 
     @Test
-    public void testContainsKey() throws Exception {
+    public void testContainsKey() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
-        assertFalse("a", original.containsKey("a"));
-        assertFalse("B", original.containsKey("B"));
-        assertFalse("3", original.containsKey("3"));
-        assertFalse("A", original.containsKey("A"));
+        assertFalse(original.containsKey("a"), "a");
+        assertFalse(original.containsKey("B"), "B");
+        assertFalse(original.containsKey("3"), "3");
+        assertFalse(original.containsKey("A"), "A");
 
         original.putValue("a", "avalue");
-        assertTrue("a", original.containsKey("a"));
-        assertFalse("B", original.containsKey("B"));
-        assertFalse("3", original.containsKey("3"));
-        assertFalse("A", original.containsKey("A"));
+        assertTrue(original.containsKey("a"), "a");
+        assertFalse(original.containsKey("B"), "B");
+        assertFalse(original.containsKey("3"), "3");
+        assertFalse(original.containsKey("A"), "A");
 
         original.putValue("B", "Bvalue");
-        assertTrue("a", original.containsKey("a"));
-        assertTrue("B", original.containsKey("B"));
-        assertFalse("3", original.containsKey("3"));
-        assertFalse("A", original.containsKey("A"));
+        assertTrue(original.containsKey("a"), "a");
+        assertTrue(original.containsKey("B"), "B");
+        assertFalse(original.containsKey("3"), "3");
+        assertFalse(original.containsKey("A"), "A");
 
         original.putValue("3", "3value");
-        assertTrue("a", original.containsKey("a"));
-        assertTrue("B", original.containsKey("B"));
-        assertTrue("3", original.containsKey("3"));
-        assertFalse("A", original.containsKey("A"));
+        assertTrue(original.containsKey("a"), "a");
+        assertTrue(original.containsKey("B"), "B");
+        assertTrue(original.containsKey("3"), "3");
+        assertFalse(original.containsKey("A"), "A");
 
         original.putValue("A", "AAA");
-        assertTrue("a", original.containsKey("a"));
-        assertTrue("B", original.containsKey("B"));
-        assertTrue("3", original.containsKey("3"));
-        assertTrue("A", original.containsKey("A"));
+        assertTrue(original.containsKey("a"), "a");
+        assertTrue(original.containsKey("B"), "B");
+        assertTrue(original.containsKey("3"), "3");
+        assertTrue(original.containsKey("A"), "A");
     }
 
     @Test
-    public void testGetValueAt() throws Exception {
+    public void testGetValueAt() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "avalue");
         assertEquals("a", original.getKeyAt(0));
@@ -1039,38 +993,38 @@ public class SortedArrayStringMapTest {
     }
 
     @Test
-    public void testSizeAndIsEmpty() throws Exception {
+    public void testSizeAndIsEmpty() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         assertEquals(0, original.size());
-        assertTrue("initial", original.isEmpty());
+        assertTrue(original.isEmpty(), "initial");
 
         original.putValue("a", "avalue");
         assertEquals(1, original.size());
-        assertFalse("size=" + original.size(), original.isEmpty());
+        assertFalse(original.isEmpty(), "size=" + original.size());
 
         original.putValue("B", "Bvalue");
         assertEquals(2, original.size());
-        assertFalse("size=" + original.size(), original.isEmpty());
+        assertFalse(original.isEmpty(), "size=" + original.size());
 
         original.putValue("3", "3value");
         assertEquals(3, original.size());
-        assertFalse("size=" + original.size(), original.isEmpty());
+        assertFalse(original.isEmpty(), "size=" + original.size());
 
         original.remove("B");
         assertEquals(2, original.size());
-        assertFalse("size=" + original.size(), original.isEmpty());
+        assertFalse(original.isEmpty(), "size=" + original.size());
 
         original.remove("3");
         assertEquals(1, original.size());
-        assertFalse("size=" + original.size(), original.isEmpty());
+        assertFalse(original.isEmpty(), "size=" + original.size());
 
         original.remove("a");
         assertEquals(0, original.size());
-        assertTrue("size=" + original.size(), original.isEmpty());
+        assertTrue(original.isEmpty(), "size=" + original.size());
     }
 
     @Test
-    public void testForEachBiConsumer() throws Exception {
+    public void testForEachBiConsumer() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "avalue");
         original.putValue("B", "Bvalue");
@@ -1080,10 +1034,10 @@ public class SortedArrayStringMapTest {
             int count = 0;
             @Override
             public void accept(final String key, final String value) {
-                assertEquals("key", key, original.getKeyAt(count));
-                assertEquals("val", value, original.getValueAt(count));
+                assertEquals(key, original.getKeyAt(count), "key");
+                assertEquals(value, original.getValueAt(count), "val");
                 count++;
-                assertTrue("count should not exceed size but was " + count, count <= original.size());
+                assertTrue(count <= original.size(), "count should not exceed size but was " + count);
             }
         });
     }
@@ -1092,19 +1046,16 @@ public class SortedArrayStringMapTest {
         SortedArrayStringMap data;
         int count;
     }
-    static TriConsumer<String, String, State> COUNTER = new TriConsumer<String, String, State>() {
-        @Override
-        public void accept(final String key, final String value, final State state) {
-            assertEquals("key", key, state.data.getKeyAt(state.count));
-            assertEquals("val", value, state.data.getValueAt(state.count));
-            state.count++;
-            assertTrue("count should not exceed size but was " + state.count,
-                    state.count <= state.data.size());
-        }
+    static TriConsumer<String, String, State> COUNTER = (key, value, state) -> {
+        assertEquals(key, state.data.getKeyAt(state.count), "key");
+        assertEquals(value, state.data.getValueAt(state.count), "val");
+        state.count++;
+        assertTrue(
+                state.count <= state.data.size(), "count should not exceed size but was " + state.count);
     };
 
     @Test
-    public void testForEachTriConsumer() throws Exception {
+    public void testForEachTriConsumer() {
         final SortedArrayStringMap original = new SortedArrayStringMap();
         original.putValue("a", "avalue");
         original.putValue("B", "Bvalue");
@@ -1115,4 +1066,4 @@ public class SortedArrayStringMapTest {
         original.forEach(COUNTER, state);
         assertEquals(state.count, original.size());
     }
-}
\ No newline at end of file
+}
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/StringBuildersTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/StringBuildersTest.java
index 6fa7a6f..b354979 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/StringBuildersTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/StringBuildersTest.java
@@ -16,35 +16,35 @@
  */
 package org.apache.logging.log4j.util;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests the StringBuilders class.
  */
 public class StringBuildersTest {
     @Test
-    public void trimToMaxSize() throws Exception {
+    public void trimToMaxSize() {
         final StringBuilder sb = new StringBuilder();
         final char[] value = new char[4 * 1024];
         sb.append(value);
 
-        assertTrue("needs trimming", sb.length() > Constants.MAX_REUSABLE_MESSAGE_SIZE);
+        assertTrue(sb.length() > Constants.MAX_REUSABLE_MESSAGE_SIZE, "needs trimming");
         StringBuilders.trimToMaxSize(sb, Constants.MAX_REUSABLE_MESSAGE_SIZE);
-        assertTrue("trimmed OK", sb.length() <= Constants.MAX_REUSABLE_MESSAGE_SIZE);
+        assertTrue(sb.length() <= Constants.MAX_REUSABLE_MESSAGE_SIZE, "trimmed OK");
     }
 
     @Test
-    public void trimToMaxSizeWithLargeCapacity() throws Exception {
+    public void trimToMaxSizeWithLargeCapacity() {
         final StringBuilder sb = new StringBuilder();
         final char[] value = new char[4 * 1024];
         sb.append(value);
         sb.setLength(0);
 
-        assertTrue("needs trimming", sb.capacity() > Constants.MAX_REUSABLE_MESSAGE_SIZE);
+        assertTrue(sb.capacity() > Constants.MAX_REUSABLE_MESSAGE_SIZE, "needs trimming");
         StringBuilders.trimToMaxSize(sb, Constants.MAX_REUSABLE_MESSAGE_SIZE);
-        assertTrue("trimmed OK", sb.capacity() <= Constants.MAX_REUSABLE_MESSAGE_SIZE);
+        assertTrue(sb.capacity() <= Constants.MAX_REUSABLE_MESSAGE_SIZE, "trimmed OK");
     }
 
     @Test
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/StringsTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/StringsTest.java
index 8e606a3..cfd5127 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/StringsTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/StringsTest.java
@@ -17,31 +17,33 @@
 
 package org.apache.logging.log4j.util;
 
+import org.junit.jupiter.api.Test;
+
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.Iterator;
 
-import org.junit.Assert;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.*;
 
 public class StringsTest {
 
     @Test
     public void testIsEmpty() {
-        Assert.assertTrue(Strings.isEmpty(null));
-        Assert.assertTrue(Strings.isEmpty(""));
-        Assert.assertFalse(Strings.isEmpty(" "));
-        Assert.assertFalse(Strings.isEmpty("a"));
+        assertTrue(Strings.isEmpty(null));
+        assertTrue(Strings.isEmpty(""));
+        assertFalse(Strings.isEmpty(" "));
+        assertFalse(Strings.isEmpty("a"));
     }
 
     @Test
     public void testIsBlank() {
-        Assert.assertTrue(Strings.isBlank(null));
-        Assert.assertTrue(Strings.isBlank(""));
-        Assert.assertTrue(Strings.isBlank(" "));
-        Assert.assertTrue(Strings.isBlank("\n"));
-        Assert.assertTrue(Strings.isBlank("\r"));
-        Assert.assertTrue(Strings.isBlank("\t"));
-        Assert.assertFalse(Strings.isEmpty("a"));
+        assertTrue(Strings.isBlank(null));
+        assertTrue(Strings.isBlank(""));
+        assertTrue(Strings.isBlank(" "));
+        assertTrue(Strings.isBlank("\n"));
+        assertTrue(Strings.isBlank("\r"));
+        assertTrue(Strings.isBlank("\t"));
+        assertFalse(Strings.isEmpty("a"));
     }
 
     /**
@@ -49,29 +51,29 @@ public class StringsTest {
      */
     @Test
     public void testEMPTY() {
-        Assert.assertEquals("", Strings.EMPTY);
-        Assert.assertEquals(0, Strings.EMPTY.length());
+        assertEquals("", Strings.EMPTY);
+        assertEquals(0, Strings.EMPTY.length());
     }
 
     @Test
     public void testJoin() {
-        Assert.assertEquals(null, Strings.join((Iterable<?>) null, '.'));
-        Assert.assertEquals(null, Strings.join((Iterator<?>) null, '.'));
-        Assert.assertEquals("", Strings.join((Arrays.asList()), '.'));
+        assertNull(Strings.join((Iterable<?>) null, '.'));
+        assertNull(Strings.join((Iterator<?>) null, '.'));
+        assertEquals("", Strings.join((Collections.emptyList()), '.'));
 
-        Assert.assertEquals("a", Strings.join(Arrays.asList("a"), '.'));
-        Assert.assertEquals("a.b", Strings.join(Arrays.asList("a", "b"), '.'));
-        Assert.assertEquals("a.b.c", Strings.join(Arrays.asList("a", "b", "c"), '.'));
+        assertEquals("a", Strings.join(Collections.singletonList("a"), '.'));
+        assertEquals("a.b", Strings.join(Arrays.asList("a", "b"), '.'));
+        assertEquals("a.b.c", Strings.join(Arrays.asList("a", "b", "c"), '.'));
 
-        Assert.assertEquals("", Strings.join(Arrays.asList((String) null), ':'));
-        Assert.assertEquals(":", Strings.join(Arrays.asList(null, null), ':'));
-        Assert.assertEquals("a:", Strings.join(Arrays.asList("a", null), ':'));
-        Assert.assertEquals(":b", Strings.join(Arrays.asList(null, "b"), ':'));
+        assertEquals("", Strings.join(Collections.singletonList((String) null), ':'));
+        assertEquals(":", Strings.join(Arrays.asList(null, null), ':'));
+        assertEquals("a:", Strings.join(Arrays.asList("a", null), ':'));
+        assertEquals(":b", Strings.join(Arrays.asList(null, "b"), ':'));
     }
 
     @Test
     public void testQuote() {
-        Assert.assertEquals("'Q'", Strings.quote("Q"));
+        assertEquals("'Q'", Strings.quote("Q"));
     }
 
 }
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/SystemPropertiesPropertySourceTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/SystemPropertiesPropertySourceTest.java
index eb5032d..2a3ede0 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/SystemPropertiesPropertySourceTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/SystemPropertiesPropertySourceTest.java
@@ -1,13 +1,3 @@
-package org.apache.logging.log4j.util;
-
-import java.util.Properties;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-
-import org.junit.Test;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements. See the NOTICE file distributed with
@@ -25,48 +15,55 @@ import org.junit.Test;
  * limitations under the license.
  */
 
+package org.apache.logging.log4j.util;
+
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+
+import java.util.Properties;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
 /**
  * Tests https://issues.apache.org/jira/browse/LOG4J2-2276.
  */
+@Tag("concurrency")
 public class SystemPropertiesPropertySourceTest {
 
-	private static final int ITERATIONS = 10000;
-
-	/**
-	 * Tests avoiding a ConcurrentModificationException. For example:
-	 * 
-	 * <pre>
-	 * java.util.ConcurrentModificationException
-	 *  at java.util.Hashtable$Enumerator.next(Hashtable.java:1167)
-	 *  at org.apache.logging.log4j.util.SystemPropertiesPropertySource.forEach(SystemPropertiesPropertySource.java:38)
-	 *  at org.apache.logging.log4j.util.SystemPropertiesPropertySourceTest.testMultiThreadedAccess(SystemPropertiesPropertySourceTest.java:47)
-	 * </pre>
-	 */
-	@Test
-	public void testMultiThreadedAccess() throws InterruptedException, ExecutionException {
-		final ExecutorService threadPool = Executors.newSingleThreadExecutor();
-		try {
-			final Future<?> future = threadPool.submit(new Runnable() {
+    private static final int ITERATIONS = 10000;
 
-				@Override
-				public void run() {
-					final Properties properties = System.getProperties();
-					for (int i = 0; i < ITERATIONS; i++) {
-						properties.setProperty("FOO_" + i, "BAR");
-					}
-				}
-			});
-			for (int i = 0; i < ITERATIONS; i++)
-				new SystemPropertiesPropertySource().forEach(new BiConsumer<String, String>() {
-					@Override
-					public void accept(final String key, final String value) {
-						// nothing
-					}
-				});
-			future.get();
-		} finally {
-			threadPool.shutdown();
-		}
-	}
+    /**
+     * Tests avoiding a ConcurrentModificationException. For example:
+     * 
+     * <pre>
+     * java.util.ConcurrentModificationException
+     *  at java.util.Hashtable$Enumerator.next(Hashtable.java:1167)
+     *  at org.apache.logging.log4j.util.SystemPropertiesPropertySource.forEach(SystemPropertiesPropertySource.java:38)
+     *  at org.apache.logging.log4j.util.SystemPropertiesPropertySourceTest.testMultiThreadedAccess(SystemPropertiesPropertySourceTest.java:47)
+     * </pre>
+     * @throws InterruptedException 
+     * @throws ExecutionException 
+     */
+    @Test
+    public void testMultiThreadedAccess() throws InterruptedException, ExecutionException {
+        ExecutorService threadPool = Executors.newSingleThreadExecutor();
+        try {
+            Future<?> future = threadPool.submit(() -> {
+                final Properties properties = System.getProperties();
+                for (int i = 0; i < ITERATIONS; i++) {
+                    properties.setProperty("FOO_" + i, "BAR");
+                }
+            });
+            for (int i = 0; i < ITERATIONS; i++)
+                new SystemPropertiesPropertySource().forEach((key, value) -> {
+                    // nothing
+                });
+            future.get();
+        } finally {
+            threadPool.shutdown();
+        }
+    }
 
 }
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/Unbox1Test.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/Unbox1Test.java
index 2e8cb77..de785f0 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/Unbox1Test.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/Unbox1Test.java
@@ -17,27 +17,27 @@
 
 package org.apache.logging.log4j.util;
 
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests the Unbox class.
  */
 public class Unbox1Test {
-    @BeforeClass
+    @BeforeAll
     public static void beforeClass() {
         System.clearProperty("log4j.unbox.ringbuffer.size");
     }
 
     @Test
-    public void testBoxClaimsItHas32Slots() throws Exception {
+    public void testBoxClaimsItHas32Slots() {
         assertEquals(32, Unbox.getRingbufferSize());
     }
 
     @Test
-    public void testBoxHas32Slots() throws Exception {
+    public void testBoxHas32Slots() {
         final int MAX = 32;
         final StringBuilder[] probe = new StringBuilder[MAX * 3];
         for (int i = 0; i <= probe.length - 8; ) {
@@ -51,21 +51,21 @@ public class Unbox1Test {
             probe[i++] = Unbox.box(Short.MAX_VALUE);
         }
         for (int i = 0; i < probe.length - MAX; i++) {
-            assertSame("probe[" + i +"], probe[" + (i + MAX) +"]", probe[i], probe[i + MAX]);
+            assertSame(probe[i], probe[i + MAX], "probe[" + i +"], probe[" + (i + MAX) +"]");
             for (int j = 1; j < MAX - 1; j++) {
-                assertNotSame("probe[" + i +"], probe[" + (i + j) +"]", probe[i], probe[i + j]);
+                assertNotSame(probe[i], probe[i + j], "probe[" + i +"], probe[" + (i + j) +"]");
             }
         }
     }
 
     @Test
-    public void testBoxBoolean() throws Exception {
+    public void testBoxBoolean() {
         assertEquals("true", Unbox.box(true).toString());
         assertEquals("false", Unbox.box(false).toString());
     }
 
     @Test
-    public void testBoxByte() throws Exception {
+    public void testBoxByte() {
         assertEquals("0", Unbox.box((byte) 0).toString());
         assertEquals("1", Unbox.box((byte) 1).toString());
         assertEquals("127", Unbox.box((byte) 127).toString());
@@ -74,28 +74,28 @@ public class Unbox1Test {
     }
 
     @Test
-    public void testBoxChar() throws Exception {
+    public void testBoxChar() {
         assertEquals("a", Unbox.box('a').toString());
         assertEquals("b", Unbox.box('b').toString());
         assertEquals("å­—", Unbox.box('å­—').toString());
     }
 
     @Test
-    public void testBoxDouble() throws Exception {
+    public void testBoxDouble() {
         assertEquals("3.14", Unbox.box(3.14).toString());
         assertEquals(new Double(Double.MAX_VALUE).toString(), Unbox.box(Double.MAX_VALUE).toString());
         assertEquals(new Double(Double.MIN_VALUE).toString(), Unbox.box(Double.MIN_VALUE).toString());
     }
 
     @Test
-    public void testBoxFloat() throws Exception {
+    public void testBoxFloat() {
         assertEquals("3.14", Unbox.box(3.14F).toString());
         assertEquals(new Float(Float.MAX_VALUE).toString(), Unbox.box(Float.MAX_VALUE).toString());
         assertEquals(new Float(Float.MIN_VALUE).toString(), Unbox.box(Float.MIN_VALUE).toString());
     }
 
     @Test
-    public void testBoxInt() throws Exception {
+    public void testBoxInt() {
         assertEquals("0", Unbox.box(0).toString());
         assertEquals("1", Unbox.box(1).toString());
         assertEquals("127", Unbox.box(127).toString());
@@ -106,7 +106,7 @@ public class Unbox1Test {
     }
 
     @Test
-    public void testBoxLong() throws Exception {
+    public void testBoxLong() {
         assertEquals("0", Unbox.box(0L).toString());
         assertEquals("1", Unbox.box(1L).toString());
         assertEquals("127", Unbox.box(127L).toString());
@@ -117,7 +117,7 @@ public class Unbox1Test {
     }
 
     @Test
-    public void testBoxShort() throws Exception {
+    public void testBoxShort() {
         assertEquals("0", Unbox.box((short) 0).toString());
         assertEquals("1", Unbox.box((short) 1).toString());
         assertEquals("127", Unbox.box((short) 127).toString());
@@ -131,26 +131,16 @@ public class Unbox1Test {
     public void testBoxIsThreadLocal() throws Exception {
         final StringBuilder[] probe = new StringBuilder[16 * 3];
         populate(0, probe);
-        final Thread t1 = new Thread() {
-            @Override
-            public void run() {
-                populate(16, probe);
-            }
-        };
+        final Thread t1 = new Thread(() -> populate(16, probe));
         t1.start();
         t1.join();
-        final Thread t2 = new Thread() {
-            @Override
-            public void run() {
-                populate(16, probe);
-            }
-        };
+        final Thread t2 = new Thread(() -> populate(16, probe));
         t2.start();
         t2.join();
         for (int i = 0; i < probe.length - 16; i++) {
             for (int j = 1; j < 16; j++) {
-                assertNotSame("probe[" + i +"]=" + probe[i] + ", probe[" + (i + j) +"]=" + probe[i + j],
-                        probe[i], probe[i + j]);
+                assertNotSame(
+                        probe[i], probe[i + j], "probe[" + i +"]=" + probe[i] + ", probe[" + (i + j) +"]=" + probe[i + j]);
             }
         }
     }
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/Unbox2ConfigurableTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/Unbox2ConfigurableTest.java
index 2deda12..6438e34 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/Unbox2ConfigurableTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/Unbox2ConfigurableTest.java
@@ -16,29 +16,30 @@
  */
 package org.apache.logging.log4j.util;
 
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
+
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
 
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests that the Unbox ring buffer size is configurable.
  * Must be run in a separate process as the other UnboxTest or the last-run test will fail.
+ * Run this test on its own via {@code mvn --projects log4j-api test -Dtest=Unbox2ConfigurableTest} which will automatically
+ * enable the test, too.
  */
+@EnabledIfSystemProperty(named = "test", matches = ".*Unbox2ConfigurableTest.*")
 public class Unbox2ConfigurableTest {
-    @Ignore
-    @BeforeClass
+    @BeforeAll
     public static void beforeClass() {
         System.setProperty("log4j.unbox.ringbuffer.size", "65");
     }
 
-    @Ignore
-    @AfterClass
+    @AfterAll
     public static void afterClass() throws Exception {
         System.clearProperty("log4j.unbox.ringbuffer.size");
 
@@ -59,16 +60,14 @@ public class Unbox2ConfigurableTest {
         threadLocalField.set(null, new ThreadLocal<>());
     }
 
-    @Ignore
     @Test
-    public void testBoxConfiguredTo128Slots() throws Exception {
+    public void testBoxConfiguredTo128Slots() {
         // next power of 2 that is 65 or more
         assertEquals(128, Unbox.getRingbufferSize());
     }
 
-    @Ignore
     @Test
-    public void testBoxSuccessfullyConfiguredTo128Slots() throws Exception {
+    public void testBoxSuccessfullyConfiguredTo128Slots() {
         final int MAX = 128;
         final StringBuilder[] probe = new StringBuilder[MAX * 3];
         for (int i = 0; i <= probe.length - 8; ) {
@@ -82,9 +81,9 @@ public class Unbox2ConfigurableTest {
             probe[i++] = Unbox.box(Short.MAX_VALUE);
         }
         for (int i = 0; i < probe.length - MAX; i++) {
-            assertSame("probe[" + i +"], probe[" + (i + MAX) +"]", probe[i], probe[i + MAX]);
+            assertSame(probe[i], probe[i + MAX], "probe[" + i +"], probe[" + (i + MAX) +"]");
             for (int j = 1; j < MAX - 1; j++) {
-                assertNotSame("probe[" + i +"], probe[" + (i + j) +"]", probe[i], probe[i + j]);
+                assertNotSame(probe[i], probe[i + j], "probe[" + i +"], probe[" + (i + j) +"]");
             }
         }
     }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/AssertTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/AssertTest.java
index 242c41e..56c4299 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/AssertTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/AssertTest.java
@@ -20,22 +20,13 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-/**
- *
- */
-@RunWith(Parameterized.class)
 public class AssertTest {
 
-    private final Object value;
-    private final boolean isEmpty;
-
-    @Parameterized.Parameters
     public static Object[][] data() {
         return new Object[][]{
             // value, isEmpty
@@ -55,14 +46,10 @@ public class AssertTest {
         };
     }
 
-    public AssertTest(final Object value, final boolean isEmpty) {
-        this.value = value;
-        this.isEmpty = isEmpty;
-    }
-
-    @Test
-    public void isEmpty() throws Exception {
+    @ParameterizedTest
+    @MethodSource("data")
+    public void isEmpty(Object value, boolean isEmpty) throws Exception {
         assertEquals(isEmpty, Assert.isEmpty(value));
     }
 
-}
\ No newline at end of file
+}


[logging-log4j2] 06/06: [LOG4J2-2653] Migrate part of log4j-core to JUnit 5

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mattsicker pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 47d5066dbe5f1e59b9fae4c29e3fd9e8c44acf45
Author: Matt Sicker <bo...@gmail.com>
AuthorDate: Sat Aug 22 19:15:37 2020 -0500

    [LOG4J2-2653] Migrate part of log4j-core to JUnit 5
    
    Backported from 3.x.
    
    Signed-off-by: Matt Sicker <bo...@gmail.com>
---
 .../logging/log4j/util/ProcessIdUtilTest.java      |  10 +-
 log4j-core/pom.xml                                 |   4 +
 .../log4j/core/AppenderRefLevelJsonTest.java       |  42 +++----
 .../logging/log4j/core/AppenderRefLevelTest.java   |  49 ++++----
 .../logging/log4j/core/BasicLoggingTest.java       |   7 +-
 .../logging/log4j/core/CollectionLoggingTest.java  |  40 +++---
 .../log4j/core/CustomLevelsOverrideTest.java       |  35 +++---
 .../logging/log4j/core/CustomLevelsTest.java       |  34 +++--
 .../log4j/core/CustomLevelsWithFiltersTest.java    |  31 ++---
 .../apache/logging/log4j/core/DeadlockTest.java    |  20 ++-
 .../log4j/core/EventParameterMemoryLeakTest.java   |  25 ++--
 .../logging/log4j/core/ExtendedLevelTest.java      |  43 +++----
 .../log4j/core/GcFreeAsynchronousLoggingTest.java  |   8 +-
 .../logging/log4j/core/GcFreeLoggingTestUtil.java  |  18 +--
 .../log4j/core/GcFreeMixedSyncAyncLoggingTest.java |   5 +-
 .../log4j/core/GcFreeSynchronousLoggingTest.java   |   5 +-
 .../apache/logging/log4j/core/HostNameTest.java    |  43 +++----
 .../apache/logging/log4j/core/LateConfigTest.java  |  32 +++--
 .../org/apache/logging/log4j/core/LevelTest.java   |  60 +++++----
 .../apache/logging/log4j/core/Log4j1222Test.java   |   4 +-
 .../logging/log4j/core/LogEventFactoryTest.java    |  37 +++---
 .../apache/logging/log4j/core/LogEventTest.java    |  24 ++--
 .../apache/logging/log4j/core/LoggerDateTest.java  |  26 ++--
 .../org/apache/logging/log4j/core/LoggerTest.java  | 126 +++++++++----------
 .../logging/log4j/core/LoggerUpdateTest.java       |  54 ++++----
 .../org/apache/logging/log4j/core/LoggingTest.java |  68 ----------
 .../org/apache/logging/log4j/core/LookupTest.java  |  31 ++---
 .../logging/log4j/core/PatternSelectorTest.java    |  56 ++++-----
 .../log4j/core/PropertiesFileConfigTest.java       |  38 +++---
 ...ReusableParameterizedMessageMemoryLeakTest.java |   7 +-
 .../logging/log4j/core/ShutdownDisabledTest.java   |  22 +---
 .../core/ShutdownTimeoutConfigurationTest.java     |  20 +--
 .../logging/log4j/core/StrictXmlConfigTest.java    |  58 ++++-----
 .../logging/log4j/core/TimestampMessageTest.java   |  35 +++---
 .../org/apache/logging/log4j/core/XmlEvents.java   |  20 ++-
 .../selector/ClassLoaderContextSelectorTest.java   |   8 +-
 .../log4j/core/time/MutableInstantTest.java        | 139 ++++++++++-----------
 .../log4j/core/tools/GenerateCustomLoggerTest.java |  83 ++++++------
 .../core/tools/GenerateExtendedLoggerTest.java     |  86 +++++++------
 .../logging/log4j/core/util/ClockFactoryTest.java  |  16 ++-
 .../log4j/core/util/ContextDataProviderTest.java   |  25 ++--
 .../log4j/core/util/CronExpressionTest.java        |  30 ++---
 .../logging/log4j/core/util/CyclicBufferTest.java  |  22 ++--
 .../log4j/core/util/DummyNanoClockTest.java        |  78 ++++++------
 .../logging/log4j/core/util/FileUtilsTest.java     |  18 ++-
 .../apache/logging/log4j/core/util/InitTest.java   |  17 +--
 .../logging/log4j/core/util/IntegersTest.java      |   4 +-
 .../logging/log4j/core/util/JsonUtilsTest.java     |   4 +-
 .../apache/logging/log4j/core/util/LoaderTest.java |  13 +-
 .../logging/log4j/core/util/NetUtilsTest.java      |  29 ++---
 .../core/util/ShutdownCallbackRegistryTest.java    |  29 ++---
 .../logging/log4j/core/util/SystemClockTest.java   |   8 +-
 .../log4j/core/util/SystemNanoClockTest.java       |  78 ++++++------
 .../logging/log4j/core/util/ThrowablesTest.java    |  30 ++---
 .../apache/logging/log4j/core/util/UuidTest.java   |  20 ++-
 .../logging/log4j/core/util/WatchHttpTest.java     |   2 +-
 .../logging/log4j/core/util/WatchManagerTest.java  |  28 ++---
 .../logging/log4j/junit/AppenderResolver.java      |  54 ++++++++
 .../logging/log4j/junit/ConfigurationResolver.java |  39 ++++++
 .../logging/log4j/junit/LoggerContextResolver.java | 106 ++++++++++++++++
 .../logging/log4j/junit/LoggerContextSource.java   |  56 +++++++++
 .../java/org/apache/logging/log4j/junit/Named.java |  24 ++--
 .../MutableLogEventWithReusableParamMsgTest.java   |   2 +-
 .../template/JsonTemplateLayoutGcFreeTest.java     |   3 +
 pom.xml                                            |   1 +
 65 files changed, 1113 insertions(+), 1076 deletions(-)

diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/ProcessIdUtilTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/util/ProcessIdUtilTest.java
index 423532d..6a8b129 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/ProcessIdUtilTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/util/ProcessIdUtilTest.java
@@ -16,15 +16,15 @@
  */
 package org.apache.logging.log4j.util;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 public class ProcessIdUtilTest {
 
     @Test
-    public void processIdTest() throws Exception {
-        final String processId = ProcessIdUtil.getProcessId();
-        assertFalse("ProcessId is default", processId.equals(ProcessIdUtil.DEFAULT_PROCESSID));
+    public void processIdTest() {
+        String processId = ProcessIdUtil.getProcessId();
+        assertNotEquals(processId, ProcessIdUtil.DEFAULT_PROCESSID, "ProcessId is default");
     }
 }
diff --git a/log4j-core/pom.xml b/log4j-core/pom.xml
index 8b4ba48..47f3ce5 100644
--- a/log4j-core/pom.xml
+++ b/log4j-core/pom.xml
@@ -196,6 +196,10 @@
       <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-params</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.hamcrest</groupId>
       <artifactId>hamcrest-all</artifactId>
       <scope>test</scope>
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelJsonTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelJsonTest.java
index fb28cf0..f09a3a2 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelJsonTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelJsonTest.java
@@ -18,39 +18,33 @@ package org.apache.logging.log4j.core;
 
 import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.MarkerManager;
-import org.apache.logging.log4j.categories.Configurations;
-import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.apache.logging.log4j.junit.Named;
+import org.apache.logging.log4j.junit.LoggerContextSource;
 import org.apache.logging.log4j.test.appender.ListAppender;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
 
+import static org.hamcrest.MatcherAssert.*;
 import static org.hamcrest.Matchers.hasSize;
-import static org.junit.Assert.*;
 
-/**
- *
- */
-@Category(Configurations.Json.class)
+@Tag("json")
+@LoggerContextSource("log4j-reference-level.json")
 public class AppenderRefLevelJsonTest {
 
-    private static final String CONFIG = "log4j-reference-level.json";
-    private ListAppender app1;
-    private ListAppender app2;
-
-    @ClassRule
-    public static LoggerContextRule context = new LoggerContextRule(CONFIG);
+    private final ListAppender app1;
+    private final ListAppender app2;
 
-    org.apache.logging.log4j.Logger logger1 = context.getLogger("org.apache.logging.log4j.test1");
-    org.apache.logging.log4j.Logger logger2 = context.getLogger("org.apache.logging.log4j.test2");
-    org.apache.logging.log4j.Logger logger3 = context.getLogger("org.apache.logging.log4j.test3");
+    org.apache.logging.log4j.Logger logger1;
+    org.apache.logging.log4j.Logger logger2;
+    org.apache.logging.log4j.Logger logger3;
     Marker testMarker = MarkerManager.getMarker("TEST");
 
-    @Before
-    public void before() {
-        app1 = context.getListAppender("LIST1").clear();
-        app2 = context.getListAppender("LIST2").clear();
+    public AppenderRefLevelJsonTest(final LoggerContext context, @Named("LIST1") final ListAppender first, @Named("LIST2") final ListAppender second) {
+        logger1 = context.getLogger("org.apache.logging.log4j.test1");
+        logger2 = context.getLogger("org.apache.logging.log4j.test2");
+        logger3 = context.getLogger("org.apache.logging.log4j.test3");
+        app1 = first.clear();
+        app2 = second.clear();
     }
 
     @Test
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java
index 861ed87..dbe5658 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/AppenderRefLevelTest.java
@@ -20,37 +20,32 @@ import java.util.List;
 
 import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.MarkerManager;
-import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.apache.logging.log4j.junit.Named;
+import org.apache.logging.log4j.junit.LoggerContextSource;
 import org.apache.logging.log4j.test.appender.ListAppender;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
-/**
- *
- */
+@LoggerContextSource("log4j-reference-level.xml")
 public class AppenderRefLevelTest {
 
-    private static final String CONFIG = "log4j-reference-level.xml";
-    private ListAppender app1;
-    private ListAppender app2;
+    private final ListAppender app1;
+    private final ListAppender app2;
 
-    @ClassRule
-    public static LoggerContextRule context = new LoggerContextRule(CONFIG);
+    public AppenderRefLevelTest(final LoggerContext context, @Named("LIST1") final ListAppender first, @Named("LIST2") final ListAppender second) {
+        logger1 = context.getLogger("org.apache.logging.log4j.test1");
+        logger2 = context.getLogger("org.apache.logging.log4j.test2");
+        logger3 = context.getLogger("org.apache.logging.log4j.test3");
+        app1 = first.clear();
+        app2 = second.clear();
+    }
 
-    org.apache.logging.log4j.Logger logger1 = context.getLogger("org.apache.logging.log4j.test1");
-    org.apache.logging.log4j.Logger logger2 = context.getLogger("org.apache.logging.log4j.test2");
-    org.apache.logging.log4j.Logger logger3 = context.getLogger("org.apache.logging.log4j.test3");
+    org.apache.logging.log4j.Logger logger1;
+    org.apache.logging.log4j.Logger logger2;
+    org.apache.logging.log4j.Logger logger3;
     Marker testMarker = MarkerManager.getMarker("TEST");
 
-    @Before
-    public void before() {
-        app1 = context.getListAppender("LIST1").clear();
-        app2 = context.getListAppender("LIST2").clear();
-    }
-
     @Test
     public void logger1() {
         logger1.traceEntry();
@@ -60,9 +55,9 @@ public class AppenderRefLevelTest {
         logger1.warn("warn Message");
         logger1.traceExit();
         List<LogEvent> events = app1.getEvents();
-        assertEquals("Incorrect number of events. Expected 6, actual " + events.size(), 6, events.size());
+        assertEquals(6, events.size(), "Incorrect number of events. Expected 6, actual " + events.size());
         events = app2.getEvents();
-        assertEquals("Incorrect number of events. Expected 1, actual " + events.size(), 1, events.size());
+        assertEquals(1, events.size(), "Incorrect number of events. Expected 1, actual " + events.size());
     }
 
     @Test
@@ -74,9 +69,9 @@ public class AppenderRefLevelTest {
         logger2.warn("warn Message");
         logger2.traceExit();
         List<LogEvent> events = app1.getEvents();
-        assertEquals("Incorrect number of events. Expected 2, actual " + events.size(), events.size(), 2);
+        assertEquals(events.size(), 2, "Incorrect number of events. Expected 2, actual " + events.size());
         events = app2.getEvents();
-        assertEquals("Incorrect number of events. Expected 4, actual " + events.size(), events.size(), 4);
+        assertEquals(events.size(), 4, "Incorrect number of events. Expected 4, actual " + events.size());
     }
 
     @Test
@@ -88,7 +83,7 @@ public class AppenderRefLevelTest {
         logger3.warn("warn Message");
         logger3.traceExit();
         final List<LogEvent> events = app1.getEvents();
-        assertEquals("Incorrect number of events. Expected 4, actual " + events.size(), 4, events.size());
+        assertEquals(4, events.size(), "Incorrect number of events. Expected 4, actual " + events.size());
     }
 }
 
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/BasicLoggingTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/BasicLoggingTest.java
index b25844f..568cf06 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/BasicLoggingTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/BasicLoggingTest.java
@@ -18,11 +18,10 @@ package org.apache.logging.log4j.core;
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
-import org.junit.Test;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
 
-/**
- *
- */
+@Tag("smoke")
 public class BasicLoggingTest {
 
     @Test
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/CollectionLoggingTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/CollectionLoggingTest.java
index d1ca640..791a370 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/CollectionLoggingTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/CollectionLoggingTest.java
@@ -16,38 +16,32 @@
  */
 package org.apache.logging.log4j.core;
 
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.junit.LoggerContextSource;
+import org.apache.logging.log4j.junit.Named;
+import org.apache.logging.log4j.message.StringMapMessage;
+import org.apache.logging.log4j.test.appender.ListAppender;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
 import java.net.NetworkInterface;
 import java.net.SocketException;
 import java.nio.charset.Charset;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.junit.LoggerContextRule;
-import org.apache.logging.log4j.message.StringMapMessage;
-import org.apache.logging.log4j.test.appender.ListAppender;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Test;
-
-/**
- * TODO: Work in progress.
- */
+@LoggerContextSource("log4j-collectionLogging.xml")
+@Disabled("Work in progress")
 public class CollectionLoggingTest {
 
-    private static final String CONFIG = "log4j-collectionLogging.xml";
-    private ListAppender app;
-
-    @ClassRule
-    public static LoggerContextRule context = new LoggerContextRule(CONFIG);
+    private final ListAppender app;
 
-    @Before
-    public void before() {
-        app = context.getListAppender("List").clear();
+    public CollectionLoggingTest(@Named("List") final ListAppender app) {
+        this.app = app.clear();
     }
 
     @Test
-    public void testSystemProperties() {
+    public void testSystemProperties(final LoggerContext context) {
         final Logger logger = context.getLogger(CollectionLoggingTest.class.getName());
         logger.error(System.getProperties());
         // logger.error(new MapMessage(System.getProperties()));
@@ -55,7 +49,7 @@ public class CollectionLoggingTest {
     }
 
     @Test
-    public void testSimpleMap() {
+    public void testSimpleMap(final LoggerContext context) {
         final Logger logger = context.getLogger(CollectionLoggingTest.class.getName());
         logger.error(System.getProperties());
         final Map<String, String> map = new HashMap<>();
@@ -67,14 +61,14 @@ public class CollectionLoggingTest {
     }
 
     @Test
-    public void testNetworkInterfaces() throws SocketException {
+    public void testNetworkInterfaces(final LoggerContext context) throws SocketException {
         final Logger logger = context.getLogger(CollectionLoggingTest.class.getName());
         logger.error(NetworkInterface.getNetworkInterfaces());
         // TODO: some assertions
     }
 
     @Test
-    public void testAvailableCharsets() throws SocketException {
+    public void testAvailableCharsets(final LoggerContext context) {
         final Logger logger = context.getLogger(CollectionLoggingTest.class.getName());
         logger.error(Charset.availableCharsets());
         // TODO: some assertions
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsOverrideTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsOverrideTest.java
index 2fed8af..50c63ed 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsOverrideTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsOverrideTest.java
@@ -16,37 +16,31 @@
  */
 package org.apache.logging.log4j.core;
 
+import static org.hamcrest.MatcherAssert.*;
 import static org.hamcrest.Matchers.hasSize;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
+import static org.junit.jupiter.api.Assertions.*;
 
 import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.apache.logging.log4j.junit.Named;
+import org.apache.logging.log4j.junit.LoggerContextSource;
 import org.apache.logging.log4j.test.appender.ListAppender;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
+@LoggerContextSource("log4j-customLevels.xml")
 public class CustomLevelsOverrideTest {
 
-    private static final String CONFIG = "log4j-customLevels.xml";
+    private final ListAppender listAppender;
+    private final Level warnLevel;
+    private final Level infoLevel;
+    private final Level debugLevel;
+    private final Logger logger;
 
-    @ClassRule
-    public static LoggerContextRule context = new LoggerContextRule(CONFIG);
-
-    private ListAppender listAppender;
-    private Level warnLevel;
-    private Level infoLevel;
-    private Level debugLevel;
-
-    @Before
-    public void before() {
+    public CustomLevelsOverrideTest(final LoggerContext context, @Named("List1") final ListAppender appender) {
         warnLevel = Level.getLevel("WARN");
         infoLevel = Level.getLevel("INFO");
         debugLevel = Level.getLevel("DEBUG");
-        listAppender = context.getListAppender("List1").clear();
+        listAppender = appender.clear();
+        logger = context.getLogger(getClass().getName());
     }
 
     @Test
@@ -75,7 +69,6 @@ public class CustomLevelsOverrideTest {
 
     @Test
     public void testLog() {
-        final Logger logger = context.getLogger();
         assertThat(listAppender.getEvents(), hasSize(0));
         logger.debug("Hello, {}", "World");
         assertThat(listAppender.getEvents(), hasSize(1));
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsTest.java
index 50c7abb..98978aa 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsTest.java
@@ -16,36 +16,31 @@
  */
 package org.apache.logging.log4j.core;
 
+import static org.hamcrest.MatcherAssert.*;
 import static org.hamcrest.Matchers.hasSize;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
+import static org.junit.jupiter.api.Assertions.*;
 
 import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.apache.logging.log4j.junit.Named;
+import org.apache.logging.log4j.junit.LoggerContextSource;
 import org.apache.logging.log4j.test.appender.ListAppender;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
+@LoggerContextSource("log4j-customLevels.xml")
 public class CustomLevelsTest {
 
-    private static final String CONFIG = "log4j-customLevels.xml";
+    private final ListAppender listAppender;
+    private final Level diagLevel;
+    private final Level noticeLevel;
+    private final Level verboseLevel;
+    private final Logger logger;
 
-    @ClassRule
-    public static LoggerContextRule context = new LoggerContextRule(CONFIG);
-
-    private ListAppender listAppender;
-    private Level diagLevel;
-    private Level noticeLevel;
-    private Level verboseLevel;
-
-    @Before
-    public void before() {
+    public CustomLevelsTest(final LoggerContext context, @Named("List1") final ListAppender appender) {
         diagLevel = Level.getLevel("DIAG");
         noticeLevel = Level.getLevel("NOTICE");
         verboseLevel = Level.getLevel("VERBOSE");
-        listAppender = context.getListAppender("List1").clear();
+        listAppender = appender.clear();
+        logger = context.getLogger(getClass().getName());
     }
 
     @Test
@@ -64,7 +59,6 @@ public class CustomLevelsTest {
 
     @Test
     public void testLog() {
-        final Logger logger = context.getLogger();
         assertThat(listAppender.getEvents(), hasSize(0));
         logger.debug("Hello, {}", "World");
         assertThat(listAppender.getEvents(), hasSize(1));
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsWithFiltersTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsWithFiltersTest.java
index 1808492..20b350d 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsWithFiltersTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/CustomLevelsWithFiltersTest.java
@@ -16,44 +16,33 @@
  */
 package org.apache.logging.log4j.core;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.core.appender.FileAppender;
 import org.apache.logging.log4j.core.config.Configuration;
 import org.apache.logging.log4j.core.filter.CompositeFilter;
 import org.apache.logging.log4j.core.filter.ThresholdFilter;
-import org.apache.logging.log4j.junit.LoggerContextRule;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Test;
-
-/**
- *
- */
-public class CustomLevelsWithFiltersTest {
+import org.apache.logging.log4j.junit.Named;
+import org.apache.logging.log4j.junit.LoggerContextSource;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
-    private static final String CONFIG = "log4j-customLevelsWithFilters.xml";
+import static org.junit.jupiter.api.Assertions.*;
 
-    @ClassRule
-    public static LoggerContextRule context = new LoggerContextRule(CONFIG);
+@LoggerContextSource("log4j-customLevelsWithFilters.xml")
+public class CustomLevelsWithFiltersTest {
 
     private Level infom1Level;
     private Level infop1Level;
 
-    @Before
+    @BeforeEach
     public void before() {
         infom1Level = Level.getLevel("INFOM1");
         infop1Level = Level.getLevel("INFOP1");
     }
 
     @Test
-    public void testConfiguration() {
-        final Configuration configuration = context.getConfiguration();
+    public void testConfiguration(final Configuration configuration, @Named("info") final FileAppender appender) {
         assertNotNull(configuration);
-        final FileAppender appender = configuration.getAppender("info");
         assertNotNull(appender);
         final CompositeFilter compFilter = (CompositeFilter) appender.getFilter();
         assertNotNull(compFilter);
@@ -67,7 +56,7 @@ public class CustomLevelsWithFiltersTest {
                 break;
             }
         }
-        Assert.assertTrue("Level not found: " + infom1Level, foundLevel);
+        assertTrue(foundLevel, "Level not found: " + infom1Level);
     }
 
     @Test
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/DeadlockTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/DeadlockTest.java
index 0e27cea..0f08f3e 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/DeadlockTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/DeadlockTest.java
@@ -16,22 +16,16 @@
  */
 package org.apache.logging.log4j.core;
 
-import org.apache.logging.log4j.junit.LoggerContextRule;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.apache.logging.log4j.junit.LoggerContextSource;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
 
-/**
- *
- */
+@LoggerContextSource("log4j-deadlock.xml")
+@Tag("concurrency")
 public class DeadlockTest {
 
-    private static final String CONFIG = "log4j-deadlock.xml";
-
-    @ClassRule
-    public static LoggerContextRule context = new LoggerContextRule(CONFIG);
-
     @Test
-    public void deadlockOnReconfigure() {
-        context.getLoggerContext().reconfigure();
+    public void deadlockOnReconfigure(final LoggerContext context) {
+        context.reconfigure();
     }
 }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/EventParameterMemoryLeakTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/EventParameterMemoryLeakTest.java
index 0205720..20e7972 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/EventParameterMemoryLeakTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/EventParameterMemoryLeakTest.java
@@ -19,8 +19,9 @@ package org.apache.logging.log4j.core;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.config.ConfigurationFactory;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
 
 import java.io.BufferedReader;
 import java.io.File;
@@ -30,12 +31,12 @@ import java.util.concurrent.TimeUnit;
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.containsString;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.*;
 
+@Tag("functional")
 public class EventParameterMemoryLeakTest {
 
-    @BeforeClass
+    @BeforeAll
     public static void beforeClass() {
         System.setProperty("log4j2.enable.threadlocals", "true");
         System.setProperty("log4j2.enable.direct.encoders", "true");
@@ -47,10 +48,10 @@ public class EventParameterMemoryLeakTest {
     @SuppressWarnings("UnusedAssignment") // parameter set to null to allow garbage collection
     public void testParametersAreNotLeaked() throws Exception {
         final File file = new File("target", "EventParameterMemoryLeakTest.log");
-        assertTrue("Deleted old file before test", !file.exists() || file.delete());
+        assertTrue(!file.exists() || file.delete(), "Deleted old file before test");
 
         final Logger log = LogManager.getLogger("com.foo.Bar");
-        final CountDownLatch latch = new CountDownLatch(1);
+        CountDownLatch latch = new CountDownLatch(1);
         Object parameter = new ParameterObject("paramValue", latch);
         log.info("Message with parameter {}", parameter);
         log.info(parameter);
@@ -70,11 +71,11 @@ public class EventParameterMemoryLeakTest {
         assertThat(line2, containsString("paramValue"));
         assertThat(line3, containsString("paramValue"));
         assertThat(line4, containsString("paramValue"));
-        assertNull("Expected only three lines", line5);
-        final GarbageCollectionHelper gcHelper = new GarbageCollectionHelper();
+        assertNull(line5, "Expected only three lines");
+        GarbageCollectionHelper gcHelper = new GarbageCollectionHelper();
         gcHelper.run();
         try {
-            assertTrue("Parameter should have been garbage collected", latch.await(30, TimeUnit.SECONDS));
+            assertTrue(latch.await(30, TimeUnit.SECONDS), "Parameter should have been garbage collected");
         } finally {
             gcHelper.close();
         }
@@ -83,7 +84,7 @@ public class EventParameterMemoryLeakTest {
     private static final class ParameterObject {
         private final String value;
         private final CountDownLatch latch;
-        ParameterObject(final String value, final CountDownLatch latch) {
+        ParameterObject(String value, CountDownLatch latch) {
             this.value = value;
             this.latch = latch;
         }
@@ -103,7 +104,7 @@ public class EventParameterMemoryLeakTest {
     private static final class ObjectThrowable extends RuntimeException {
         private final Object object;
 
-        ObjectThrowable(final Object object) {
+        ObjectThrowable(Object object) {
             super(String.valueOf(object));
             this.object = object;
         }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/ExtendedLevelTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/ExtendedLevelTest.java
index 8126197..d9ceb4f 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/ExtendedLevelTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/ExtendedLevelTest.java
@@ -16,54 +16,47 @@
  */
 package org.apache.logging.log4j.core;
 
-import java.util.List;
-
 import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.apache.logging.log4j.junit.Named;
+import org.apache.logging.log4j.junit.LoggerContextSource;
 import org.apache.logging.log4j.test.ExtendedLevels;
 import org.apache.logging.log4j.test.appender.ListAppender;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import java.util.List;
 
+import static org.hamcrest.MatcherAssert.*;
 import static org.hamcrest.Matchers.hasSize;
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
-/**
- *
- */
+@LoggerContextSource("log4j-customLevel.xml")
 public class ExtendedLevelTest {
 
-    private static final String CONFIG = "log4j-customLevel.xml";
-    private ListAppender list1;
-    private ListAppender list2;
-
-    @ClassRule
-    public static LoggerContextRule context = new LoggerContextRule(CONFIG);
+    private final ListAppender list1;
+    private final ListAppender list2;
 
-    @Before
-    public void before() {
-        list1 = context.getListAppender("List1").clear();
-        list2 = context.getListAppender("List2").clear();
+    public ExtendedLevelTest(@Named("List1") final ListAppender list1, @Named("List2") final ListAppender list2) {
+        this.list1 = list1.clear();
+        this.list2 = list2.clear();
     }
 
     @Test
-    public void testLevelLogging() {
+    public void testLevelLogging(final LoggerContext context) {
         org.apache.logging.log4j.Logger logger = context.getLogger("org.apache.logging.log4j.test1");
         logger.log(ExtendedLevels.DETAIL, "Detail message");
         logger.log(Level.DEBUG, "Debug message");
         List<LogEvent> events = list1.getEvents();
-        assertNotNull("No events", events);
+        assertNotNull(events, "No events");
         assertThat(events, hasSize(1));
         LogEvent event = events.get(0);
-        assertEquals("Expected level DETAIL, got" + event.getLevel(), "DETAIL", event.getLevel().name());
+        assertEquals("DETAIL", event.getLevel().name(), "Expected level DETAIL, got" + event.getLevel());
         logger = context.getLogger("org.apache.logging.log4j.test2");
         logger.log(ExtendedLevels.NOTE, "Note message");
         logger.log(Level.INFO, "Info message");
         events = list2.getEvents();
-        assertNotNull("No events", events);
+        assertNotNull(events, "No events");
         assertThat(events, hasSize(1));
         event = events.get(0);
-        assertEquals("Expected level NOTE, got" + event.getLevel(), "NOTE", event.getLevel().name());
+        assertEquals("NOTE", event.getLevel().name(), "Expected level NOTE, got" + event.getLevel());
     }
 }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeAsynchronousLoggingTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeAsynchronousLoggingTest.java
index 9fb661f..286a113 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeAsynchronousLoggingTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeAsynchronousLoggingTest.java
@@ -16,17 +16,17 @@
  */
 package org.apache.logging.log4j.core;
 
-import org.apache.logging.log4j.categories.AsyncLoggers;
 import org.apache.logging.log4j.core.async.AsyncLoggerContextSelector;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
 
 /**
  * Verifies steady state logging is GC-free.
  *
  * @see <a href="https://github.com/google/allocation-instrumenter">https://github.com/google/allocation-instrumenter</a>
  */
-@Category(AsyncLoggers.class)
+@Tag("allocation")
+@Tag("functional")
 public class GcFreeAsynchronousLoggingTest {
 
     @Test
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeLoggingTestUtil.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeLoggingTestUtil.java
index 26ea145..72d49e1 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeLoggingTestUtil.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeLoggingTestUtil.java
@@ -33,8 +33,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.regex.Pattern;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /**
  * Utility methods for the GC-free logging tests.
@@ -49,9 +49,9 @@ public enum GcFreeLoggingTestUtil {;
         System.setProperty("log4j2.is.webapp", "false");
         System.setProperty("log4j.configurationFile", configurationFile);
 
-        assertTrue("Constants.ENABLE_THREADLOCALS", Constants.ENABLE_THREADLOCALS);
-        assertTrue("Constants.ENABLE_DIRECT_ENCODERS", Constants.ENABLE_DIRECT_ENCODERS);
-        assertFalse("Constants.IS_WEB_APP", Constants.IS_WEB_APP);
+        assertTrue(Constants.ENABLE_THREADLOCALS, "Constants.ENABLE_THREADLOCALS");
+        assertTrue(Constants.ENABLE_DIRECT_ENCODERS, "Constants.ENABLE_DIRECT_ENCODERS");
+        assertFalse(Constants.IS_WEB_APP, "Constants.IS_WEB_APP");
 
         final MyCharSeq myCharSeq = new MyCharSeq();
         final Marker testGrandParent = MarkerManager.getMarker("testGrandParent");
@@ -163,15 +163,15 @@ public enum GcFreeLoggingTestUtil {;
                                 "key2=value2, prop1=value1, prop2=value2} " +
                                 "This message is logged to the console"));
                 assertTrue(
-                        "pattern mismatch at line 1: " + line,
-                        line.matches(firstLinePattern));
+                        line.matches(firstLinePattern),
+                        "pattern mismatch at line 1: " + line);
             }
 
             // Check the rest of the lines.
             else {
                 assertFalse(
-                        "(allocated|array) pattern matches at line " + lineNumber + ": " + line,
-                        line.contains("allocated") || line.contains("array"));
+                        line.contains("allocated") || line.contains("array"),
+                        "(allocated|array) pattern matches at line " + lineNumber + ": " + line);
             }
 
         });
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeMixedSyncAyncLoggingTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeMixedSyncAyncLoggingTest.java
index 93ddc2c..ed844d0 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeMixedSyncAyncLoggingTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeMixedSyncAyncLoggingTest.java
@@ -16,13 +16,16 @@
  */
 package org.apache.logging.log4j.core;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
 
 /**
  * Verifies steady state mixed synchronous and asynchronous logging is GC-free.
  *
  * @see <a href="https://github.com/google/allocation-instrumenter">https://github.com/google/allocation-instrumenter</a>
  */
+@Tag("allocation")
+@Tag("functional")
 public class GcFreeMixedSyncAyncLoggingTest {
 
     @Test
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeSynchronousLoggingTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeSynchronousLoggingTest.java
index 8ab6e8b..99648de 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeSynchronousLoggingTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/GcFreeSynchronousLoggingTest.java
@@ -16,13 +16,16 @@
  */
 package org.apache.logging.log4j.core;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
 
 /**
  * Verifies steady state synchronous logging is GC-free.
  *
  * @see <a href="https://github.com/google/allocation-instrumenter">https://github.com/google/allocation-instrumenter</a>
  */
+@Tag("allocation")
+@Tag("functional")
 public class GcFreeSynchronousLoggingTest {
 
     @Test
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/HostNameTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/HostNameTest.java
index 9d036ad..86b5e07 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/HostNameTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/HostNameTest.java
@@ -20,53 +20,46 @@ import java.util.List;
 
 import org.apache.logging.log4j.core.appender.RollingFileAppender;
 import org.apache.logging.log4j.core.util.NetUtils;
-import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.apache.logging.log4j.junit.Named;
+import org.apache.logging.log4j.junit.LoggerContextSource;
 import org.apache.logging.log4j.test.appender.ListAppender;
 import org.apache.logging.log4j.util.Strings;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
+import static org.hamcrest.MatcherAssert.*;
 import static org.hamcrest.Matchers.endsWith;
 import static org.hamcrest.Matchers.hasSize;
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
-/**
- *
- */
+@LoggerContextSource("log4j-test2.xml")
 public class HostNameTest {
 
-    private static final String CONFIG = "log4j-test2.xml";
-    private ListAppender host;
-    private RollingFileAppender hostFile;
-
-    @ClassRule
-    public static LoggerContextRule context = new LoggerContextRule(CONFIG);
+    private final ListAppender host;
+    private final RollingFileAppender hostFile;
 
-    @Before
-    public void before() {
-        host = context.getListAppender("HostTest").clear();
-        hostFile = context.getRequiredAppender("HostFile", RollingFileAppender.class);
+    public HostNameTest(@Named("HostTest") final ListAppender list, @Named("HostFile") final RollingFileAppender rolling) {
+        host = list.clear();
+        hostFile = rolling;
     }
 
     @Test
-    public void testHostname() {
+    public void testHostname(final LoggerContext context) {
         final org.apache.logging.log4j.Logger testLogger = context.getLogger("org.apache.logging.log4j.hosttest");
         testLogger.debug("Hello, {}", "World");
         final List<String> msgs = host.getMessages();
         assertThat(msgs, hasSize(1));
         String expected = NetUtils.getLocalHostname() + Strings.LINE_SEPARATOR;
         assertThat(msgs.get(0), endsWith(expected));
-        assertNotNull("No Host FileAppender file name", hostFile.getFileName());
+        assertNotNull(hostFile.getFileName(), "No Host FileAppender file name");
         expected = "target/" + NetUtils.getLocalHostname() + ".log";
         String name = hostFile.getFileName();
-        assertEquals("Incorrect HostFile FileAppender file name - expected " + expected + " actual - " + name, name,
-            expected);
+        assertEquals(name,
+            expected, "Incorrect HostFile FileAppender file name - expected " + expected + " actual - " + name);
         name = hostFile.getFilePattern();
-        assertNotNull("No file pattern", name);
+        assertNotNull(name, "No file pattern");
         expected = "target/" + NetUtils.getLocalHostname() + "-%d{MM-dd-yyyy}-%i.log";
-        assertEquals("Incorrect HostFile FileAppender file pattern - expected " + expected + " actual - " + name, name,
-            expected);
+        assertEquals(name,
+            expected, "Incorrect HostFile FileAppender file pattern - expected " + expected + " actual - " + name);
 
     }
 }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/LateConfigTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/LateConfigTest.java
index 0421e18..9439232 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/LateConfigTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/LateConfigTest.java
@@ -16,9 +16,6 @@
  */
 package org.apache.logging.log4j.core;
 
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
 import java.io.File;
 
 import org.apache.logging.log4j.core.config.Configuration;
@@ -26,24 +23,25 @@ import org.apache.logging.log4j.core.config.Configurator;
 import org.apache.logging.log4j.core.config.DefaultConfiguration;
 import org.apache.logging.log4j.core.config.xml.XmlConfiguration;
 import org.apache.logging.log4j.status.StatusLogger;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
 
-/**
- *
- */
+import static org.junit.jupiter.api.Assertions.*;
+
+@Tag("functional")
 public class LateConfigTest {
 
     private static final String CONFIG = "target/test-classes/log4j-test1.xml";
     private static LoggerContext context;
 
-    @BeforeClass
+    @BeforeAll
     public static void setupClass() {
         context = LoggerContext.getContext(false);
     }
 
-    @AfterClass
+    @AfterAll
     public static void tearDownClass() {
         Configurator.shutdown(context);
         StatusLogger.getLogger().reset();
@@ -52,17 +50,17 @@ public class LateConfigTest {
     @Test
     public void testReconfiguration() throws Exception {
         final Configuration cfg = context.getConfiguration();
-        assertNotNull("No configuration", cfg);
-        assertTrue("Not set to default configuration", cfg instanceof DefaultConfiguration);
+        assertNotNull(cfg, "No configuration");
+        assertTrue(cfg instanceof DefaultConfiguration, "Not set to default configuration");
         final File file = new File(CONFIG);
         final LoggerContext loggerContext = LoggerContext.getContext(null, false, file.toURI());
-        assertNotNull("No Logger Context", loggerContext);
+        assertNotNull(loggerContext, "No Logger Context");
         final Configuration newConfig = loggerContext.getConfiguration();
-        assertTrue("Configuration not reset", cfg != newConfig);
-        assertTrue("Reconfiguration failed", newConfig instanceof XmlConfiguration);
+        assertNotSame(cfg, newConfig, "Configuration not reset");
+        assertTrue(newConfig instanceof XmlConfiguration, "Reconfiguration failed");
         context = LoggerContext.getContext(false);
         final Configuration sameConfig = context.getConfiguration();
-        assertTrue("Configuration should not have been reset", newConfig == sameConfig);
+        assertSame(newConfig, sameConfig, "Configuration should not have been reset");
     }
 }
 
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/LevelTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/LevelTest.java
index a21c90c..393751b 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/LevelTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/LevelTest.java
@@ -22,43 +22,39 @@ import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.MarkerManager;
-import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.apache.logging.log4j.junit.Named;
+import org.apache.logging.log4j.junit.LoggerContextSource;
 import org.apache.logging.log4j.message.Message;
 import org.apache.logging.log4j.message.ObjectMessage;
 import org.apache.logging.log4j.test.appender.ListAppender;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
+import static org.hamcrest.MatcherAssert.*;
 import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
-/**
- *
- */
+@LoggerContextSource("log4j-Level.xml")
 public class LevelTest {
 
-    private static final String CONFIG = "log4j-Level.xml";
-    private ListAppender listAll;
-    private ListAppender listTrace;
-    private ListAppender listDebug;
-    private ListAppender listInfo;
-    private ListAppender listWarn;
-    private ListAppender listError;
-    private ListAppender listFatal;
-
-    @ClassRule
-    public static LoggerContextRule context = new LoggerContextRule(CONFIG);
+    private final ListAppender listAll;
+    private final ListAppender listTrace;
+    private final ListAppender listDebug;
+    private final ListAppender listInfo;
+    private final ListAppender listWarn;
+    private final ListAppender listError;
+    private final ListAppender listFatal;
 
-    @Before
-    public void before() {
-        listAll = context.getListAppender("ListAll").clear();
-        listTrace = context.getListAppender("ListTrace").clear();
-        listDebug = context.getListAppender("ListDebug").clear();
-        listInfo = context.getListAppender("ListInfo").clear();
-        listWarn = context.getListAppender("ListWarn").clear();
-        listError = context.getListAppender("ListError").clear();
-        listFatal = context.getListAppender("ListFatal").clear();
+    public LevelTest(@Named("ListAll") final ListAppender listAll, @Named("ListTrace") final ListAppender listTrace,
+            @Named("ListDebug") final ListAppender listDebug, @Named("ListInfo") final ListAppender listInfo,
+            @Named("ListWarn") final ListAppender listWarn, @Named("ListError") final ListAppender listError,
+            @Named("ListFatal") final ListAppender listFatal) {
+        this.listAll = listAll.clear();
+        this.listTrace = listTrace.clear();
+        this.listDebug = listDebug.clear();
+        this.listInfo = listInfo.clear();
+        this.listWarn = listWarn.clear();
+        this.listError = listError.clear();
+        this.listFatal = listFatal.clear();
     }
 
     // Helper class
@@ -77,7 +73,7 @@ public class LevelTest {
     }
 
     @Test
-    public void testLevelLogging() {
+    public void testLevelLogging(final LoggerContext context) {
         final Marker marker = MarkerManager.getMarker("marker");
         final Message msg = new ObjectMessage("msg");
         final Throwable t = new Throwable("test");
@@ -119,12 +115,12 @@ public class LevelTest {
         for (final Expected expected : expectedResults) {
             final String description = expected.description;
             final List<LogEvent> events = expected.appender.getEvents();
-            assertNotNull(description + ": No events", events);
+            assertNotNull(events, description + ": No events");
             assertThat(events, hasSize(expected.expectedEventCount));
             final LogEvent event = events.get(0);
             assertEquals(
-                description + ": Expected level " + expected.expectedInitialEventLevel + ", got" + event.getLevel(),
-                event.getLevel().name(), expected.expectedInitialEventLevel);
+                    event.getLevel().name(), expected.expectedInitialEventLevel,
+                    description + ": Expected level " + expected.expectedInitialEventLevel + ", got" + event.getLevel());
         }
     }
 }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/Log4j1222Test.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/Log4j1222Test.java
index 1e3f5d5..073dfaa 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/Log4j1222Test.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/Log4j1222Test.java
@@ -19,13 +19,15 @@ package org.apache.logging.log4j.core;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.TestLogger;
-import org.junit.Test;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
 
 import static org.junit.Assert.assertTrue;
 
 /**
  * Tests logging during shutdown.
  */
+@Tag("functional")
 public class Log4j1222Test
 {
 
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/LogEventFactoryTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/LogEventFactoryTest.java
index 1ac73bd..e3a5adb 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/LogEventFactoryTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/LogEventFactoryTest.java
@@ -39,8 +39,6 @@ import org.junit.Before;
 import org.junit.ClassRule;
 import org.junit.Test;
 import org.junit.rules.RuleChain;
-import org.junit.rules.TestRule;
-import org.junit.runner.Description;
 import org.junit.runners.model.Statement;
 
 /**
@@ -55,28 +53,23 @@ public class LogEventFactoryTest {
 
     // this would look so cool using lambdas
     @ClassRule
-    public static RuleChain chain = RuleChain.outerRule(new TestRule() {
+    public static RuleChain chain = RuleChain.outerRule((base, description) -> new Statement() {
         @Override
-        public Statement apply(final Statement base, final Description description) {
-            return new Statement() {
-                @Override
-                public void evaluate() throws Throwable {
-                    System.setProperty(Constants.LOG4J_LOG_EVENT_FACTORY, TestLogEventFactory.class.getName());
-                    resetLogEventFactory(new TestLogEventFactory());
-                    try {
-                        base.evaluate();
-                    } finally {
-                        System.clearProperty(Constants.LOG4J_LOG_EVENT_FACTORY);
-                        resetLogEventFactory(new DefaultLogEventFactory());
-                    }
-                }
+        public void evaluate() throws Throwable {
+            System.setProperty(Constants.LOG4J_LOG_EVENT_FACTORY, TestLogEventFactory.class.getName());
+            resetLogEventFactory(new TestLogEventFactory());
+            try {
+                base.evaluate();
+            } finally {
+                System.clearProperty(Constants.LOG4J_LOG_EVENT_FACTORY);
+                resetLogEventFactory(new DefaultLogEventFactory());
+            }
+        }
 
-                private void resetLogEventFactory(final LogEventFactory logEventFactory) throws IllegalAccessException {
-                    final Field field = FieldUtils.getField(LoggerConfig.class, "LOG_EVENT_FACTORY", true);
-                    FieldUtils.removeFinalModifier(field, true);
-                    FieldUtils.writeStaticField(field, logEventFactory, false);
-                }
-            };
+        private void resetLogEventFactory(final LogEventFactory logEventFactory) throws IllegalAccessException {
+            final Field field = FieldUtils.getField(LoggerConfig.class, "LOG_EVENT_FACTORY", true);
+            FieldUtils.removeFinalModifier(field, true);
+            FieldUtils.writeStaticField(field, logEventFactory, false);
         }
     }).around(context);
 
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/LogEventTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/LogEventTest.java
index 3aa0559..85c74a1 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/LogEventTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/LogEventTest.java
@@ -28,10 +28,10 @@ import org.apache.logging.log4j.core.impl.Log4jLogEvent;
 import org.apache.logging.log4j.message.Message;
 import org.apache.logging.log4j.message.SimpleMessage;
 import org.apache.logging.log4j.util.FilteredObjectInputStream;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  *
@@ -98,9 +98,9 @@ public class LogEventTest {
         final ObjectInputStream ois = new FilteredObjectInputStream(bais);
 
         final LogEvent actual = (LogEvent) ois.readObject();
-        assertNotEquals("Different event: nanoTime", copy, actual);
-        assertNotEquals("Different nanoTime", copy.getNanoTime(), actual.getNanoTime());
-        assertEquals("deserialized nanoTime is zero", 0, actual.getNanoTime());
+        assertNotEquals(copy, actual, "Different event: nanoTime");
+        assertNotEquals(copy.getNanoTime(), actual.getNanoTime(), "Different nanoTime");
+        assertEquals(0, actual.getNanoTime(), "deserialized nanoTime is zero");
     }
 
     @Test
@@ -125,11 +125,11 @@ public class LogEventTest {
         final ObjectInputStream ois = new FilteredObjectInputStream(bais);
 
         final LogEvent actual = (LogEvent) ois.readObject();
-        assertEquals("both zero nanoTime", event2, actual);
+        assertEquals(event2, actual, "both zero nanoTime");
     }
 
     @Test
-    @Ignore
+    @Disabled
     public void testEquals() {
         final LogEvent event1 = Log4jLogEvent.newBuilder() //
                 .setLoggerName(this.getClass().getName()) //
@@ -149,15 +149,15 @@ public class LogEventTest {
                 .setLevel(Level.INFO) //
                 .setMessage(new SimpleMessage("Hello, world!")) //
                 .build();
-        assertNotEquals("Events should not be equal", event1, event2);
-        assertEquals("Events should be equal", event2, event3);
+        assertNotEquals(event1, event2, "Events should not be equal");
+        assertEquals(event2, event3, "Events should be equal");
     }
 
     @Test
     public void testLocation() {
         final StackTraceElement ste = TESTER.getEventSource(this.getClass().getName());
-        assertNotNull("No StackTraceElement", ste);
-        assertEquals("Incorrect event", this.getClass().getName(), ste.getClassName());
+        assertNotNull(ste, "No StackTraceElement");
+        assertEquals(this.getClass().getName(), ste.getClassName(), "Incorrect event");
     }
 
     private static class TestClass {
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerDateTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerDateTest.java
index a6a5ca2..f8bfde9 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerDateTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerDateTest.java
@@ -19,33 +19,25 @@ package org.apache.logging.log4j.core;
 import java.util.Calendar;
 
 import org.apache.logging.log4j.core.appender.FileAppender;
-import org.apache.logging.log4j.junit.LoggerContextRule;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.apache.logging.log4j.junit.Named;
+import org.apache.logging.log4j.junit.LoggerContextSource;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
-/**
- *
- */
+@LoggerContextSource("log4j-date.xml")
 public class LoggerDateTest {
 
-    private static final String CONFIG = "log4j-date.xml";
-    private FileAppender fileApp;
-
-    @ClassRule
-    public static LoggerContextRule context = new LoggerContextRule(CONFIG);
+    private final FileAppender fileApp;
 
-    @Before
-    public void before() {
-        fileApp = context.getRequiredAppender("File", FileAppender.class);
+    public LoggerDateTest(@Named("File") final FileAppender fileApp) {
+        this.fileApp = fileApp;
     }
 
     @Test
     public void testFileName() {
         final String name = fileApp.getFileName();
         final int year = Calendar.getInstance().get(Calendar.YEAR);
-        assertTrue("Date was not substituted: " + name, name.contains(Integer.toString(year)));
+        assertTrue(name.contains(Integer.toString(year)), "Date was not substituted: " + name);
     }
 }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java
index 2dbe83a..6d6f276 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerTest.java
@@ -16,22 +16,6 @@
  */
 package org.apache.logging.log4j.core;
 
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Marker;
@@ -40,7 +24,8 @@ import org.apache.logging.log4j.ThreadContext;
 import org.apache.logging.log4j.core.config.Configuration;
 import org.apache.logging.log4j.core.config.Configurator;
 import org.apache.logging.log4j.core.config.LoggerConfig;
-import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.apache.logging.log4j.junit.LoggerContextSource;
+import org.apache.logging.log4j.junit.Named;
 import org.apache.logging.log4j.message.Message;
 import org.apache.logging.log4j.message.MessageFactory;
 import org.apache.logging.log4j.message.ParameterizedMessageFactory;
@@ -50,42 +35,45 @@ import org.apache.logging.log4j.message.StructuredDataMessage;
 import org.apache.logging.log4j.spi.AbstractLogger;
 import org.apache.logging.log4j.spi.MessageFactory2Adapter;
 import org.apache.logging.log4j.test.appender.ListAppender;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TestName;
-
-public class LoggerTest {
+import org.hamcrest.MatcherAssert;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
 
-    private static final String CONFIG = "log4j-test2.xml";
+import java.io.File;
+import java.lang.reflect.Method;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
 
-    @Rule
-    public final TestName testName = new TestName();
-    private ListAppender app;
-    private ListAppender host;
-    private ListAppender noThrown;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.junit.jupiter.api.Assertions.*;
 
-    @Rule
-    public LoggerContextRule context = new LoggerContextRule(CONFIG);
+@LoggerContextSource(value = LoggerTest.CONFIG, reconfigure = true)
+public class LoggerTest {
 
-    private void assertEventCount(final List<LogEvent> events, final int expected) {
-        assertEquals("Incorrect number of events.", expected, events.size());
-    }
+    static final String CONFIG = "log4j-test2.xml";
+    org.apache.logging.log4j.Logger logger;
+    org.apache.logging.log4j.Logger loggerChild;
+    org.apache.logging.log4j.Logger loggerGrandchild;
+    private final ListAppender app;
+    private final ListAppender host;
+    private final ListAppender noThrown;
 
-    @Before
-    public void before() {
+    public LoggerTest(final LoggerContext context, @Named("List") final ListAppender app, @Named("HostTest") final ListAppender host, @Named("NoThrowable") final ListAppender noThrown) {
         logger = context.getLogger("LoggerTest");
         loggerChild = context.getLogger("LoggerTest.child");
         loggerGrandchild = context.getLogger("LoggerTest.child.grand");
-        //
-        app = context.getListAppender("List").clear();
-        host = context.getListAppender("HostTest").clear();
-        noThrown = context.getListAppender("NoThrowable").clear();
+        this.app = app.clear();
+        this.host = host.clear();
+        this.noThrown = noThrown.clear();
     }
 
-    org.apache.logging.log4j.Logger logger;
-    org.apache.logging.log4j.Logger loggerChild;
-    org.apache.logging.log4j.Logger loggerGrandchild;
+    private void assertEventCount(final List<LogEvent> events, final int expected) {
+        assertEquals(expected, events.size(), "Incorrect number of events.");
+    }
 
     @Test
     public void builder() {
@@ -95,10 +83,12 @@ public class LoggerTest {
         logger.atWarn().withThrowable(new Throwable("This is a test")).log((Message) new SimpleMessage("Log4j rocks!"));
         final List<LogEvent> events = app.getEvents();
         assertEventCount(events, 3);
-        assertEquals("Incorrect location", "org.apache.logging.log4j.core.LoggerTest.builder(LoggerTest.java:92)", events.get(0).getSource().toString());
-        assertEquals("Incorrect Level", Level.DEBUG, events.get(0).getLevel());
-        assertThat("Incorrect message", events.get(1).getMessage().getFormattedMessage(), equalTo("Hello John"));
-        assertNotNull("Missing Throwable", events.get(2).getThrown());
+        assertEquals(
+                "org.apache.logging.log4j.core.LoggerTest.builder(LoggerTest.java:80)", events.get(0).getSource().toString(),
+                "Incorrect location");
+        assertEquals(Level.DEBUG, events.get(0).getLevel(), "Incorrect Level");
+        MatcherAssert.assertThat("Incorrect message", events.get(1).getMessage().getFormattedMessage(), equalTo("Hello John"));
+        assertNotNull(events.get(2).getThrown(), "Missing Throwable");
     }
 
     @Test
@@ -201,7 +191,7 @@ public class LoggerTest {
     }
 
     @Test
-    public void debugChangeLevelsChildLoggers() {
+    public void debugChangeLevelsChildLoggers(final LoggerContext context) {
         final org.apache.logging.log4j.Logger loggerChild = context.getLogger(logger.getName() + ".child");
         // Use logger AND loggerChild
         logger.debug("Debug message 1");
@@ -271,8 +261,8 @@ public class LoggerTest {
     }
 
     @Test
-    public void getLogger_String_MessageFactoryMismatch() {
-        final Logger testLogger = testMessageFactoryMismatch(testName.getMethodName(),
+    public void getLogger_String_MessageFactoryMismatch(final TestInfo testInfo) {
+        final Logger testLogger = testMessageFactoryMismatch(testInfo.getTestMethod().map(Method::getName).orElseThrow(AssertionError::new),
                 StringFormatterMessageFactory.INSTANCE, ParameterizedMessageFactory.INSTANCE);
         testLogger.debug("%,d", Integer.MAX_VALUE);
         final List<LogEvent> events = app.getEvents();
@@ -281,8 +271,8 @@ public class LoggerTest {
     }
 
     @Test
-    public void getLogger_String_MessageFactoryMismatchNull() {
-        final Logger testLogger =  testMessageFactoryMismatch(testName.getMethodName(), StringFormatterMessageFactory.INSTANCE, null);
+    public void getLogger_String_MessageFactoryMismatchNull(final TestInfo testInfo) {
+        final Logger testLogger =  testMessageFactoryMismatch(testInfo.getTestMethod().map(Method::getName).orElseThrow(AssertionError::new), StringFormatterMessageFactory.INSTANCE, null);
         testLogger.debug("%,d", Integer.MAX_VALUE);
         final List<LogEvent> events = app.getEvents();
         assertEventCount(events, 1);
@@ -328,24 +318,24 @@ public class LoggerTest {
     }
 
     @Test
-    public void testImpliedThrowable() {
+    public void testImpliedThrowable(final LoggerContext context) {
         final org.apache.logging.log4j.Logger testLogger = context.getLogger("org.apache.logging.log4j.hosttest");
         testLogger.debug("This is a test", new Throwable("Testing"));
         final List<String> msgs = host.getMessages();
-        assertEquals("Incorrect number of messages. Expected 1, actual " + msgs.size(), 1, msgs.size());
+        assertEquals(1, msgs.size(), "Incorrect number of messages. Expected 1, actual " + msgs.size());
         final String expected = "java.lang.Throwable: Testing";
-        assertTrue("Incorrect message data", msgs.get(0).contains(expected));
+        assertTrue(msgs.get(0).contains(expected), "Incorrect message data");
     }
 
 
     @Test
-    public void testSuppressedThrowable() {
+    public void testSuppressedThrowable(final LoggerContext context) {
         final org.apache.logging.log4j.Logger testLogger = context.getLogger("org.apache.logging.log4j.nothrown");
         testLogger.debug("This is a test", new Throwable("Testing"));
         final List<String> msgs = noThrown.getMessages();
-        assertEquals("Incorrect number of messages. Expected 1, actual " + msgs.size(), 1, msgs.size());
+        assertEquals(1, msgs.size(), "Incorrect number of messages. Expected 1, actual " + msgs.size());
         final String suppressed = "java.lang.Throwable: Testing";
-        assertTrue("Incorrect message data", !msgs.get(0).contains(suppressed));
+        assertFalse(msgs.get(0).contains(suppressed), "Incorrect message data");
     }
 
 
@@ -375,13 +365,13 @@ public class LoggerTest {
     }
 
     @Test
-    public void testReconfiguration() throws Exception {
+    public void testReconfiguration(final LoggerContext context) throws Exception {
         final Configuration oldConfig = context.getConfiguration();
         final int MONITOR_INTERVAL_SECONDS = 5;
         final File file = new File("target/test-classes/" + CONFIG);
         final long orig = file.lastModified();
         final long newTime = orig + 10000;
-        assertTrue("setLastModified should have succeeded.", file.setLastModified(newTime));
+        assertTrue(file.setLastModified(newTime), "setLastModified should have succeeded.");
         TimeUnit.SECONDS.sleep(MONITOR_INTERVAL_SECONDS + 1);
         for (int i = 0; i < 17; ++i) {
             logger.debug("Reconfigure");
@@ -394,12 +384,12 @@ public class LoggerTest {
             Thread.sleep(50);
         }
         final Configuration newConfig = context.getConfiguration();
-        assertNotNull("No configuration", newConfig);
-        assertNotSame("Reconfiguration failed", newConfig, oldConfig);
+        assertNotNull(newConfig, "No configuration");
+        assertNotSame(newConfig, oldConfig, "Reconfiguration failed");
     }
 
     @Test
-    public void testAdditivity() throws Exception {
+    public void testAdditivity(final LoggerContext context) throws Exception {
         final Logger localLogger = context.getLogger("org.apache.test");
         localLogger.error("Test parent additivity");
         final List<LogEvent> events = app.getEvents();
@@ -407,25 +397,25 @@ public class LoggerTest {
     }
 
     @Test
-    public void testLevelInheritence() throws Exception {
+    public void testLevelInheritance(final LoggerContext context) throws Exception {
         final Configuration config = context.getConfiguration();
         final LoggerConfig loggerConfig = config.getLoggerConfig("org.apache.logging.log4j.core.LoggerTest");
         assertNotNull(loggerConfig);
         assertEquals(loggerConfig.getName(), "org.apache.logging.log4j.core.LoggerTest");
         assertEquals(loggerConfig.getLevel(), Level.DEBUG);
         final Logger localLogger = context.getLogger("org.apache.logging.log4j.core.LoggerTest");
-        assertTrue("Incorrect level - expected DEBUG, actual " + localLogger.getLevel(), localLogger.getLevel() == Level.DEBUG);
+        assertSame(localLogger.getLevel(), Level.DEBUG, "Incorrect level - expected DEBUG, actual " + localLogger.getLevel());
     }
 
     @Test
     public void paramWithExceptionTest() throws Exception {
         logger.error("Throwing with parameters {}", "TestParam", new NullPointerException("Test Exception"));
         final List<LogEvent> events = app.getEvents();
-        assertNotNull("Log event list not returned", events);
-        assertEquals("Incorrect number of log events", 1, events.size());
+        assertNotNull(events, "Log event list not returned");
+        assertEquals(1, events.size(), "Incorrect number of log events");
         final LogEvent event = events.get(0);
         final Throwable thrown = event.getThrown();
-        assertNotNull("No throwable present in log event", thrown);
+        assertNotNull(thrown, "No throwable present in log event");
         final Message msg = event.getMessage();
         assertEquals("Throwing with parameters {}", msg.getFormat());
         assertEquals("Throwing with parameters TestParam", msg.getFormattedMessage());
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerUpdateTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerUpdateTest.java
index 572e392..854fbef 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerUpdateTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggerUpdateTest.java
@@ -16,43 +16,35 @@
  */
 package org.apache.logging.log4j.core;
 
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.List;
-
-import org.apache.logging.log4j.*;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.core.config.Configuration;
 import org.apache.logging.log4j.core.config.LoggerConfig;
-import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.apache.logging.log4j.junit.Named;
+import org.apache.logging.log4j.junit.LoggerContextSource;
 import org.apache.logging.log4j.test.appender.ListAppender;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import java.util.List;
 
-/**
- *
- */
-public class LoggerUpdateTest {
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertSame;
 
-    private static final String CONFIG = "log4j-test2.xml";
-    private ListAppender app;
+@LoggerContextSource("log4j-test2.xml")
+public class LoggerUpdateTest {
 
-    @ClassRule
-    public static LoggerContextRule context = new LoggerContextRule(CONFIG);
+    private final ListAppender app;
 
-    @Before
-    public void before() {
-        app = context.getListAppender("List").clear();
+    public LoggerUpdateTest(@Named("List") final ListAppender app) {
+        this.app = app.clear();
     }
 
     @Test
-    public void resetLevel() {
+    public void resetLevel(final LoggerContext context) {
         final org.apache.logging.log4j.Logger logger = context.getLogger("com.apache.test");
         logger.traceEntry();
         List<LogEvent> events = app.getEvents();
-        assertEquals("Incorrect number of events. Expected 1, actual " + events.size(), 1, events.size());
+        assertEquals(1, events.size(), "Incorrect number of events. Expected 1, actual " + events.size());
         app.clear();
         final LoggerContext ctx = LoggerContext.getContext(false);
         final Configuration config = ctx.getConfiguration();
@@ -64,20 +56,16 @@ public class LoggerUpdateTest {
         ctx.updateLoggers();  // This causes all Loggers to refetch information from their LoggerConfig.
         logger.traceEntry();
         events = app.getEvents();
-        assertEquals("Incorrect number of events. Expected 0, actual " + events.size(), 0, events.size());
+        assertEquals(0, events.size(), "Incorrect number of events. Expected 0, actual " + events.size());
     }
 
     @Test
-    public void testUpdateLoggersPropertyListeners() throws Exception {
-        final LoggerContext ctx = context.getLoggerContext();
-        ctx.addPropertyChangeListener(new PropertyChangeListener() {
-            @Override
-            public void propertyChange(final PropertyChangeEvent evt) {
-                assertEquals(LoggerContext.PROPERTY_CONFIG, evt.getPropertyName());
-                assertSame(ctx, evt.getSource());
-            }
+    public void testUpdateLoggersPropertyListeners(final LoggerContext context) throws Exception {
+        context.addPropertyChangeListener(evt -> {
+            assertEquals(LoggerContext.PROPERTY_CONFIG, evt.getPropertyName());
+            assertSame(context, evt.getSource());
         });
-        ctx.updateLoggers();
+        context.updateLoggers();
     }
 }
 
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggingTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggingTest.java
deleted file mode 100644
index 0217d7b..0000000
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/LoggingTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core;
-
-import java.util.List;
-
-import org.apache.logging.log4j.junit.LoggerContextRule;
-import org.apache.logging.log4j.test.appender.ListAppender;
-import org.apache.logging.log4j.util.Timer;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TestName;
-
-import static org.junit.Assert.assertEquals;
-
-public class LoggingTest {
-
-    private static final String CONFIG = "log4j-list.xml";
-
-    @Rule
-    public final TestName testName = new TestName();
-    private ListAppender list;
-
-
-    @Rule
-    public LoggerContextRule context = new LoggerContextRule(CONFIG);
-
-    private void assertEventCount(final List<LogEvent> events, final int expected) {
-        assertEquals("Incorrect number of events.", expected, events.size());
-    }
-
-    @Before
-    public void before() {
-        logger = context.getLogger("LoggerTest");
-    }
-
-    org.apache.logging.log4j.Logger logger;
-
-    @Test
-    public void logTime() {
-        Timer timer = new Timer("initial");
-        timer.start();
-        logger.info("This is a test");
-        System.out.println(timer.stop());
-        timer = new Timer("more", 100);
-/*        timer.start();
-        for (int i=0; i < 100; ++i) {
-            logger.info("This is another test");
-        }
-        System.out.println(timer.stop());*/
-    }
-}
-
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/LookupTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/LookupTest.java
index 42c7f3c..0bab663 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/LookupTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/LookupTest.java
@@ -18,30 +18,23 @@ package org.apache.logging.log4j.core;
 
 import org.apache.logging.log4j.core.appender.ConsoleAppender;
 import org.apache.logging.log4j.core.layout.PatternLayout;
-import org.apache.logging.log4j.junit.LoggerContextRule;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.apache.logging.log4j.junit.Named;
+import org.apache.logging.log4j.junit.LoggerContextSource;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
-/**
- *
- */
+@LoggerContextSource("log4j-lookup.xml")
 public class LookupTest {
 
-    private static final String CONFIG = "log4j-lookup.xml";
-
-    @ClassRule
-    public static LoggerContextRule context = new LoggerContextRule(CONFIG);
-
     @Test
-    public void testHostname() {
-        final ConsoleAppender app = context.getRequiredAppender("console", ConsoleAppender.class);
-        final Layout<?> layout = app.getLayout();
-        assertNotNull("No Layout", layout);
-        assertTrue("Layout is not a PatternLayout", layout instanceof PatternLayout);
+    public void testHostname(@Named final ConsoleAppender console) {
+        final Layout<?> layout = console.getLayout();
+        assertNotNull(layout, "No Layout");
+        assertTrue(layout instanceof PatternLayout, "Layout is not a PatternLayout");
         final String pattern = ((PatternLayout) layout).getConversionPattern();
-        assertNotNull("No conversion pattern", pattern);
-        assertTrue("No filters", pattern.contains("org.junit,org.apache.maven,org.eclipse,sun.reflect,java.lang.reflect"));
+        assertNotNull(pattern, "No conversion pattern");
+        assertTrue(pattern.contains("org.junit,org.apache.maven,org.eclipse,sun.reflect,java.lang.reflect"),
+                "No filters");
     }
 }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/PatternSelectorTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/PatternSelectorTest.java
index c1df3f8..7fb6cae 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/PatternSelectorTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/PatternSelectorTest.java
@@ -19,59 +19,50 @@ package org.apache.logging.log4j.core;
 import java.util.List;
 
 import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.apache.logging.log4j.junit.Named;
+import org.apache.logging.log4j.junit.LoggerContextSource;
 import org.apache.logging.log4j.test.appender.ListAppender;
 import org.apache.logging.log4j.util.Strings;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
-/**
- *
- */
-public class PatternSelectorTest {
+import static org.junit.jupiter.api.Assertions.*;
 
-
-    private static final String CONFIG = "log4j-patternSelector.xml";
-
-    @ClassRule
-    public static LoggerContextRule context = new LoggerContextRule(CONFIG);
+@LoggerContextSource("log4j-patternSelector.xml")
+public class PatternSelectorTest {
 
     @Test
-    public void testMarkerPatternSelector() throws Exception {
+    public void testMarkerPatternSelector(@Named("List") final ListAppender app) {
         final org.apache.logging.log4j.Logger logger = LogManager.getLogger("TestMarkerPatternSelector");
         logger.traceEntry();
         logger.info("Hello World");
         logger.traceExit();
-        final ListAppender app = (ListAppender) context.getRequiredAppender("List");
-        assertNotNull("No ListAppender", app);
         final List<String> messages = app.getMessages();
-        assertNotNull("No Messages", messages);
-        assertTrue("Incorrect number of messages. Expected 3, Actual " + messages.size() + ": " + messages, messages.size() == 3);
+        assertNotNull(messages, "No Messages");
+        assertEquals(3, messages.size(),
+                "Incorrect number of messages. Expected 3, Actual " + messages.size() + ": " + messages);
         final String expect = String.format("[TRACE] TestMarkerPatternSelector ====== "
-                + "o.a.l.l.c.PatternSelectorTest.testMarkerPatternSelector:43 Enter ======%n");
+                + "o.a.l.l.c.PatternSelectorTest.testMarkerPatternSelector:36 Enter ======%n");
         assertEquals(expect, messages.get(0));
         assertEquals("[INFO ] TestMarkerPatternSelector Hello World" + Strings.LINE_SEPARATOR, messages.get(1));
         app.clear();
     }
 
     @Test
-    public void testScriptPatternSelector() throws Exception {
+    public void testScriptPatternSelector(@Named("List2") final ListAppender app) {
         final org.apache.logging.log4j.Logger logger = LogManager.getLogger("TestScriptPatternSelector");
         final org.apache.logging.log4j.Logger logger2 = LogManager.getLogger("NoLocation");
         logger.traceEntry();
         logger.info("Hello World");
         logger2.info("No location information");
         logger.traceExit();
-        final ListAppender app = (ListAppender) context.getRequiredAppender("List2");
-        assertNotNull("No ListAppender", app);
         final List<String> messages = app.getMessages();
-        assertNotNull("No Messages", messages);
-        assertTrue("Incorrect number of messages. Expected 4, Actual " + messages.size() + ": " + messages, messages.size() == 4);
+        assertNotNull(messages, "No Messages");
+        assertEquals(4, messages.size(),
+                "Incorrect number of messages. Expected 4, Actual " + messages.size() + ": " + messages);
         String expect = "[TRACE] TestScriptPatternSelector ====== " +
-                "o.a.l.l.c.PatternSelectorTest.testScriptPatternSelector:62 Enter ======" + Strings.LINE_SEPARATOR;
+                "o.a.l.l.c.PatternSelectorTest.testScriptPatternSelector:54 Enter ======" + Strings.LINE_SEPARATOR;
         assertEquals(expect, messages.get(0));
-        expect = "[INFO ] TestScriptPatternSelector o.a.l.l.c.PatternSelectorTest.testScriptPatternSelector.63 " +
+        expect = "[INFO ] TestScriptPatternSelector o.a.l.l.c.PatternSelectorTest.testScriptPatternSelector.55 " +
                 "Hello World" + Strings.LINE_SEPARATOR;
         assertEquals(expect, messages.get(1));
         assertEquals("[INFO ] NoLocation No location information" + Strings.LINE_SEPARATOR, messages.get(2));
@@ -79,23 +70,22 @@ public class PatternSelectorTest {
     }
 
     @Test
-    public void testJavaScriptPatternSelector() throws Exception {
+    public void testJavaScriptPatternSelector(@Named("List3") final ListAppender app) {
         final org.apache.logging.log4j.Logger logger = LogManager.getLogger("TestJavaScriptPatternSelector");
         final org.apache.logging.log4j.Logger logger2 = LogManager.getLogger("JavascriptNoLocation");
         logger.traceEntry();
         logger.info("Hello World");
         logger2.info("No location information");
         logger.traceExit();
-        final ListAppender app = (ListAppender) context.getRequiredAppender("List3");
-        assertNotNull("No ListAppender", app);
         final List<String> messages = app.getMessages();
-        assertNotNull("No Messages", messages);
-        assertTrue("Incorrect number of messages. Expected 4, Actual " + messages.size() + ": " + messages, messages.size() == 4);
+        assertNotNull(messages, "No Messages");
+        assertEquals(4, messages.size(),
+                "Incorrect number of messages. Expected 4, Actual " + messages.size() + ": " + messages);
         String expect = "[TRACE] TestJavaScriptPatternSelector ====== " +
-                "o.a.l.l.c.PatternSelectorTest.testJavaScriptPatternSelector:85 Enter ======" + Strings.LINE_SEPARATOR;
+                "o.a.l.l.c.PatternSelectorTest.testJavaScriptPatternSelector:76 Enter ======" + Strings.LINE_SEPARATOR;
         assertEquals(expect, messages.get(0));
         expect = "[INFO ] TestJavaScriptPatternSelector " +
-                "o.a.l.l.c.PatternSelectorTest.testJavaScriptPatternSelector.86 Hello World" + Strings.LINE_SEPARATOR;
+                "o.a.l.l.c.PatternSelectorTest.testJavaScriptPatternSelector.77 Hello World" + Strings.LINE_SEPARATOR;
         assertEquals(expect, messages.get(1));
         assertEquals("[INFO ] JavascriptNoLocation No location information" + Strings.LINE_SEPARATOR, messages.get(2));
         app.clear();
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/PropertiesFileConfigTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/PropertiesFileConfigTest.java
index 4893c68..9d12ce3 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/PropertiesFileConfigTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/PropertiesFileConfigTest.java
@@ -16,43 +16,43 @@
  */
 package org.apache.logging.log4j.core;
 
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertTrue;
+import org.apache.logging.log4j.core.config.Configuration;
+import org.apache.logging.log4j.junit.Named;
+import org.apache.logging.log4j.junit.LoggerContextSource;
+import org.apache.logging.log4j.test.appender.ListAppender;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.io.File;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.logging.log4j.core.config.Configuration;
-import org.apache.logging.log4j.junit.LoggerContextRule;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertNotSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-/**
- *
- */
+@LoggerContextSource("log4j-test2.properties")
 public class PropertiesFileConfigTest {
 
     private static final String CONFIG = "target/test-classes/log4j-test2.properties";
 
-    @ClassRule
-    public static LoggerContextRule context = new LoggerContextRule(CONFIG);
+    private final org.apache.logging.log4j.Logger logger;
 
-    private final org.apache.logging.log4j.Logger logger = context.getLogger("LoggerTest");
+    public PropertiesFileConfigTest(final LoggerContext context) {
+        logger = context.getLogger("LoggerTest");
+    }
 
-    @Before
-    public void before() {
-        context.getListAppender("List").clear();
+    @BeforeEach
+    void clear(@Named("List") final ListAppender appender) {
+        appender.clear();
     }
 
     @Test
-    public void testReconfiguration() throws Exception {
+    public void testReconfiguration(final LoggerContext context) throws Exception {
         final Configuration oldConfig = context.getConfiguration();
         final int MONITOR_INTERVAL_SECONDS = 5;
         final File file = new File(CONFIG);
         final long orig = file.lastModified();
         final long newTime = orig + 10000;
-        assertTrue("setLastModified should have succeeded.", file.setLastModified(newTime));
+        assertTrue(file.setLastModified(newTime), "setLastModified should have succeeded.");
         TimeUnit.SECONDS.sleep(MONITOR_INTERVAL_SECONDS + 1);
         for (int i = 0; i < 17; ++i) {
             logger.info("Reconfigure");
@@ -63,7 +63,7 @@ public class PropertiesFileConfigTest {
             Thread.sleep(100);
             newConfig = context.getConfiguration();
         } while (newConfig == oldConfig && loopCount++ < 5);
-        assertNotSame("Reconfiguration failed", newConfig, oldConfig);
+        assertNotSame(newConfig, oldConfig, "Reconfiguration failed");
     }
 }
 
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/ReusableParameterizedMessageMemoryLeakTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/ReusableParameterizedMessageMemoryLeakTest.java
index c4d212d..2bf46c0 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/ReusableParameterizedMessageMemoryLeakTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/ReusableParameterizedMessageMemoryLeakTest.java
@@ -18,17 +18,16 @@ package org.apache.logging.log4j.core;
 
 import org.apache.logging.log4j.message.ReusableMessage;
 import org.apache.logging.log4j.message.ReusableMessageFactory;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class ReusableParameterizedMessageMemoryLeakTest {
 
     @Test
-    @SuppressWarnings("UnusedAssignment") // parameter set to null to allow garbage collection
     public void testParametersAreNotLeaked() throws Exception {
         final CountDownLatch latch = new CountDownLatch(1);
         final ReusableMessage message = (ReusableMessage) ReusableMessageFactory.INSTANCE.newMessage(
@@ -38,7 +37,7 @@ public class ReusableParameterizedMessageMemoryLeakTest {
         final GarbageCollectionHelper gcHelper = new GarbageCollectionHelper();
         gcHelper.run();
         try {
-            assertTrue("Parameter should have been garbage collected", latch.await(30, TimeUnit.SECONDS));
+            assertTrue(latch.await(30, TimeUnit.SECONDS), "Parameter should have been garbage collected");
         } finally {
             gcHelper.close();
         }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/ShutdownDisabledTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/ShutdownDisabledTest.java
index 5fcecd4..ef53e89 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/ShutdownDisabledTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/ShutdownDisabledTest.java
@@ -17,27 +17,17 @@
 package org.apache.logging.log4j.core;
 
 import org.apache.logging.log4j.core.config.Configuration;
-import org.apache.logging.log4j.junit.LoggerContextRule;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.apache.logging.log4j.junit.LoggerContextSource;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 
-/**
- *
- */
+@LoggerContextSource("log4j-test3.xml")
 public class ShutdownDisabledTest {
 
-    private static final String CONFIG = "log4j-test3.xml";
-
-    @ClassRule
-    public static LoggerContextRule context = new LoggerContextRule(CONFIG);
-
     @Test
-    public void testShutdownFlag() {
-        final Configuration config = context.getConfiguration();
-        assertNotNull("No configuration", config);
-        assertFalse("Shutdown hook is enabled", config.isShutdownHookEnabled());
+    public void testShutdownFlag(final Configuration config) {
+        assertFalse(config.isShutdownHookEnabled(), "Shutdown hook is enabled");
     }
 
 }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/ShutdownTimeoutConfigurationTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/ShutdownTimeoutConfigurationTest.java
index 5e0734c..dc34879 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/ShutdownTimeoutConfigurationTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/ShutdownTimeoutConfigurationTest.java
@@ -17,26 +17,16 @@
 package org.apache.logging.log4j.core;
 
 import org.apache.logging.log4j.core.config.Configuration;
-import org.apache.logging.log4j.junit.LoggerContextRule;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.apache.logging.log4j.junit.LoggerContextSource;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
-/**
- *
- */
+@LoggerContextSource("log4j-test-shutdownTimeout.xml")
 public class ShutdownTimeoutConfigurationTest {
 
-    private static final String CONFIG = "log4j-test-shutdownTimeout.xml";
-
-    @ClassRule
-    public static LoggerContextRule context = new LoggerContextRule(CONFIG);
-
     @Test
-    public void testShutdownFlag() {
-        final Configuration config = context.getConfiguration();
-        assertNotNull("No configuration", config);
+    public void testShutdownFlag(final Configuration config) {
         assertEquals(5000, config.getShutdownTimeoutMillis());
     }
 
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/StrictXmlConfigTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/StrictXmlConfigTest.java
index c9af2c9..4bf661f 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/StrictXmlConfigTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/StrictXmlConfigTest.java
@@ -16,46 +16,38 @@
  */
 package org.apache.logging.log4j.core;
 
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-
 import org.apache.logging.log4j.MarkerManager;
 import org.apache.logging.log4j.ThreadContext;
-import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.apache.logging.log4j.junit.Named;
+import org.apache.logging.log4j.junit.LoggerContextSource;
 import org.apache.logging.log4j.message.EntryMessage;
 import org.apache.logging.log4j.message.StructuredDataMessage;
 import org.apache.logging.log4j.test.appender.ListAppender;
-import org.junit.Before;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
 
-/**
- *
- */
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+@LoggerContextSource("log4j-strict1.xml")
 public class StrictXmlConfigTest {
 
-    private static final String CONFIG = "log4j-strict1.xml";
+    org.apache.logging.log4j.Logger logger;
     private ListAppender app;
 
-    @ClassRule
-    public static LoggerContextRule context = new LoggerContextRule(CONFIG);
-
-    @Before
-    public void setUp() throws Exception {
-        app = context.getListAppender("List").clear();
+    public StrictXmlConfigTest(final LoggerContext context, @Named("List") final ListAppender app) {
+        logger = context.getLogger("LoggerTest");
+        this.app = app.clear();
     }
 
-    org.apache.logging.log4j.Logger logger = context.getLogger("LoggerTest");
-
     @Test
     public void basicFlow() {
         final EntryMessage entry = logger.traceEntry();
         logger.traceExit(entry);
         final List<LogEvent> events = app.getEvents();
-        assertEquals("Incorrect number of events. Expected 2, actual " + events.size(), 2, events.size());
+        assertEquals(2, events.size(), "Incorrect number of events. Expected 2, actual " + events.size());
     }
 
     @Test
@@ -63,22 +55,22 @@ public class StrictXmlConfigTest {
         logger.traceEntry();
         logger.traceExit();
         final List<LogEvent> events = app.getEvents();
-        assertEquals("Incorrect number of events. Expected 2, actual " + events.size(), 2, events.size());
+        assertEquals(2, events.size(), "Incorrect number of events. Expected 2, actual " + events.size());
     }
 
     @Test
     public void simpleFlow() {
-        logger.entry(CONFIG);
-        logger.exit(0);
+        logger.traceEntry();
+        logger.traceExit(0);
         final List<LogEvent> events = app.getEvents();
-        assertEquals("Incorrect number of events. Expected 2, actual " + events.size(), 2, events.size());
+        assertEquals(2, events.size(), "Incorrect number of events. Expected 2, actual " + events.size());
     }
 
     @Test
     public void throwing() {
         logger.throwing(new IllegalArgumentException("Test Exception"));
         final List<LogEvent> events = app.getEvents();
-        assertEquals("Incorrect number of events. Expected 1, actual " + events.size(), 1, events.size());
+        assertEquals(1, events.size(), "Incorrect number of events. Expected 1, actual " + events.size());
     }
 
     @Test
@@ -89,28 +81,28 @@ public class StrictXmlConfigTest {
             logger.catching(e);
         }
         final List<LogEvent> events = app.getEvents();
-        assertEquals("Incorrect number of events. Expected 1, actual " + events.size(), 1, events.size());
+        assertEquals(1, events.size(), "Incorrect number of events. Expected 1, actual " + events.size());
     }
 
     @Test
     public void debug() {
         logger.debug("Debug message");
         final List<LogEvent> events = app.getEvents();
-        assertEquals("Incorrect number of events. Expected 1, actual " + events.size(), 1, events.size());
+        assertEquals(1, events.size(), "Incorrect number of events. Expected 1, actual " + events.size());
     }
 
     @Test
     public void debugObject() {
         logger.debug(new Date());
         final List<LogEvent> events = app.getEvents();
-        assertEquals("Incorrect number of events. Expected 1, actual " + events.size(), 1, events.size());
+        assertEquals(1, events.size(), "Incorrect number of events. Expected 1, actual " + events.size());
     }
 
     @Test
     public void debugWithParms() {
         logger.debug("Hello, {}", "World");
         final List<LogEvent> events = app.getEvents();
-        assertEquals("Incorrect number of events. Expected 1, actual " + events.size(), 1, events.size());
+        assertEquals(1, events.size(), "Incorrect number of events. Expected 1, actual " + events.size());
     }
 
     @Test
@@ -120,7 +112,7 @@ public class StrictXmlConfigTest {
         ThreadContext.clearMap();
         logger.debug("Debug message");
         final List<LogEvent> events = app.getEvents();
-        assertEquals("Incorrect number of events. Expected 2, actual " + events.size(), 2, events.size());
+        assertEquals(2, events.size(), "Incorrect number of events. Expected 2, actual " + events.size());
     }
 
     @Test
@@ -135,7 +127,7 @@ public class StrictXmlConfigTest {
         logger.info(MarkerManager.getMarker("EVENT"), msg);
         ThreadContext.clearMap();
         final List<LogEvent> events = app.getEvents();
-        assertEquals("Incorrect number of events. Expected 1, actual " + events.size(), 1, events.size());
+        assertEquals(1, events.size(), "Incorrect number of events. Expected 1, actual " + events.size());
     }
 }
 
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/TimestampMessageTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/TimestampMessageTest.java
index 60d643b..12d74a7 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/TimestampMessageTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/TimestampMessageTest.java
@@ -16,26 +16,26 @@
  */
 package org.apache.logging.log4j.core;
 
-import java.util.List;
-
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.util.Clock;
 import org.apache.logging.log4j.core.util.ClockFactory;
 import org.apache.logging.log4j.core.util.ClockFactoryTest;
 import org.apache.logging.log4j.core.util.Constants;
-import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.apache.logging.log4j.junit.Named;
+import org.apache.logging.log4j.junit.LoggerContextSource;
 import org.apache.logging.log4j.message.Message;
 import org.apache.logging.log4j.message.SimpleMessage;
 import org.apache.logging.log4j.message.TimestampMessage;
 import org.apache.logging.log4j.test.appender.ListAppender;
 import org.apache.logging.log4j.util.Strings;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+
+import java.util.List;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 /**
  * Confirms that if you log a {@link TimestampMessage} then there are no unnecessary calls to {@link Clock}.
@@ -43,30 +43,27 @@ import static org.junit.Assert.*;
  * See LOG4J2-744.
  * </p>
  */
+@LoggerContextSource("log4j2-744.xml")
 public class TimestampMessageTest {
     private ListAppender app;
 
-    @ClassRule
-    public static LoggerContextRule context = new LoggerContextRule("log4j2-744.xml");
+    public TimestampMessageTest(@Named("List") final ListAppender app) {
+        this.app = app.clear();
+    }
 
-    @BeforeClass
+    @BeforeAll
     public static void beforeClass() {
         System.setProperty(ClockFactory.PROPERTY_NAME, PoisonClock.class.getName());
     }
 
-    @Before
-    public void setUp() throws Exception {
-        this.app = context.getListAppender("List").clear();
-    }
-
-    @AfterClass
+    @AfterAll
     public static void afterClass() throws IllegalAccessException {
         System.setProperty(Constants.LOG4J_CONTEXT_SELECTOR, Strings.EMPTY);
         ClockFactoryTest.resetClocks();
     }
 
     @Test
-    public void testTimestampMessage() {
+    public void testTimestampMessage(final LoggerContext context) {
         final Logger log = context.getLogger("TimestampMessageTest");
         log.info((Message) new TimeMsg("Message with embedded timestamp", 123456789000L));
         final List<String> msgs = app.getMessages();
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/XmlEvents.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/XmlEvents.java
index c9b6539..cf56051 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/XmlEvents.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/XmlEvents.java
@@ -16,25 +16,19 @@
  */
 package org.apache.logging.log4j.core;
 
-import java.util.Locale;
-
 import org.apache.logging.log4j.EventLogger;
 import org.apache.logging.log4j.ThreadContext;
-import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.apache.logging.log4j.junit.LoggerContextSource;
 import org.apache.logging.log4j.message.AsynchronouslyFormattable;
 import org.apache.logging.log4j.message.StructuredDataMessage;
-import org.junit.ClassRule;
-import org.junit.Test;
-
-/**
- *
- */
-public class XmlEvents {
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 
-    private static final String CONFIG = "xml-events.xml";
+import java.util.Locale;
 
-    @ClassRule
-    public static LoggerContextRule context = new LoggerContextRule(CONFIG);
+@LoggerContextSource("xml-events.xml")
+@Disabled("TODO")
+public class XmlEvents {
 
     @Test
     public void testEvents() {
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelectorTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelectorTest.java
index 5b7e6ad..2025197 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelectorTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelectorTest.java
@@ -20,10 +20,10 @@ import java.lang.reflect.Field;
 
 import org.apache.logging.log4j.core.Logger;
 import org.apache.logging.log4j.core.util.ReflectionUtil;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 public class ClassLoaderContextSelectorTest {
 
@@ -31,7 +31,7 @@ public class ClassLoaderContextSelectorTest {
 
     private ClassLoader loader1, loader2, loader3;
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         loader1 = new TestClassLoader();
         loader2 = new TestClassLoader();
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/time/MutableInstantTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/time/MutableInstantTest.java
index 6bebbd1..4a6e9c4 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/time/MutableInstantTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/time/MutableInstantTest.java
@@ -17,165 +17,164 @@
 package org.apache.logging.log4j.core.time;
 
 import org.apache.logging.log4j.core.time.internal.FixedPreciseClock;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.*;
 
 public class MutableInstantTest {
 
     @Test
     public void testGetEpochSecond() {
-        final MutableInstant instant = new MutableInstant();
-        assertEquals("initial", 0, instant.getEpochSecond());
+        MutableInstant instant = new MutableInstant();
+        assertEquals(0, instant.getEpochSecond(), "initial");
 
         instant.initFromEpochSecond(123, 456);
-        assertEquals("returns directly set value", 123, instant.getEpochSecond());
+        assertEquals(123, instant.getEpochSecond(), "returns directly set value");
 
         instant.initFromEpochMilli(123456, 789012);
-        assertEquals("returns converted value when initialized from milllis", 123, instant.getEpochSecond());
+        assertEquals(123, instant.getEpochSecond(), "returns converted value when initialized from milllis");
 
-        final MutableInstant other = new MutableInstant();
+        MutableInstant other = new MutableInstant();
         other.initFromEpochSecond(788, 456);
         instant.initFrom(other);
 
-        assertEquals("returns ref value when initialized from instant", 788, instant.getEpochSecond());
+        assertEquals(788, instant.getEpochSecond(), "returns ref value when initialized from instant");
     }
 
     @Test
     public void testGetNanoOfSecond() {
-        final MutableInstant instant = new MutableInstant();
-        assertEquals("initial", 0, instant.getNanoOfSecond());
+        MutableInstant instant = new MutableInstant();
+        assertEquals(0, instant.getNanoOfSecond(), "initial");
 
         instant.initFromEpochSecond(123, 456);
-        assertEquals("returns directly set value", 456, instant.getNanoOfSecond());
+        assertEquals(456, instant.getNanoOfSecond(), "returns directly set value");
 
         instant.initFromEpochMilli(123456, 789012);
-        assertEquals("returns converted value when initialized from milllis", 456789012, instant.getNanoOfSecond());
+        assertEquals(456789012, instant.getNanoOfSecond(), "returns converted value when initialized from milllis");
 
-        final MutableInstant other = new MutableInstant();
+        MutableInstant other = new MutableInstant();
         other.initFromEpochSecond(788, 456);
         instant.initFrom(other);
 
-        assertEquals("returns ref value when initialized from instant", 456, instant.getNanoOfSecond());
+        assertEquals(456, instant.getNanoOfSecond(), "returns ref value when initialized from instant");
     }
 
     @Test
     public void testGetEpochMillisecond() {
-        final MutableInstant instant = new MutableInstant();
-        assertEquals("initial", 0, instant.getEpochMillisecond());
+        MutableInstant instant = new MutableInstant();
+        assertEquals(0, instant.getEpochMillisecond(), "initial");
 
         instant.initFromEpochMilli(123, 456);
-        assertEquals("returns directly set value", 123, instant.getEpochMillisecond());
+        assertEquals(123, instant.getEpochMillisecond(), "returns directly set value");
 
         instant.initFromEpochSecond(123, 456789012);
-        assertEquals("returns converted value when initialized from seconds", 123456, instant.getEpochMillisecond());
+        assertEquals(123456, instant.getEpochMillisecond(), "returns converted value when initialized from seconds");
 
-        final MutableInstant other = new MutableInstant();
+        MutableInstant other = new MutableInstant();
         other.initFromEpochMilli(788, 456);
         instant.initFrom(other);
 
-        assertEquals("returns ref value when initialized from instant", 788, instant.getEpochMillisecond());
+        assertEquals(788, instant.getEpochMillisecond(), "returns ref value when initialized from instant");
     }
 
     @Test
     public void getGetNanoOfMillisecond() {
-        final MutableInstant instant = new MutableInstant();
-        assertEquals("initial", 0, instant.getNanoOfMillisecond());
+        MutableInstant instant = new MutableInstant();
+        assertEquals(0, instant.getNanoOfMillisecond(), "initial");
 
         instant.initFromEpochMilli(123, 456);
-        assertEquals("returns directly set value", 456, instant.getNanoOfMillisecond());
+        assertEquals(456, instant.getNanoOfMillisecond(), "returns directly set value");
 
         instant.initFromEpochSecond(123, 456789012);
-        assertEquals("returns converted value when initialized from milllis", 789012, instant.getNanoOfMillisecond());
+        assertEquals(789012, instant.getNanoOfMillisecond(), "returns converted value when initialized from milllis");
 
-        final MutableInstant other = new MutableInstant();
+        MutableInstant other = new MutableInstant();
         other.initFromEpochMilli(788, 456);
         instant.initFrom(other);
 
-        assertEquals("returns ref value when initialized from instant", 456, instant.getNanoOfMillisecond());
+        assertEquals(456, instant.getNanoOfMillisecond(), "returns ref value when initialized from instant");
     }
 
-    @Test(expected = NullPointerException.class)
+    @Test
     public void testInitFromInstantRejectsNull() {
-        new MutableInstant().initFrom((Instant) null);
+        assertThrows(NullPointerException.class, () -> new MutableInstant().initFrom((Instant) null));
     }
 
     @Test
     public void testInitFromInstantCopiesValues() {
-        final MutableInstant other = new MutableInstant();
+        MutableInstant other = new MutableInstant();
         other.initFromEpochSecond(788, 456);
-        assertEquals("epochSec", 788, other.getEpochSecond());
-        assertEquals("NanosOfSec", 456, other.getNanoOfSecond());
+        assertEquals(788, other.getEpochSecond(), "epochSec");
+        assertEquals(456, other.getNanoOfSecond(), "NanosOfSec");
 
-        final MutableInstant instant = new MutableInstant();
+        MutableInstant instant = new MutableInstant();
         instant.initFrom(other);
 
-        assertEquals("epochSec", 788, instant.getEpochSecond());
-        assertEquals("NanoOfSec", 456, instant.getNanoOfSecond());
+        assertEquals(788, instant.getEpochSecond(), "epochSec");
+        assertEquals(456, instant.getNanoOfSecond(), "NanoOfSec");
     }
 
     @Test
     public void testInitFromEpochMillis() {
-        final MutableInstant instant = new MutableInstant();
+        MutableInstant instant = new MutableInstant();
         instant.initFromEpochMilli(123456, 789012);
-        assertEquals("epochSec", 123, instant.getEpochSecond());
-        assertEquals("NanoOfSec", 456789012, instant.getNanoOfSecond());
-        assertEquals("epochMilli", 123456, instant.getEpochMillisecond());
-        assertEquals("NanoOfMilli", 789012, instant.getNanoOfMillisecond());
+        assertEquals(123, instant.getEpochSecond(), "epochSec");
+        assertEquals(456789012, instant.getNanoOfSecond(), "NanoOfSec");
+        assertEquals(123456, instant.getEpochMillisecond(), "epochMilli");
+        assertEquals(789012, instant.getNanoOfMillisecond(), "NanoOfMilli");
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testInitFromEpochMillisRejectsNegativeNanoOfMilli() {
-        final MutableInstant instant = new MutableInstant();
-        instant.initFromEpochMilli(123456, -1);
+        MutableInstant instant = new MutableInstant();
+        assertThrows(IllegalArgumentException.class, () -> instant.initFromEpochMilli(123456, -1));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testInitFromEpochMillisRejectsTooLargeNanoOfMilli() {
-        final MutableInstant instant = new MutableInstant();
-        instant.initFromEpochMilli(123456, 1000_000);
+        MutableInstant instant = new MutableInstant();
+        assertThrows(IllegalArgumentException.class, () -> instant.initFromEpochMilli(123456, 1000_000));
     }
 
     @Test
     public void testInitFromEpochMillisAcceptsTooMaxNanoOfMilli() {
-        final MutableInstant instant = new MutableInstant();
+        MutableInstant instant = new MutableInstant();
         instant.initFromEpochMilli(123456, 999_999);
-        assertEquals("NanoOfMilli", 999_999, instant.getNanoOfMillisecond());
+        assertEquals(999_999, instant.getNanoOfMillisecond(), "NanoOfMilli");
     }
 
     @Test
     public void testInitFromEpochSecond() {
-        final MutableInstant instant = new MutableInstant();
+        MutableInstant instant = new MutableInstant();
         instant.initFromEpochSecond(123, 456789012);
-        assertEquals("epochSec", 123, instant.getEpochSecond());
-        assertEquals("NanoOfSec", 456789012, instant.getNanoOfSecond());
-        assertEquals("epochMilli", 123456, instant.getEpochMillisecond());
-        assertEquals("NanoOfMilli", 789012, instant.getNanoOfMillisecond());
+        assertEquals(123, instant.getEpochSecond(), "epochSec");
+        assertEquals(456789012, instant.getNanoOfSecond(), "NanoOfSec");
+        assertEquals(123456, instant.getEpochMillisecond(), "epochMilli");
+        assertEquals(789012, instant.getNanoOfMillisecond(), "NanoOfMilli");
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testInitFromEpochSecondRejectsNegativeNanoOfMilli() {
-        final MutableInstant instant = new MutableInstant();
-        instant.initFromEpochSecond(123456, -1);
+        MutableInstant instant = new MutableInstant();
+        assertThrows(IllegalArgumentException.class, () -> instant.initFromEpochSecond(123456, -1));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testInitFromEpochSecondRejectsTooLargeNanoOfMilli() {
-        final MutableInstant instant = new MutableInstant();
-        instant.initFromEpochSecond(123456, 1000_000_000);
+        MutableInstant instant = new MutableInstant();
+        assertThrows(IllegalArgumentException.class, () -> instant.initFromEpochSecond(123456, 1000_000_000));
     }
 
     @Test
     public void testInitFromEpochSecondAcceptsTooMaxNanoOfMilli() {
-        final MutableInstant instant = new MutableInstant();
+        MutableInstant instant = new MutableInstant();
         instant.initFromEpochSecond(123456, 999_999_999);
-        assertEquals("NanoOfSec", 999_999_999, instant.getNanoOfSecond());
+        assertEquals(999_999_999, instant.getNanoOfSecond(), "NanoOfSec");
     }
 
     @Test
     public void testInstantToMillisAndNanos() {
-        final long[] values = new long[2];
+        long[] values = new long[2];
         MutableInstant.instantToMillisAndNanos(123456, 999_999_999, values);
         assertEquals(123456_999, values[0]);
         assertEquals(999_999, values[1]);
@@ -183,9 +182,9 @@ public class MutableInstantTest {
 
     @Test
     public void testInitFromClock() {
-        final MutableInstant instant = new MutableInstant();
+        MutableInstant instant = new MutableInstant();
 
-        final PreciseClock clock = new FixedPreciseClock(123456, 789012);
+        PreciseClock clock = new FixedPreciseClock(123456, 789012);
         instant.initFrom(clock);
 
         assertEquals(123456, instant.getEpochMillisecond());
@@ -196,10 +195,10 @@ public class MutableInstantTest {
 
     @Test
     public void testEquals() {
-        final MutableInstant instant = new MutableInstant();
+        MutableInstant instant = new MutableInstant();
         instant.initFromEpochSecond(123, 456789012);
 
-        final MutableInstant instant2 = new MutableInstant();
+        MutableInstant instant2 = new MutableInstant();
         instant2.initFromEpochMilli(123456, 789012);
 
         assertEquals(instant, instant2);
@@ -207,10 +206,10 @@ public class MutableInstantTest {
 
     @Test
     public void testHashCode() {
-        final MutableInstant instant = new MutableInstant();
+        MutableInstant instant = new MutableInstant();
         instant.initFromEpochSecond(123, 456789012);
 
-        final MutableInstant instant2 = new MutableInstant();
+        MutableInstant instant2 = new MutableInstant();
         instant2.initFromEpochMilli(123456, 789012);
 
         assertEquals(instant.hashCode(), instant2.hashCode());
@@ -222,11 +221,11 @@ public class MutableInstantTest {
 
     @Test
     public void testToString() {
-        final MutableInstant instant = new MutableInstant();
+        MutableInstant instant = new MutableInstant();
         instant.initFromEpochSecond(123, 456789012);
         assertEquals("MutableInstant[epochSecond=123, nano=456789012]", instant.toString());
 
         instant.initFromEpochMilli(123456, 789012);
         assertEquals("MutableInstant[epochSecond=123, nano=456789012]", instant.toString());
     }
-}
\ No newline at end of file
+}
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/tools/GenerateCustomLoggerTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/tools/GenerateCustomLoggerTest.java
index 15f43d0..1707bbd 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/tools/GenerateCustomLoggerTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/tools/GenerateCustomLoggerTest.java
@@ -24,6 +24,7 @@ import java.lang.reflect.Modifier;
 import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 import java.util.Locale;
 
@@ -41,14 +42,16 @@ import org.apache.logging.log4j.message.Message;
 import org.apache.logging.log4j.message.MessageFactory;
 import org.apache.logging.log4j.util.MessageSupplier;
 import org.apache.logging.log4j.util.Supplier;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
+@Tag("functional")
 public class GenerateCustomLoggerTest {
-
-    @BeforeClass
+    
+    @BeforeAll
     public static void beforeClass() {
         System.setProperty("log4j2.loggerContextFactory", "org.apache.logging.log4j.TestLoggerContextFactory");
     }
@@ -72,8 +75,8 @@ public class GenerateCustomLoggerTest {
         final DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();
         final List<String> errors = new ArrayList<>();
         try (final StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnostics, null, null)) {
-            final Iterable<? extends JavaFileObject> compilationUnits = fileManager.getJavaFileObjectsFromFiles(Arrays
-                    .asList(f));
+            final Iterable<? extends JavaFileObject> compilationUnits = fileManager.getJavaFileObjectsFromFiles(
+                    Collections.singletonList(f));
 
             // compile generated source
             compiler.getTask(null, fileManager, diagnostics, null, null, compilationUnits).call();
@@ -85,16 +88,16 @@ public class GenerateCustomLoggerTest {
                 }
             }
         }
-        assertTrue(errors.toString(), errors.isEmpty());
+        assertTrue(errors.isEmpty(), errors.toString());
 
         // load the compiled class
         final Class<?> cls = Class.forName(CLASSNAME);
 
         // check that all factory methods exist and are static
-        assertTrue(Modifier.isStatic(cls.getDeclaredMethod("create", new Class[0]).getModifiers()));
-        assertTrue(Modifier.isStatic(cls.getDeclaredMethod("create", new Class[] { Class.class }).getModifiers()));
-        assertTrue(Modifier.isStatic(cls.getDeclaredMethod("create", new Class[] { Object.class }).getModifiers()));
-        assertTrue(Modifier.isStatic(cls.getDeclaredMethod("create", new Class[] { String.class }).getModifiers()));
+        assertTrue(Modifier.isStatic(cls.getDeclaredMethod("create").getModifiers()));
+        assertTrue(Modifier.isStatic(cls.getDeclaredMethod("create", Class.class).getModifiers()));
+        assertTrue(Modifier.isStatic(cls.getDeclaredMethod("create", Object.class).getModifiers()));
+        assertTrue(Modifier.isStatic(cls.getDeclaredMethod("create", String.class).getModifiers()));
         assertTrue(Modifier.isStatic(cls.getDeclaredMethod("create", Class.class, MessageFactory.class).getModifiers()));
         assertTrue(Modifier
                 .isStatic(cls.getDeclaredMethod("create", Object.class, MessageFactory.class).getModifiers()));
@@ -104,36 +107,38 @@ public class GenerateCustomLoggerTest {
         // check that all log methods exist
         final String[] logMethods = { "defcon1", "defcon2", "defcon3" };
         for (final String name : logMethods) {
-            cls.getDeclaredMethod(name, Marker.class, Message.class, Throwable.class);
-            cls.getDeclaredMethod(name, Marker.class, Object.class, Throwable.class);
-            cls.getDeclaredMethod(name, Marker.class, String.class, Throwable.class);
-            cls.getDeclaredMethod(name, Marker.class, Message.class);
-            cls.getDeclaredMethod(name, Marker.class, Object.class);
-            cls.getDeclaredMethod(name, Marker.class, String.class);
-            cls.getDeclaredMethod(name, Message.class);
-            cls.getDeclaredMethod(name, Object.class);
-            cls.getDeclaredMethod(name, String.class);
-            cls.getDeclaredMethod(name, Message.class, Throwable.class);
-            cls.getDeclaredMethod(name, Object.class, Throwable.class);
-            cls.getDeclaredMethod(name, String.class, Throwable.class);
-            cls.getDeclaredMethod(name, String.class, Object[].class);
-            cls.getDeclaredMethod(name, Marker.class, String.class, Object[].class);
-
-            // 2.4 lambda support
-            cls.getDeclaredMethod(name, Marker.class, MessageSupplier.class);
-            cls.getDeclaredMethod(name, Marker.class, MessageSupplier.class, Throwable.class);
-            cls.getDeclaredMethod(name, Marker.class, String.class, Supplier[].class);
-            cls.getDeclaredMethod(name, Marker.class, Supplier.class);
-            cls.getDeclaredMethod(name, Marker.class, Supplier.class, Throwable.class);
-            cls.getDeclaredMethod(name, MessageSupplier.class);
-            cls.getDeclaredMethod(name, MessageSupplier.class, Throwable.class);
-            cls.getDeclaredMethod(name, String.class, Supplier[].class);
-            cls.getDeclaredMethod(name, Supplier.class);
-            cls.getDeclaredMethod(name, Supplier.class, Throwable.class);
+            assertDoesNotThrow(() -> {
+                cls.getDeclaredMethod(name, Marker.class, Message.class, Throwable.class);
+                cls.getDeclaredMethod(name, Marker.class, Object.class, Throwable.class);
+                cls.getDeclaredMethod(name, Marker.class, String.class, Throwable.class);
+                cls.getDeclaredMethod(name, Marker.class, Message.class);
+                cls.getDeclaredMethod(name, Marker.class, Object.class);
+                cls.getDeclaredMethod(name, Marker.class, String.class);
+                cls.getDeclaredMethod(name, Message.class);
+                cls.getDeclaredMethod(name, Object.class);
+                cls.getDeclaredMethod(name, String.class);
+                cls.getDeclaredMethod(name, Message.class, Throwable.class);
+                cls.getDeclaredMethod(name, Object.class, Throwable.class);
+                cls.getDeclaredMethod(name, String.class, Throwable.class);
+                cls.getDeclaredMethod(name, String.class, Object[].class);
+                cls.getDeclaredMethod(name, Marker.class, String.class, Object[].class);
+
+                // 2.4 lambda support
+                cls.getDeclaredMethod(name, Marker.class, MessageSupplier.class);
+                cls.getDeclaredMethod(name, Marker.class, MessageSupplier.class, Throwable.class);
+                cls.getDeclaredMethod(name, Marker.class, String.class, Supplier[].class);
+                cls.getDeclaredMethod(name, Marker.class, Supplier.class);
+                cls.getDeclaredMethod(name, Marker.class, Supplier.class, Throwable.class);
+                cls.getDeclaredMethod(name, MessageSupplier.class);
+                cls.getDeclaredMethod(name, MessageSupplier.class, Throwable.class);
+                cls.getDeclaredMethod(name, String.class, Supplier[].class);
+                cls.getDeclaredMethod(name, Supplier.class);
+                cls.getDeclaredMethod(name, Supplier.class, Throwable.class);
+            });
         }
 
         // now see if it actually works...
-        final Method create = cls.getDeclaredMethod("create", new Class[] { String.class });
+        final Method create = cls.getDeclaredMethod("create", String.class);
         final Object customLogger = create.invoke(null, "X.Y.Z");
         int n = 0;
         for (final String name : logMethods) {
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/tools/GenerateExtendedLoggerTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/tools/GenerateExtendedLoggerTest.java
index b97ef91..127b889 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/tools/GenerateExtendedLoggerTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/tools/GenerateExtendedLoggerTest.java
@@ -24,6 +24,7 @@ import java.lang.reflect.Modifier;
 import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 import java.util.Locale;
 
@@ -37,20 +38,21 @@ import javax.tools.ToolProvider;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Marker;
 import org.apache.logging.log4j.TestLogger;
-import org.apache.logging.log4j.core.tools.Generate;
 import org.apache.logging.log4j.message.Message;
 import org.apache.logging.log4j.message.MessageFactory;
 import org.apache.logging.log4j.spi.ExtendedLogger;
 import org.apache.logging.log4j.util.MessageSupplier;
 import org.apache.logging.log4j.util.Supplier;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
+@Tag("functional")
 public class GenerateExtendedLoggerTest {
-
-    @BeforeClass
+    
+    @BeforeAll
     public static void beforeClass() {
         System.setProperty("log4j2.loggerContextFactory", "org.apache.logging.log4j.TestLoggerContextFactory");
     }
@@ -75,7 +77,7 @@ public class GenerateExtendedLoggerTest {
         final List<String> errors = new ArrayList<>();
         try (final StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnostics, null, null)) {
             final Iterable<? extends JavaFileObject> compilationUnits = fileManager
-                    .getJavaFileObjectsFromFiles(Arrays.asList(f));
+                    .getJavaFileObjectsFromFiles(Collections.singletonList(f));
 
             // compile generated source
             compiler.getTask(null, fileManager, diagnostics, null, null, compilationUnits).call();
@@ -87,16 +89,16 @@ public class GenerateExtendedLoggerTest {
                 }
             }
         }
-        assertTrue(errors.toString(), errors.isEmpty());
+        assertTrue(errors.isEmpty(), errors.toString());
 
         // load the compiled class
         final Class<?> cls = Class.forName(CLASSNAME);
 
         // check that all factory methods exist and are static
-        assertTrue(Modifier.isStatic(cls.getDeclaredMethod("create", new Class[0]).getModifiers()));
-        assertTrue(Modifier.isStatic(cls.getDeclaredMethod("create", new Class[] { Class.class }).getModifiers()));
-        assertTrue(Modifier.isStatic(cls.getDeclaredMethod("create", new Class[] { Object.class }).getModifiers()));
-        assertTrue(Modifier.isStatic(cls.getDeclaredMethod("create", new Class[] { String.class }).getModifiers()));
+        assertTrue(Modifier.isStatic(cls.getDeclaredMethod("create").getModifiers()));
+        assertTrue(Modifier.isStatic(cls.getDeclaredMethod("create", Class.class).getModifiers()));
+        assertTrue(Modifier.isStatic(cls.getDeclaredMethod("create", Object.class).getModifiers()));
+        assertTrue(Modifier.isStatic(cls.getDeclaredMethod("create", String.class).getModifiers()));
         assertTrue(Modifier.isStatic(cls.getDeclaredMethod("create", Class.class, MessageFactory.class).getModifiers()));
         assertTrue(Modifier
                 .isStatic(cls.getDeclaredMethod("create", Object.class, MessageFactory.class).getModifiers()));
@@ -106,43 +108,45 @@ public class GenerateExtendedLoggerTest {
         // check that the extended log methods exist
         final String[] extendedMethods = { "diag", "notice", "verbose" };
         for (final String name : extendedMethods) {
-            cls.getDeclaredMethod(name, Marker.class, Message.class, Throwable.class);
-            cls.getDeclaredMethod(name, Marker.class, Object.class, Throwable.class);
-            cls.getDeclaredMethod(name, Marker.class, String.class, Throwable.class);
-            cls.getDeclaredMethod(name, Marker.class, Message.class);
-            cls.getDeclaredMethod(name, Marker.class, Object.class);
-            cls.getDeclaredMethod(name, Marker.class, String.class);
-            cls.getDeclaredMethod(name, Message.class);
-            cls.getDeclaredMethod(name, Object.class);
-            cls.getDeclaredMethod(name, String.class);
-            cls.getDeclaredMethod(name, Message.class, Throwable.class);
-            cls.getDeclaredMethod(name, Object.class, Throwable.class);
-            cls.getDeclaredMethod(name, String.class, Throwable.class);
-            cls.getDeclaredMethod(name, String.class, Object[].class);
-            cls.getDeclaredMethod(name, Marker.class, String.class, Object[].class);
-
-            // 2.4 lambda support
-            cls.getDeclaredMethod(name, Marker.class, MessageSupplier.class);
-            cls.getDeclaredMethod(name, Marker.class, MessageSupplier.class, Throwable.class);
-            cls.getDeclaredMethod(name, Marker.class, String.class, Supplier[].class);
-            cls.getDeclaredMethod(name, Marker.class, Supplier.class);
-            cls.getDeclaredMethod(name, Marker.class, Supplier.class, Throwable.class);
-            cls.getDeclaredMethod(name, MessageSupplier.class);
-            cls.getDeclaredMethod(name, MessageSupplier.class, Throwable.class);
-            cls.getDeclaredMethod(name, String.class, Supplier[].class);
-            cls.getDeclaredMethod(name, Supplier.class);
-            cls.getDeclaredMethod(name, Supplier.class, Throwable.class);
+            assertDoesNotThrow(() -> {
+                cls.getDeclaredMethod(name, Marker.class, Message.class, Throwable.class);
+                cls.getDeclaredMethod(name, Marker.class, Object.class, Throwable.class);
+                cls.getDeclaredMethod(name, Marker.class, String.class, Throwable.class);
+                cls.getDeclaredMethod(name, Marker.class, Message.class);
+                cls.getDeclaredMethod(name, Marker.class, Object.class);
+                cls.getDeclaredMethod(name, Marker.class, String.class);
+                cls.getDeclaredMethod(name, Message.class);
+                cls.getDeclaredMethod(name, Object.class);
+                cls.getDeclaredMethod(name, String.class);
+                cls.getDeclaredMethod(name, Message.class, Throwable.class);
+                cls.getDeclaredMethod(name, Object.class, Throwable.class);
+                cls.getDeclaredMethod(name, String.class, Throwable.class);
+                cls.getDeclaredMethod(name, String.class, Object[].class);
+                cls.getDeclaredMethod(name, Marker.class, String.class, Object[].class);
+
+                // 2.4 lambda support
+                cls.getDeclaredMethod(name, Marker.class, MessageSupplier.class);
+                cls.getDeclaredMethod(name, Marker.class, MessageSupplier.class, Throwable.class);
+                cls.getDeclaredMethod(name, Marker.class, String.class, Supplier[].class);
+                cls.getDeclaredMethod(name, Marker.class, Supplier.class);
+                cls.getDeclaredMethod(name, Marker.class, Supplier.class, Throwable.class);
+                cls.getDeclaredMethod(name, MessageSupplier.class);
+                cls.getDeclaredMethod(name, MessageSupplier.class, Throwable.class);
+                cls.getDeclaredMethod(name, String.class, Supplier[].class);
+                cls.getDeclaredMethod(name, Supplier.class);
+                cls.getDeclaredMethod(name, Supplier.class, Throwable.class);
+            });
         }
 
         // now see if it actually works...
-        final Method create = cls.getDeclaredMethod("create", new Class[] { String.class });
+        final Method create = cls.getDeclaredMethod("create", String.class);
         final Object extendedLogger = create.invoke(null, "X.Y.Z");
         int n = 0;
         for (final String name : extendedMethods) {
             final Method method = cls.getDeclaredMethod(name, String.class);
             method.invoke(extendedLogger, "This is message " + n++);
         }
-
+        
         // This logger extends o.a.l.log4j.spi.ExtendedLogger,
         // so all the standard logging methods can be used as well
         final ExtendedLogger logger = (ExtendedLogger) extendedLogger;
@@ -158,7 +162,7 @@ public class GenerateExtendedLoggerTest {
         for (int i = 0; i < lines.size() - 6; i++) {
             assertEquals(" " + levels.get(i).name + " This is message " + i, lines.get(i));
         }
-
+        
         // test that the standard logging methods still work
         int i = lines.size() - 6;
         assertEquals(" TRACE trace message", lines.get(i++));
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ClockFactoryTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ClockFactoryTest.java
index 309cc77..2654fd0 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ClockFactoryTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ClockFactoryTest.java
@@ -16,16 +16,20 @@
  */
 package org.apache.logging.log4j.core.util;
 
-import java.lang.reflect.Field;
-
 import org.apache.commons.lang3.reflect.FieldUtils;
 import org.apache.logging.log4j.core.async.AsyncLogger;
 import org.apache.logging.log4j.core.impl.Log4jLogEvent;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledOnJre;
+import org.junit.jupiter.api.condition.JRE;
+
+import java.lang.reflect.Field;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
+// as of Java 12, final fields can no longer be overwritten via reflection
+@EnabledOnJre({ JRE.JAVA_8, JRE.JAVA_9, JRE.JAVA_10, JRE.JAVA_11 })
 public class ClockFactoryTest {
 
     public static void resetClocks() throws IllegalAccessException {
@@ -40,7 +44,7 @@ public class ClockFactoryTest {
         FieldUtils.writeStaticField(field, ClockFactory.getClock(), false);
     }
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         resetClocks();
     }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ContextDataProviderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ContextDataProviderTest.java
index f52c87d..ac01cde 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ContextDataProviderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ContextDataProviderTest.java
@@ -23,42 +23,39 @@ import org.apache.logging.log4j.core.LoggerContext;
 import org.apache.logging.log4j.core.config.ConfigurationFactory;
 import org.apache.logging.log4j.core.impl.ThreadContextDataInjector;
 import org.apache.logging.log4j.test.appender.ListAppender;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
 
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.*;
 
-/**
- *
- */
+@Tag("functional")
 public class ContextDataProviderTest {
 
     private static Logger logger;
     private static ListAppender appender;
 
-    @BeforeClass
+    @BeforeAll
     public static void beforeClass() {
         ThreadContextDataInjector.contextDataProviders.add(new TestContextDataProvider());
-        System.setProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY, "target/test-classes/log4j-contextData.xml");
+        System.setProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY, "log4j-contextData.xml");
         LoggerContext loggerContext = (LoggerContext) LogManager.getContext(false);
         logger = loggerContext.getLogger(ContextDataProviderTest.class.getName());
         appender = loggerContext.getConfiguration().getAppender("List");
-        assertNotNull("No List appender", appender);
+        assertNotNull(appender, "No List appender");
     }
 
     @Test
-    public void testContextProvider() throws Exception {
+    public void testContextProvider() {
         ThreadContext.put("loginId", "jdoe");
         logger.debug("This is a test");
         List<String> messages = appender.getMessages();
-        assertEquals("Incorrect number of messages", 1, messages.size());
-        assertTrue("Context data missing", messages.get(0).contains("testKey=testValue"));
+        assertEquals(1, messages.size(), "Incorrect number of messages");
+        assertTrue(messages.get(0).contains("testKey=testValue"), "Context data missing");
     }
 
     private static class TestContextDataProvider implements ContextDataProvider {
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/CronExpressionTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/CronExpressionTest.java
index c00d2f0..007a40e 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/CronExpressionTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/CronExpressionTest.java
@@ -16,14 +16,14 @@
  */
 package org.apache.logging.log4j.core.util;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.GregorianCalendar;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Class Description goes here.
@@ -37,7 +37,7 @@ public class CronExpressionTest {
         final Date date = new GregorianCalendar(2015, 11, 2).getTime();
         final Date fireDate = parser.getNextValidTimeAfter(date);
         final Date expected = new GregorianCalendar(2015, 11, 2, 7, 0, 0).getTime();
-        assertEquals("Dates not equal.", expected, fireDate);
+        assertEquals(expected, fireDate, "Dates not equal.");
     }
 
     @Test
@@ -46,7 +46,7 @@ public class CronExpressionTest {
         final Date date = new GregorianCalendar(2015, 11, 2).getTime();
         final Date fireDate = parser.getNextValidTimeAfter(date);
         final Date expected = new GregorianCalendar(2015, 11, 4, 7, 0, 0).getTime();
-        assertEquals("Dates not equal.", expected, fireDate);
+        assertEquals(expected, fireDate, "Dates not equal.");
     }
 
     @Test
@@ -55,7 +55,7 @@ public class CronExpressionTest {
         final Date date = new GregorianCalendar(2015, 11, 2).getTime();
         final Date fireDate = parser.getNextValidTimeAfter(date);
         final Date expected = new GregorianCalendar(2016, 0, 1, 7, 0, 0).getTime();
-        assertEquals("Dates not equal.", expected, fireDate);
+        assertEquals(expected, fireDate, "Dates not equal.");
     }
 
     @Test
@@ -64,7 +64,7 @@ public class CronExpressionTest {
         final Date date = new GregorianCalendar(2015, 10, 2).getTime();
         final Date fireDate = parser.getNextValidTimeAfter(date);
         final Date expected = new GregorianCalendar(2015, 10, 30, 7, 0, 0).getTime();
-        assertEquals("Dates not equal.", expected, fireDate);
+        assertEquals(expected, fireDate, "Dates not equal.");
     }
 
     @Test
@@ -73,7 +73,7 @@ public class CronExpressionTest {
         final Date date = new GregorianCalendar(2015, 10, 2).getTime();
         final Date fireDate = parser.getNextValidTimeAfter(date);
         final Date expected = new GregorianCalendar(2015, 10, 3, 0, 0, 0).getTime();
-        assertEquals("Dates not equal.", expected, fireDate);
+        assertEquals(expected, fireDate, "Dates not equal.");
     }
 
     @Test
@@ -82,7 +82,7 @@ public class CronExpressionTest {
         final Date date = new GregorianCalendar(2015, 10, 2).getTime();
         final Date fireDate = parser.getPrevFireTime(date);
         final Date expected = new GregorianCalendar(2015, 9, 31, 17, 45, 0).getTime();
-        assertEquals("Dates not equal.", expected, fireDate);
+        assertEquals(expected, fireDate, "Dates not equal.");
     }
 
     @Test
@@ -91,7 +91,7 @@ public class CronExpressionTest {
         final Date date = new GregorianCalendar(2015, 10, 2).getTime();
         final Date fireDate = parser.getPrevFireTime(date);
         final Date expected = new GregorianCalendar(2015, 10, 1, 18, 55, 0).getTime();
-        assertEquals("Dates not equal.", expected, fireDate);
+        assertEquals(expected, fireDate, "Dates not equal.");
     }
 
     /**
@@ -103,7 +103,7 @@ public class CronExpressionTest {
         final Date date = new GregorianCalendar(2015, 10, 2).getTime();
         final Date fireDate = parser.getPrevFireTime(date);
         final Date expected = new GregorianCalendar(2015, 10, 1, 23, 55, 0).getTime();
-        assertEquals("Dates not equal.", expected, fireDate);
+        assertEquals(expected, fireDate, "Dates not equal.");
     }
 
     /**
@@ -116,7 +116,7 @@ public class CronExpressionTest {
         final Date date = new GregorianCalendar(2015, 10, 2).getTime();
         final Date fireDate = parser.getPrevFireTime(date);
         final Date expected = new GregorianCalendar(2015, 10, 1, 10, 15, 0).getTime();
-        assertEquals("Dates not equal.", expected, fireDate);
+        assertEquals(expected, fireDate, "Dates not equal.");
     }
 
     /**
@@ -128,7 +128,7 @@ public class CronExpressionTest {
         final Date date = new GregorianCalendar(2015, 10, 2).getTime();
         final Date fireDate = parser.getPrevFireTime(date);
         final Date expected = new GregorianCalendar(2015, 10, 1, 14, 59, 0).getTime();
-        assertEquals("Dates not equal.", expected, fireDate);
+        assertEquals(expected, fireDate, "Dates not equal.");
     }
 
     /**
@@ -140,7 +140,7 @@ public class CronExpressionTest {
         final Date date = new GregorianCalendar(2015, 10, 2).getTime();
         final Date fireDate = parser.getPrevFireTime(date);
         final Date expected = new GregorianCalendar(2015, 2, 25, 14, 44, 0).getTime();
-        assertEquals("Dates not equal.", expected, fireDate);
+        assertEquals(expected, fireDate, "Dates not equal.");
     }
 
     /**
@@ -152,7 +152,7 @@ public class CronExpressionTest {
         final Date date = new GregorianCalendar(2015, 10, 2).getTime();
         final Date fireDate = parser.getPrevFireTime(date);
         final Date expected = new GregorianCalendar(2015, 9, 16, 10, 15, 0).getTime();
-        assertEquals("Dates not equal.", expected, fireDate);
+        assertEquals(expected, fireDate, "Dates not equal.");
     }
 
     /*
@@ -170,7 +170,7 @@ public class CronExpressionTest {
         final Date fireDate = parser.getTimeBefore(date);
         System.err.println(sdf.format(fireDate));
         final Date expected = new GregorianCalendar(2015, 10, 1, 0, 0, 0).getTime();
-        assertEquals("Dates not equal.", expected, fireDate);
+        assertEquals(expected, fireDate, "Dates not equal.");
     }
 
 }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/CyclicBufferTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/CyclicBufferTest.java
index 91f183a..2c48cb9 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/CyclicBufferTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/CyclicBufferTest.java
@@ -16,11 +16,9 @@
  */
 package org.apache.logging.log4j.core.util;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import org.junit.jupiter.api.Test;
 
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.*;
 
 public class CyclicBufferTest {
 
@@ -32,7 +30,7 @@ public class CyclicBufferTest {
         buffer.add(1);
         assertTrue(buffer.isEmpty());
         Integer[] items = buffer.removeAll();
-        assertTrue("Incorrect number of items", items.length == 0);
+        assertEquals(0, items.length, "Incorrect number of items");
 
         assertTrue(buffer.isEmpty());
         buffer.add(1);
@@ -40,7 +38,7 @@ public class CyclicBufferTest {
         buffer.add(3);
         buffer.add(4);
         items = buffer.removeAll();
-        assertTrue("Incorrect number of items", items.length == 0);
+        assertEquals(0, items.length, "Incorrect number of items");
         assertTrue(buffer.isEmpty());
     }
 
@@ -52,7 +50,7 @@ public class CyclicBufferTest {
         buffer.add(1);
         assertFalse(buffer.isEmpty());
         Integer[] items = buffer.removeAll();
-        assertTrue("Incorrect number of items", items.length == 1);
+        assertEquals(1, items.length, "Incorrect number of items");
 
         assertTrue(buffer.isEmpty());
         buffer.add(1);
@@ -60,7 +58,7 @@ public class CyclicBufferTest {
         buffer.add(3);
         buffer.add(4);
         items = buffer.removeAll();
-        assertTrue("Incorrect number of items", items.length == 1);
+        assertEquals(1, items.length, "Incorrect number of items");
         assertArrayEquals(new Integer[] { 4 }, items);
         assertTrue(buffer.isEmpty());
     }
@@ -73,7 +71,7 @@ public class CyclicBufferTest {
         buffer.add(1);
         assertFalse(buffer.isEmpty());
         Integer[] items = buffer.removeAll();
-        assertTrue("Incorrect number of items", items.length == 1);
+        assertEquals(1, items.length, "Incorrect number of items");
 
         assertTrue(buffer.isEmpty());
         buffer.add(1);
@@ -81,14 +79,14 @@ public class CyclicBufferTest {
         buffer.add(3);
         buffer.add(4);
         items = buffer.removeAll();
-        assertTrue("Incorrect number of items", items.length == 3);
+        assertEquals(3, items.length, "Incorrect number of items");
         assertArrayEquals(new Integer[] { 2, 3, 4 }, items);
         assertTrue(buffer.isEmpty());
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testSizeNegative() {
-        final CyclicBuffer<Integer> buffer = new CyclicBuffer<>(Integer.class, -1);
+        assertThrows(IllegalArgumentException.class, () -> new CyclicBuffer<>(Integer.class, -1));
     }
 
 }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/DummyNanoClockTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/DummyNanoClockTest.java
index 8fc16b6..202002a 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/DummyNanoClockTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/DummyNanoClockTest.java
@@ -1,39 +1,39 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-
-package org.apache.logging.log4j.core.util;
-
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * Tests the DummyNanoClock.
- */
-public class DummyNanoClockTest {
-
-    @Test
-    public void testReturnsZeroByDefault() {
-        assertEquals(0, new DummyNanoClock().nanoTime());
-    }
-
-    @Test
-    public void testReturnsConstructorValue() {
-        assertEquals(123, new DummyNanoClock(123).nanoTime());
-    }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.core.util;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+/**
+ * Tests the DummyNanoClock.
+ */
+public class DummyNanoClockTest {
+
+    @Test
+    public void testReturnsZeroByDefault() {
+        assertEquals(0, new DummyNanoClock().nanoTime());
+    }
+
+    @Test
+    public void testReturnsConstructorValue() {
+        assertEquals(123, new DummyNanoClock(123).nanoTime());
+    }
+
+}
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/FileUtilsTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/FileUtilsTest.java
index 17568dc..fd1539c 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/FileUtilsTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/FileUtilsTest.java
@@ -17,16 +17,12 @@
 
 package org.apache.logging.log4j.core.util;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import org.junit.jupiter.api.Test;
 
 import java.io.File;
 import java.net.URI;
 
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests the FileUtils class.
@@ -41,7 +37,7 @@ public class FileUtilsTest {
         final URI uri = new URI(config);
         final File file = FileUtils.fileFromUri(uri);
         assertEquals(LOG4J_CONFIG_WITH_PLUS, file.getName());
-        assertTrue("file exists", file.exists());
+        assertTrue(file.exists(), "file exists");
     }
 
     @Test
@@ -50,7 +46,7 @@ public class FileUtilsTest {
         final URI uri = new File(config).toURI();
         final File file = FileUtils.fileFromUri(uri);
         assertEquals(LOG4J_CONFIG_WITH_PLUS, file.getName());
-        assertTrue("file exists", file.exists());
+        assertTrue(file.exists(), "file exists");
     }
 
     @Test
@@ -59,7 +55,7 @@ public class FileUtilsTest {
         final URI uri = new File(config).toURI();
         final File file = FileUtils.fileFromUri(uri);
         assertEquals(LOG4J_CONFIG_WITH_PLUS, file.getName());
-        assertTrue("file exists", file.exists());
+        assertTrue(file.exists(), "file exists");
     }
 
     @Test
@@ -70,7 +66,7 @@ public class FileUtilsTest {
         final URI uri = URI.create(uriStr);
         final File file = FileUtils.fileFromUri(uri);
         assertEquals(LOG4J_CONFIG_WITH_PLUS, file.getName());
-        assertTrue("file exists", file.exists());
+        assertTrue(file.exists(), "file exists");
     }
 
     @Test
@@ -79,7 +75,7 @@ public class FileUtilsTest {
         final URI uri = new URI(config);
         final File file = FileUtils.fileFromUri(uri);
         assertEquals(LOG4J_CONFIG_WITH_PLUS, file.getName());
-        assertTrue("file exists", file.exists());
+        assertTrue(file.exists(), "file exists");
     }
 
 }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/InitTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/InitTest.java
index d74ece3..9da7cd9 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/InitTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/InitTest.java
@@ -16,22 +16,20 @@
  */
 package org.apache.logging.log4j.core.util;
 
-import static org.junit.Assert.assertTrue;
-
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.util.Timer;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /**
  * Test initialization.
  */
-@Ignore
+@Disabled
 public class InitTest {
 
-    private static final String KEY = InitTest.class.getSimpleName() + ".threshold";
-
     @Test
     public void initTest() {
         Timer timer = new Timer("Log4j Initialization");
@@ -40,9 +38,6 @@ public class InitTest {
         timer.stop();
         long elapsed = timer.getElapsedNanoTime();
         System.out.println(timer.toString());
-        long threshold = Long.getLong(KEY, 1_000_000_000);
-        assertTrue(
-                String.format("Initialization time exceeded %s %,d; elapsed %,d nanoseconds", KEY, threshold, elapsed),
-                elapsed < threshold);
+        assertTrue(elapsed < 1000000000, "Initialization time exceeded threshold; elapsed " + elapsed);
     }
 }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/IntegersTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/IntegersTest.java
index 66d5002..63756df 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/IntegersTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/IntegersTest.java
@@ -17,9 +17,9 @@
 
 package org.apache.logging.log4j.core.util;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests the Integers class.
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/JsonUtilsTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/JsonUtilsTest.java
index 76e0f5a..a473028 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/JsonUtilsTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/JsonUtilsTest.java
@@ -17,9 +17,9 @@
 
 package org.apache.logging.log4j.core.util;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * This class is borrowed from <a href="https://github.com/FasterXML/jackson-core">Jackson</a>.
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/LoaderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/LoaderTest.java
index c97d3b6..38b69ef 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/LoaderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/LoaderTest.java
@@ -17,9 +17,9 @@
 
 package org.apache.logging.log4j.core.util;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests the Loader class.
@@ -28,13 +28,14 @@ public class LoaderTest {
 
     @Test
     public void testLoadClassWithNullClassloaderReturnNull() throws Exception {
-        assertNull("Expect null return value for null ClassLoader.",
-                Loader.loadClass(Loader.class.getCanonicalName(), null));
+        assertNull(
+                Loader.loadClass(Loader.class.getCanonicalName(), null), "Expect null return value for null ClassLoader.");
     }
 
     @Test
     public void testLoadClassReturnClassForExistingClass() throws Exception {
-        assertEquals("Expect Class return value for null ClassLoader.", Loader.class,
-                Loader.loadClass(Loader.class.getCanonicalName(), Loader.getClassLoader()));
+        assertEquals(Loader.class,
+                Loader.loadClass(Loader.class.getCanonicalName(), Loader.getClassLoader()),
+                "Expect Class return value for null ClassLoader.");
     }
 }
\ No newline at end of file
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/NetUtilsTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/NetUtilsTest.java
index fc40037..a1cf6ab 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/NetUtilsTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/NetUtilsTest.java
@@ -17,47 +17,44 @@
 
 package org.apache.logging.log4j.core.util;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledOnOs;
+import org.junit.jupiter.api.condition.OS;
 
 import java.net.URI;
-import java.net.URISyntaxException;
 
-import org.apache.logging.log4j.util.PropertiesUtil;
-import org.junit.Assume;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 public class NetUtilsTest {
 
-    private static final boolean IS_WINDOWS = PropertiesUtil.getProperties().isOsWindows();
-
     @Test
     public void testToUriWithoutBackslashes() {
         final String config = "file:///path/to/something/on/unix";
         final URI uri = NetUtils.toURI(config);
 
-        assertNotNull("The URI should not be null.", uri);
-        assertEquals("The URI is not correct.", "file:///path/to/something/on/unix", uri.toString());
+        assertNotNull(uri, "The URI should not be null.");
+        assertEquals("file:///path/to/something/on/unix", uri.toString(), "The URI is not correct.");
     }
 
     @Test
+    @EnabledOnOs(OS.WINDOWS)
     public void testToUriWindowsWithBackslashes() {
-        Assume.assumeTrue(IS_WINDOWS);
         final String config = "file:///D:\\path\\to\\something/on/windows";
         final URI uri = NetUtils.toURI(config);
 
-        assertNotNull("The URI should not be null.", uri);
-        assertEquals("The URI is not correct.", "file:///D:/path/to/something/on/windows", uri.toString());
+        assertNotNull(uri, "The URI should not be null.");
+        assertEquals("file:///D:/path/to/something/on/windows", uri.toString(), "The URI is not correct.");
     }
 
     @Test
+    @EnabledOnOs(OS.WINDOWS)
     public void testToUriWindowsAbsolutePath() {
-        Assume.assumeTrue(IS_WINDOWS);
         final String config = "D:\\path\\to\\something\\on\\windows";
         final URI uri = NetUtils.toURI(config);
 
-        assertNotNull("The URI should not be null.", uri);
-        assertEquals("The URI is not correct.", "file:/D:/path/to/something/on/windows", uri.toString());
+        assertNotNull(uri, "The URI should not be null.");
+        assertEquals("file:/D:/path/to/something/on/windows", uri.toString(), "The URI is not correct.");
     }
 
 }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ShutdownCallbackRegistryTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ShutdownCallbackRegistryTest.java
index 4a86d12..48e4a9e 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ShutdownCallbackRegistryTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ShutdownCallbackRegistryTest.java
@@ -24,42 +24,39 @@ import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.LoggerContext;
 import org.apache.logging.log4j.core.impl.Log4jContextFactory;
 import org.apache.logging.log4j.core.selector.ContextSelector;
-import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.apache.logging.log4j.junit.LoggerContextSource;
 import org.apache.logging.log4j.status.StatusLogger;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 
+import static org.hamcrest.MatcherAssert.*;
 import static org.hamcrest.Matchers.hasItem;
 import static org.hamcrest.Matchers.hasSize;
 import static org.hamcrest.Matchers.not;
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 public class ShutdownCallbackRegistryTest {
 
-    @Rule
-    public final LoggerContextRule ctx = new LoggerContextRule("ShutdownCallbackRegistryTest.xml");
-
-    @BeforeClass
-    public static void setUpClass() throws Exception {
+    @BeforeAll
+    public static void setUpClass() {
         System.setProperty("log4j2.is.webapp", "false");
         System.setProperty(ShutdownCallbackRegistry.SHUTDOWN_CALLBACK_REGISTRY, Registry.class.getName());
     }
 
-    @AfterClass
+    @AfterAll
     public static void afterClass() {
         System.clearProperty(ShutdownCallbackRegistry.SHUTDOWN_CALLBACK_REGISTRY);
         System.clearProperty("log4j2.is.webapp");
     }
 
     @Test
-    public void testShutdownCallbackRegistry() throws Exception {
-        final LoggerContext context = ctx.getLoggerContext();
-        assertTrue("LoggerContext should be started", context.isStarted());
+    @LoggerContextSource("ShutdownCallbackRegistryTest.xml")
+    public void testShutdownCallbackRegistry(final LoggerContext context) {
+        assertTrue(context.isStarted(), "LoggerContext should be started");
         assertThat(Registry.CALLBACKS, hasSize(1));
         Registry.shutdown();
-        assertTrue("LoggerContext should be stopped", context.isStopped());
+        assertTrue(context.isStopped(), "LoggerContext should be stopped");
         assertThat(Registry.CALLBACKS, hasSize(0));
         final ContextSelector selector = ((Log4jContextFactory) LogManager.getFactory()).getSelector();
         assertThat(selector.getLoggerContexts(), not(hasItem(context)));
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/SystemClockTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/SystemClockTest.java
index 5421a7d..1eee2b3 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/SystemClockTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/SystemClockTest.java
@@ -16,9 +16,9 @@
  */
 package org.apache.logging.log4j.core.util;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 public class SystemClockTest {
 
@@ -29,7 +29,7 @@ public class SystemClockTest {
 
         final long diff = sysMillis - millis1;
 
-        assertTrue("diff too large: " + diff, diff <= 1);
+        assertTrue(diff <= 1, "diff too large: " + diff);
     }
 
     @Test
@@ -40,7 +40,7 @@ public class SystemClockTest {
 
         final long diff = sysMillis - millis1;
 
-        assertTrue("diff too large: " + diff, diff <= 1);
+        assertTrue(diff <= 1, "diff too large: " + diff);
     }
 
 }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/SystemNanoClockTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/SystemNanoClockTest.java
index 9adea85..c8a43c1 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/SystemNanoClockTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/SystemNanoClockTest.java
@@ -1,39 +1,39 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-
-package org.apache.logging.log4j.core.util;
-
-import java.util.concurrent.TimeUnit;
-
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * Tests the SystemNanoClock.
- */
-public class SystemNanoClockTest {
-
-    @Test
-    public void testReturnsSystemNanoTime() {
-        final NanoClock clock = new SystemNanoClock();
-        final long expected = System.nanoTime();
-        final long actual = clock.nanoTime();
-        assertTrue("smal difference", actual - expected < TimeUnit.SECONDS.toNanos(1));
-    }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.core.util;
+
+import org.junit.jupiter.api.Test;
+
+import java.util.concurrent.TimeUnit;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * Tests the SystemNanoClock.
+ */
+public class SystemNanoClockTest {
+
+    @Test
+    public void testReturnsSystemNanoTime() {
+        final NanoClock clock = new SystemNanoClock();
+        final long expected = System.nanoTime();
+        final long actual = clock.nanoTime();
+        assertTrue(actual - expected < TimeUnit.SECONDS.toNanos(1), "smal difference");
+    }
+
+}
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ThrowablesTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ThrowablesTest.java
index 7e354bc..098d9ef 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ThrowablesTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/ThrowablesTest.java
@@ -16,22 +16,24 @@
  */
 package org.apache.logging.log4j.core.util;
 
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 public class ThrowablesTest {
 
     @Test
     public void testGetRootCauseNone() {
         final NullPointerException throwable = new NullPointerException();
-        Assert.assertEquals(throwable, Throwables.getRootCause(throwable));
+        assertEquals(throwable, Throwables.getRootCause(throwable));
     }
 
     @Test
     public void testGetRootCauseDepth1() {
         final Throwable cause = new NullPointerException();
         final Throwable error = new UnsupportedOperationException(cause);
-        Assert.assertEquals(cause, Throwables.getRootCause(error));
+        assertEquals(cause, Throwables.getRootCause(error));
     }
 
     @Test
@@ -39,31 +41,31 @@ public class ThrowablesTest {
         final Throwable rootCause = new NullPointerException();
         final Throwable cause = new UnsupportedOperationException(rootCause);
         final Throwable error = new IllegalArgumentException(cause);
-        Assert.assertEquals(rootCause, Throwables.getRootCause(error));
+        assertEquals(rootCause, Throwables.getRootCause(error));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @SuppressWarnings("ThrowableNotThrown")
+    @Test
     public void testGetRootCauseLoop() {
         final Throwable cause1 = new RuntimeException();
         final Throwable cause2 = new RuntimeException(cause1);
         final Throwable cause3 = new RuntimeException(cause2);
         cause1.initCause(cause3);
-        // noinspection ThrowableNotThrown
-        Throwables.getRootCause(cause3);
+        assertThrows(IllegalArgumentException.class, () -> Throwables.getRootCause(cause3));
     }
 
-    @Test(expected = NullPointerException.class)
+    @Test
     public void testRethrowRuntimeException() {
-        Throwables.rethrow(new NullPointerException());
+        assertThrows(NullPointerException.class, () -> Throwables.rethrow(new NullPointerException()));
     }
 
-    @Test(expected = UnknownError.class)
+    @Test
     public void testRethrowError() {
-        Throwables.rethrow(new UnknownError());
+        assertThrows(UnknownError.class, () -> Throwables.rethrow(new UnknownError()));
     }
 
-    @Test(expected = NoSuchMethodException.class)
+    @Test
     public void testRethrowCheckedException() {
-        Throwables.rethrow(new NoSuchMethodException());
+        assertThrows(NoSuchMethodException.class, () -> Throwables.rethrow(new NoSuchMethodException()));
     }
 }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/UuidTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/UuidTest.java
index dbb4517..84bd5cc 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/UuidTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/UuidTest.java
@@ -16,14 +16,12 @@
  */
 package org.apache.logging.log4j.core.util;
 
+import org.junit.jupiter.api.Test;
+
 import java.util.UUID;
 
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.*;
 
-import static org.junit.Assert.*;
-/**
- *
- */
 public class UuidTest {
 
     private static final int COUNT = 200;
@@ -37,7 +35,7 @@ public class UuidTest {
         //final UUID uuid2 = UuidUtil.getTimeBasedUUID(); // unused
         final long current = (System.currentTimeMillis() * 10000) + NUM_100NS_INTERVALS_SINCE_UUID_EPOCH;
         final long time = uuid.timestamp();
-        assertTrue("Incorrect time", current + 10000 - time > 0);
+        assertTrue(current + 10000 - time > 0, "Incorrect time");
         final UUID[] uuids = new UUID[COUNT];
         final long start = System.nanoTime();
         for (int i=0; i < COUNT; ++i) {
@@ -54,13 +52,13 @@ public class UuidTest {
                 }
             }
         }
-        assertEquals(errors + " duplicate UUIDS", 0, errors);
+        assertEquals(0, errors, errors + " duplicate UUIDS");
         final int variant = uuid.variant();
-        assertEquals("Incorrect variant. Expected 2 got " + variant, 2, variant);
+        assertEquals(2, variant, "Incorrect variant. Expected 2 got " + variant);
         final int version = uuid.version();
-        assertEquals("Incorrect version. Expected 1 got " + version, 1, version);
+        assertEquals(1, version, "Incorrect version. Expected 1 got " + version);
         final long node = uuid.node();
-        assertTrue("Invalid node", node != 0);
+        assertTrue(node != 0, "Invalid node");
     }
 
     @Test
@@ -106,7 +104,7 @@ public class UuidTest {
                 }
             }
         }
-        assertEquals(errors + " duplicate UUIDS", 0, errors);
+        assertEquals(0, errors, errors + " duplicate UUIDS");
     }
 
 
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/WatchHttpTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/WatchHttpTest.java
index 1b47cfd..b3c2396 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/WatchHttpTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/WatchHttpTest.java
@@ -155,7 +155,7 @@ public class WatchHttpTest {
         }
     }
 
-    private class TestConfigurationListener implements ConfigurationListener {
+    private static class TestConfigurationListener implements ConfigurationListener {
         private final Queue<String> queue;
         private final String name;
 
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/WatchManagerTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/WatchManagerTest.java
index d70ce69..fecb2e7 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/WatchManagerTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/WatchManagerTest.java
@@ -16,9 +16,6 @@
  */
 package org.apache.logging.log4j.core.util;
 
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
 import java.io.File;
 import java.io.FileOutputStream;
 import java.nio.file.Files;
@@ -31,25 +28,26 @@ import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.logging.log4j.core.config.ConfigurationScheduler;
-import org.apache.logging.log4j.util.PropertiesUtil;
-import org.junit.Assume;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledOnOs;
+import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
+import org.junit.jupiter.api.condition.OS;
+
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Test the WatchManager
  */
+@DisabledOnOs(OS.WINDOWS)
+@EnabledIfSystemProperty(named = "WatchManagerTest.forceRun", matches = "true")
 public class WatchManagerTest {
 
-    private static final String FORCE_RUN_KEY = WatchManagerTest.class.getSimpleName() + ".forceRun";
     private final String testFile = "target/testWatchFile";
     private final String originalFile = "target/test-classes/log4j-test1.xml";
     private final String newFile = "target/test-classes/log4j-test1.yaml";
 
-    private static final boolean IS_WINDOWS = PropertiesUtil.getProperties().isOsWindows();
-
     @Test
     public void testWatchManager() throws Exception {
-        Assume.assumeTrue(!IS_WINDOWS || Boolean.getBoolean(FORCE_RUN_KEY));
         final ConfigurationScheduler scheduler = new ConfigurationScheduler();
         scheduler.incrementScheduledItems();
         final WatchManager watchManager = new WatchManager(scheduler);
@@ -71,7 +69,7 @@ public class WatchManagerTest {
             Files.copy(source, Paths.get(targetFile.toURI()), StandardCopyOption.REPLACE_EXISTING);
             Thread.sleep(1000);
             final File f = queue.poll(1, TimeUnit.SECONDS);
-            assertNotNull("File change not detected", f);
+            assertNotNull(f, "File change not detected");
         } finally {
             watchManager.stop();
             scheduler.stop();
@@ -80,7 +78,6 @@ public class WatchManagerTest {
 
     @Test
     public void testWatchManagerReset() throws Exception {
-        Assume.assumeTrue(!IS_WINDOWS || Boolean.getBoolean(FORCE_RUN_KEY));
         final ConfigurationScheduler scheduler = new ConfigurationScheduler();
         scheduler.incrementScheduledItems();
         final WatchManager watchManager = new WatchManager(scheduler);
@@ -105,7 +102,7 @@ public class WatchManagerTest {
             watchManager.start();
             Thread.sleep(1000);
             final File f = queue.poll(1, TimeUnit.SECONDS);
-            assertNull("File change detected", f);
+            assertNull(f, "File change detected");
         } finally {
             watchManager.stop();
             scheduler.stop();
@@ -114,7 +111,6 @@ public class WatchManagerTest {
 
     @Test
     public void testWatchManagerResetFile() throws Exception {
-        Assume.assumeTrue(!IS_WINDOWS || Boolean.getBoolean(FORCE_RUN_KEY));
         final ConfigurationScheduler scheduler = new ConfigurationScheduler();
         scheduler.incrementScheduledItems();
         final WatchManager watchManager = new WatchManager(scheduler);
@@ -139,14 +135,14 @@ public class WatchManagerTest {
             watchManager.start();
             Thread.sleep(1000);
             final File f = queue.poll(1, TimeUnit.SECONDS);
-            assertNull("File change detected", f);
+            assertNull(f, "File change detected");
         } finally {
             watchManager.stop();
             scheduler.stop();
         }
     }
 
-    private class TestWatcher implements FileWatcher {
+    private static class TestWatcher implements FileWatcher {
 
         private final Queue<File> queue;
 
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/junit/AppenderResolver.java b/log4j-core/src/test/java/org/apache/logging/log4j/junit/AppenderResolver.java
new file mode 100644
index 0000000..cc2f2d4
--- /dev/null
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/junit/AppenderResolver.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.junit;
+
+import org.apache.logging.log4j.core.Appender;
+import org.apache.logging.log4j.core.LoggerContext;
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.junit.jupiter.api.extension.ParameterContext;
+import org.junit.jupiter.api.extension.ParameterResolutionException;
+import org.junit.jupiter.api.extension.ParameterResolver;
+
+import static org.apache.logging.log4j.junit.LoggerContextResolver.getParameterLoggerContext;
+
+class AppenderResolver implements ParameterResolver {
+    @Override
+    public boolean supportsParameter(
+            ParameterContext parameterContext, ExtensionContext extensionContext) throws ParameterResolutionException {
+        return Appender.class.isAssignableFrom(parameterContext.getParameter().getType()) && parameterContext
+                .isAnnotated(Named.class);
+    }
+
+    @Override
+    public Object resolveParameter(
+            ParameterContext parameterContext, ExtensionContext extensionContext) throws ParameterResolutionException {
+        final LoggerContext loggerContext = getParameterLoggerContext(parameterContext, extensionContext);
+        if (loggerContext == null) {
+            throw new ParameterResolutionException("No LoggerContext defined");
+        }
+        final String name = parameterContext.findAnnotation(Named.class)
+                .map(Named::value)
+                .map(s -> s.isEmpty() ? parameterContext.getParameter().getName() : s)
+                .orElseThrow(() -> new ParameterResolutionException("No @Named present after checking earlier"));
+        final Appender appender = loggerContext.getConfiguration().getAppender(name);
+        if (appender == null) {
+            throw new ParameterResolutionException("No appender named " + name);
+        }
+        return appender;
+    }
+}
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/junit/ConfigurationResolver.java b/log4j-core/src/test/java/org/apache/logging/log4j/junit/ConfigurationResolver.java
new file mode 100644
index 0000000..e48b565
--- /dev/null
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/junit/ConfigurationResolver.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.junit;
+
+import org.apache.logging.log4j.core.LoggerContext;
+import org.apache.logging.log4j.core.config.Configuration;
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.junit.jupiter.api.extension.ParameterContext;
+import org.junit.jupiter.api.extension.ParameterResolutionException;
+import org.junit.jupiter.api.extension.support.TypeBasedParameterResolver;
+
+import static org.apache.logging.log4j.junit.LoggerContextResolver.getParameterLoggerContext;
+
+class ConfigurationResolver extends TypeBasedParameterResolver<Configuration> {
+    @Override
+    public Configuration resolveParameter(
+            ParameterContext parameterContext, ExtensionContext extensionContext) throws ParameterResolutionException {
+        final LoggerContext loggerContext = getParameterLoggerContext(parameterContext, extensionContext);
+        if (loggerContext == null) {
+            throw new ParameterResolutionException("No LoggerContext defined");
+        }
+        return loggerContext.getConfiguration();
+    }
+}
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextResolver.java b/log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextResolver.java
new file mode 100644
index 0000000..0859bbd
--- /dev/null
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextResolver.java
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.junit;
+
+import org.apache.logging.log4j.core.LoggerContext;
+import org.apache.logging.log4j.core.config.Configurator;
+import org.junit.jupiter.api.extension.AfterAllCallback;
+import org.junit.jupiter.api.extension.AfterEachCallback;
+import org.junit.jupiter.api.extension.BeforeAllCallback;
+import org.junit.jupiter.api.extension.BeforeEachCallback;
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.junit.jupiter.api.extension.ParameterContext;
+import org.junit.jupiter.api.extension.ParameterResolutionException;
+import org.junit.jupiter.api.extension.support.TypeBasedParameterResolver;
+
+import java.lang.reflect.Method;
+
+class LoggerContextResolver extends TypeBasedParameterResolver<LoggerContext> implements BeforeAllCallback,
+        AfterAllCallback, BeforeEachCallback, AfterEachCallback {
+    @Override
+    public void beforeAll(ExtensionContext context) throws Exception {
+        final Class<?> testClass = context.getRequiredTestClass();
+        final LoggerContextSource source = testClass.getAnnotation(LoggerContextSource.class);
+        if (source != null) {
+            final LoggerContext loggerContext =
+                    Configurator.initialize(context.getDisplayName(), testClass.getClassLoader(), source.value());
+            getTestClassStore(context).put(LoggerContext.class, loggerContext);
+        }
+    }
+
+    @Override
+    public void afterAll(ExtensionContext context) throws Exception {
+        final LoggerContext loggerContext = getTestClassStore(context).get(LoggerContext.class, LoggerContext.class);
+        if (loggerContext != null) {
+            loggerContext.close();
+        }
+    }
+
+    @Override
+    public void beforeEach(ExtensionContext context) throws Exception {
+        final LoggerContextSource source = context.getRequiredTestMethod().getAnnotation(LoggerContextSource.class);
+        if (source != null) {
+            final LoggerContext loggerContext = Configurator
+                    .initialize(context.getDisplayName(), context.getRequiredTestClass().getClassLoader(), source.value());
+            getTestInstanceStore(context).put(LoggerContext.class, loggerContext);
+        }
+    }
+
+    @Override
+    public void afterEach(ExtensionContext context) throws Exception {
+        // method-annotated variant
+        final LoggerContext testInstanceContext = getTestInstanceStore(context).get(LoggerContext.class, LoggerContext.class);
+        if (testInstanceContext != null) {
+            testInstanceContext.close();
+        }
+        // reloadable variant
+        final Class<?> testClass = context.getRequiredTestClass();
+        final LoggerContextSource source = testClass.getAnnotation(LoggerContextSource.class);
+        if (source != null && source.reconfigure()) {
+            final LoggerContext loggerContext = getTestClassStore(context).get(LoggerContext.class, LoggerContext.class);
+            if (loggerContext != null) {
+                loggerContext.reconfigure();
+            }
+        }
+    }
+
+    @Override
+    public LoggerContext resolveParameter(
+            ParameterContext parameterContext, ExtensionContext extensionContext) throws ParameterResolutionException {
+        return getParameterLoggerContext(parameterContext, extensionContext);
+    }
+
+    private static ExtensionContext.Store getTestClassStore(final ExtensionContext context) {
+        return context.getStore(ExtensionContext.Namespace.create(LoggerContext.class, context.getRequiredTestClass()));
+    }
+
+    private static ExtensionContext.Store getTestInstanceStore(final ExtensionContext context) {
+        return context.getStore(ExtensionContext.Namespace.create(LoggerContext.class, context.getRequiredTestInstance()));
+    }
+
+    static LoggerContext getParameterLoggerContext(ParameterContext parameterContext, ExtensionContext extensionContext) {
+        if (parameterContext.getDeclaringExecutable() instanceof Method) {
+            final LoggerContext loggerContext =
+                    getTestInstanceStore(extensionContext).get(LoggerContext.class, LoggerContext.class);
+            return loggerContext != null ? loggerContext :
+                    getTestClassStore(extensionContext).get(LoggerContext.class, LoggerContext.class);
+        }
+        return getTestClassStore(extensionContext).get(LoggerContext.class, LoggerContext.class);
+    }
+
+}
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextSource.java b/log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextSource.java
new file mode 100644
index 0000000..baf9eb8
--- /dev/null
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/junit/LoggerContextSource.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.junit;
+
+import org.apache.logging.log4j.core.LoggerContext;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Specifies a configuration file to use for unit tests. This configuration file will be loaded once and used for all tests
+ * executed in the annotated test class unless otherwise specified by {@link #reconfigure()}. When annotated on a test method, this
+ * will override the class-level configuration if provided for that method.
+ *
+ * @since 3.0.0
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE, ElementType.METHOD})
+@Documented
+@Inherited
+@Tag("functional")
+@ExtendWith(LoggerContextResolver.class)
+@ExtendWith(ConfigurationResolver.class)
+@ExtendWith(AppenderResolver.class)
+public @interface LoggerContextSource {
+    /**
+     * Specifies the name of the configuration file to use for the annotated test.
+     */
+    String value();
+
+    /**
+     * Specifies whether or not to {@linkplain LoggerContext#reconfigure() reconfigure} after each test.
+     */
+    boolean reconfigure() default false;
+}
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/util/ProcessIdUtilTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/junit/Named.java
similarity index 61%
copy from log4j-api/src/test/java/org/apache/logging/log4j/util/ProcessIdUtilTest.java
copy to log4j-core/src/test/java/org/apache/logging/log4j/junit/Named.java
index 423532d..fd3e4f4 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/util/ProcessIdUtilTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/junit/Named.java
@@ -14,17 +14,21 @@
  * See the license for the specific language governing permissions and
  * limitations under the license.
  */
-package org.apache.logging.log4j.util;
 
-import org.junit.Test;
+package org.apache.logging.log4j.junit;
 
-import static org.junit.Assert.*;
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
 
-public class ProcessIdUtilTest {
-
-    @Test
-    public void processIdTest() throws Exception {
-        final String processId = ProcessIdUtil.getProcessId();
-        assertFalse("ProcessId is default", processId.equals(ProcessIdUtil.DEFAULT_PROCESSID));
-    }
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.PARAMETER)
+@Documented
+public @interface Named {
+    /**
+     * Specifies the name of the configuration item to inject. If blank, uses the name of the annotated parameter.
+     */
+    String value() default "";
 }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/message/MutableLogEventWithReusableParamMsgTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/message/MutableLogEventWithReusableParamMsgTest.java
index 2d3688d..559779d 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/message/MutableLogEventWithReusableParamMsgTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/message/MutableLogEventWithReusableParamMsgTest.java
@@ -17,7 +17,7 @@
 package org.apache.logging.log4j.message;
 
 import org.apache.logging.log4j.core.impl.MutableLogEvent;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.IsSame.sameInstance;
diff --git a/log4j-layout-json-template/src/test/java/org/apache/logging/log4j/layout/json/template/JsonTemplateLayoutGcFreeTest.java b/log4j-layout-json-template/src/test/java/org/apache/logging/log4j/layout/json/template/JsonTemplateLayoutGcFreeTest.java
index dfe097a..76b203e 100644
--- a/log4j-layout-json-template/src/test/java/org/apache/logging/log4j/layout/json/template/JsonTemplateLayoutGcFreeTest.java
+++ b/log4j-layout-json-template/src/test/java/org/apache/logging/log4j/layout/json/template/JsonTemplateLayoutGcFreeTest.java
@@ -18,7 +18,10 @@ package org.apache.logging.log4j.layout.json.template;
 
 import org.apache.logging.log4j.core.GcFreeLoggingTestUtil;
 import org.junit.Test;
+import org.junit.jupiter.api.Tag;
 
+@Tag("allocation")
+@Tag("functional")
 public class JsonTemplateLayoutGcFreeTest {
 
     @Test
diff --git a/pom.xml b/pom.xml
index 222d3d1..99f7697 100644
--- a/pom.xml
+++ b/pom.xml
@@ -982,6 +982,7 @@
           <configuration>
             <source>${maven.compiler.source}</source>
             <target>${maven.compiler.target}</target>
+            <parameters>true</parameters>
             <showDeprecation>true</showDeprecation>
             <showWarnings>true</showWarnings>
             <encoding>UTF-8</encoding>


[logging-log4j2] 02/06: [LOG4J2-2653] Add initial JUnit 5 support

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mattsicker pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit b3e35673cfcbbca64df000d3fb43ff2fa5037273
Author: Matt Sicker <bo...@gmail.com>
AuthorDate: Sun Aug 2 15:01:34 2020 -0500

    [LOG4J2-2653] Add initial JUnit 5 support
    
    This adds JUnit 5 support to most of the modules. Unchanged modules
    either contain no tests or use JUnit 4 specific features that need some
    adjustments to run in the JUnit vintage engine.
    
    Backported from 3.x which includes several pom.xml modernizations as
    well.
---
 log4j-1.2-api/pom.xml                              | 12 ++++++
 log4j-api/pom.xml                                  | 13 ++++++-
 log4j-appserver/pom.xml                            | 13 ++++++-
 log4j-cassandra/pom.xml                            | 12 ++++++
 log4j-core-its/pom.xml                             | 13 ++++++-
 log4j-core/pom.xml                                 | 13 ++++++-
 .../log4j/test/appender/EncodingListAppender.java  |  6 ++-
 log4j-couchdb/pom.xml                              | 12 ++++++
 log4j-flume-ng/pom.xml                             | 13 ++++++-
 log4j-iostreams/pom.xml                            | 13 ++++++-
 log4j-jcl/pom.xml                                  | 13 ++++++-
 log4j-jdbc-dbcp2/pom.xml                           | 12 ++++++
 log4j-jpa/pom.xml                                  | 12 ++++++
 log4j-jpl/pom.xml                                  | 13 ++++++-
 log4j-jul/pom.xml                                  |  1 -
 log4j-kubernetes/pom.xml                           | 13 ++++++-
 log4j-layout-json-template/pom.xml                 | 13 ++++++-
 log4j-liquibase/pom.xml                            | 13 ++++++-
 log4j-mongodb3/pom.xml                             | 12 ++++++
 log4j-mongodb4/pom.xml                             | 12 ++++++
 log4j-osgi/pom.xml                                 | 13 ++++++-
 log4j-slf4j-impl/pom.xml                           | 13 ++++++-
 log4j-slf4j18-impl/pom.xml                         | 13 ++++++-
 log4j-spring-boot/pom.xml                          | 17 +++++++++
 .../log4j-spring-cloud-config-client/pom.xml       | 13 ++++++-
 log4j-taglib/pom.xml                               | 13 ++++++-
 log4j-to-slf4j/pom.xml                             | 13 ++++++-
 log4j-web/pom.xml                                  | 13 ++++++-
 pom.xml                                            | 43 ++++++++++++++++------
 29 files changed, 353 insertions(+), 32 deletions(-)

diff --git a/log4j-1.2-api/pom.xml b/log4j-1.2-api/pom.xml
index eef9383..8a82c32 100644
--- a/log4j-1.2-api/pom.xml
+++ b/log4j-1.2-api/pom.xml
@@ -39,6 +39,18 @@
       <artifactId>junit</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
+    </dependency>
     <!-- Place Felix before Equinox because Felix is signed. -->
     <dependency>
       <groupId>org.apache.felix</groupId>
diff --git a/log4j-api/pom.xml b/log4j-api/pom.xml
index c90000e..e587155 100644
--- a/log4j-api/pom.xml
+++ b/log4j-api/pom.xml
@@ -53,7 +53,18 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.eclipse.tycho</groupId>
diff --git a/log4j-appserver/pom.xml b/log4j-appserver/pom.xml
index 1822c85..6d1be2d 100644
--- a/log4j-appserver/pom.xml
+++ b/log4j-appserver/pom.xml
@@ -90,7 +90,18 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
diff --git a/log4j-cassandra/pom.xml b/log4j-cassandra/pom.xml
index 28cb046..138318f 100644
--- a/log4j-cassandra/pom.xml
+++ b/log4j-cassandra/pom.xml
@@ -51,6 +51,18 @@
       <artifactId>junit</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.mockito</groupId>
       <artifactId>mockito-core</artifactId>
       <scope>test</scope>
diff --git a/log4j-core-its/pom.xml b/log4j-core-its/pom.xml
index 294fc5f..dd1364b 100644
--- a/log4j-core-its/pom.xml
+++ b/log4j-core-its/pom.xml
@@ -127,7 +127,18 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.hamcrest</groupId>
diff --git a/log4j-core/pom.xml b/log4j-core/pom.xml
index 95a301c..960e08e 100644
--- a/log4j-core/pom.xml
+++ b/log4j-core/pom.xml
@@ -190,7 +190,18 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.hamcrest</groupId>
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/EncodingListAppender.java b/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/EncodingListAppender.java
index 4d7ee56..680645a 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/EncodingListAppender.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/test/appender/EncodingListAppender.java
@@ -41,8 +41,10 @@ public class EncodingListAppender extends ListAppender {
         super(name, filter, layout, newline, raw);
     }
 
-    private class Destination implements ByteBufferDestination {
-        ByteBuffer byteBuffer = ByteBuffer.wrap(new byte[4096]);
+    private static class Destination implements ByteBufferDestination {
+        // JUnit 5 stack traces can start to get looooong
+        ByteBuffer byteBuffer = ByteBuffer.wrap(new byte[8192]);
+
         @Override
         public ByteBuffer getByteBuffer() {
             return byteBuffer;
diff --git a/log4j-couchdb/pom.xml b/log4j-couchdb/pom.xml
index 40240e2..601833b 100644
--- a/log4j-couchdb/pom.xml
+++ b/log4j-couchdb/pom.xml
@@ -51,6 +51,18 @@
       <artifactId>junit</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.mockito</groupId>
       <artifactId>mockito-core</artifactId>
       <scope>test</scope>
diff --git a/log4j-flume-ng/pom.xml b/log4j-flume-ng/pom.xml
index 9c108e0..86981bc 100644
--- a/log4j-flume-ng/pom.xml
+++ b/log4j-flume-ng/pom.xml
@@ -70,7 +70,18 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.flume</groupId>
diff --git a/log4j-iostreams/pom.xml b/log4j-iostreams/pom.xml
index 25abb7e..5a9e760 100644
--- a/log4j-iostreams/pom.xml
+++ b/log4j-iostreams/pom.xml
@@ -56,7 +56,18 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.hamcrest</groupId>
diff --git a/log4j-jcl/pom.xml b/log4j-jcl/pom.xml
index eeb6b63..3867199 100644
--- a/log4j-jcl/pom.xml
+++ b/log4j-jcl/pom.xml
@@ -37,7 +37,18 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.hamcrest</groupId>
diff --git a/log4j-jdbc-dbcp2/pom.xml b/log4j-jdbc-dbcp2/pom.xml
index 4144e0c..edbc833 100644
--- a/log4j-jdbc-dbcp2/pom.xml
+++ b/log4j-jdbc-dbcp2/pom.xml
@@ -43,6 +43,18 @@
       <artifactId>junit</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-api</artifactId>
       <type>test-jar</type>
diff --git a/log4j-jpa/pom.xml b/log4j-jpa/pom.xml
index 8d557d4..552c777 100644
--- a/log4j-jpa/pom.xml
+++ b/log4j-jpa/pom.xml
@@ -52,6 +52,18 @@
       <artifactId>junit</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-api</artifactId>
       <type>test-jar</type>
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index ca45baf..0a66699 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -58,7 +58,18 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
   </dependencies>
 
diff --git a/log4j-jul/pom.xml b/log4j-jul/pom.xml
index 11d1c5c..48552a5 100644
--- a/log4j-jul/pom.xml
+++ b/log4j-jul/pom.xml
@@ -58,7 +58,6 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
     </dependency>
     <!-- Required for AsyncLogger testing -->
     <dependency>
diff --git a/log4j-kubernetes/pom.xml b/log4j-kubernetes/pom.xml
index 1326d45..cab9537 100644
--- a/log4j-kubernetes/pom.xml
+++ b/log4j-kubernetes/pom.xml
@@ -52,7 +52,18 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
   </dependencies>
   <build>
diff --git a/log4j-layout-json-template/pom.xml b/log4j-layout-json-template/pom.xml
index e060b94..741bcf1 100644
--- a/log4j-layout-json-template/pom.xml
+++ b/log4j-layout-json-template/pom.xml
@@ -64,7 +64,18 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
 
     <dependency>
diff --git a/log4j-liquibase/pom.xml b/log4j-liquibase/pom.xml
index 902be33..484226e 100644
--- a/log4j-liquibase/pom.xml
+++ b/log4j-liquibase/pom.xml
@@ -66,7 +66,18 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
   </dependencies>
   <build>
diff --git a/log4j-mongodb3/pom.xml b/log4j-mongodb3/pom.xml
index f456c66..bd28ca8 100644
--- a/log4j-mongodb3/pom.xml
+++ b/log4j-mongodb3/pom.xml
@@ -57,6 +57,18 @@
       <artifactId>junit</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.mockito</groupId>
       <artifactId>mockito-core</artifactId>
       <scope>test</scope>
diff --git a/log4j-mongodb4/pom.xml b/log4j-mongodb4/pom.xml
index c4603fd..75d48e6 100644
--- a/log4j-mongodb4/pom.xml
+++ b/log4j-mongodb4/pom.xml
@@ -57,6 +57,18 @@
       <artifactId>junit</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.mockito</groupId>
       <artifactId>mockito-core</artifactId>
       <scope>test</scope>
diff --git a/log4j-osgi/pom.xml b/log4j-osgi/pom.xml
index 727c8cc..25881a2 100644
--- a/log4j-osgi/pom.xml
+++ b/log4j-osgi/pom.xml
@@ -48,7 +48,18 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.eclipse.tycho</groupId>
diff --git a/log4j-slf4j-impl/pom.xml b/log4j-slf4j-impl/pom.xml
index 9d22ca5..71cc5b5 100644
--- a/log4j-slf4j-impl/pom.xml
+++ b/log4j-slf4j-impl/pom.xml
@@ -86,7 +86,18 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
   </dependencies>
   <build>
diff --git a/log4j-slf4j18-impl/pom.xml b/log4j-slf4j18-impl/pom.xml
index 278b0bb..dc37a3d 100644
--- a/log4j-slf4j18-impl/pom.xml
+++ b/log4j-slf4j18-impl/pom.xml
@@ -86,7 +86,18 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
   </dependencies>
   <build>
diff --git a/log4j-spring-boot/pom.xml b/log4j-spring-boot/pom.xml
index 8dd6116..13f3348 100644
--- a/log4j-spring-boot/pom.xml
+++ b/log4j-spring-boot/pom.xml
@@ -62,6 +62,23 @@
       <artifactId>spring-boot</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-api</artifactId>
+      <type>test-jar</type>
+    </dependency>
+    <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-context</artifactId>
     </dependency>
diff --git a/log4j-spring-cloud-config/log4j-spring-cloud-config-client/pom.xml b/log4j-spring-cloud-config/log4j-spring-cloud-config-client/pom.xml
index ae200dd..7566bf8 100644
--- a/log4j-spring-cloud-config/log4j-spring-cloud-config-client/pom.xml
+++ b/log4j-spring-cloud-config/log4j-spring-cloud-config-client/pom.xml
@@ -37,7 +37,18 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.logging.log4j</groupId>
diff --git a/log4j-taglib/pom.xml b/log4j-taglib/pom.xml
index 221327b..0d2c45f 100644
--- a/log4j-taglib/pom.xml
+++ b/log4j-taglib/pom.xml
@@ -69,7 +69,18 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
diff --git a/log4j-to-slf4j/pom.xml b/log4j-to-slf4j/pom.xml
index 2f8ce47..b36c02a 100644
--- a/log4j-to-slf4j/pom.xml
+++ b/log4j-to-slf4j/pom.xml
@@ -61,7 +61,18 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.hamcrest</groupId>
diff --git a/log4j-web/pom.xml b/log4j-web/pom.xml
index 44afcbe..88b775c 100644
--- a/log4j-web/pom.xml
+++ b/log4j-web/pom.xml
@@ -62,7 +62,18 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.vintage</groupId>
+      <artifactId>junit-vintage-engine</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
     </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
diff --git a/pom.xml b/pom.xml
index bea0372..fd44d0d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,13 +22,11 @@
   <name>Apache Log4j 2</name>
   <version>2.14.0-SNAPSHOT</version>
   <parent>
-    <groupId>org.apache</groupId>
-    <artifactId>apache</artifactId>
-    <version>21</version>
+    <groupId>org.apache.logging</groupId>
+    <artifactId>logging-parent</artifactId>
+    <version>2</version>
+    <relativePath/>
   </parent>
-  <prerequisites>
-    <maven>3.0.5</maven>
-  </prerequisites>
   <description>Apache Log4j 2</description>
   <url>https://logging.apache.org/log4j/2.x/</url>
   <issueManagement>
@@ -37,7 +35,7 @@
   </issueManagement>
   <ciManagement>
     <system>Jenkins</system>
-    <url>https://builds.apache.org/job/Log4j%202.x/</url>
+    <url>https://ci-builds.apache.org/job/Logging/job/log4j/</url>
   </ciManagement>
   <inceptionYear>1999</inceptionYear>
   <developers>
@@ -173,9 +171,9 @@
     </mailingList>
   </mailingLists>
   <scm>
-    <connection>scm:git:https://git-wip-us.apache.org/repos/asf/logging-log4j2.git</connection>
-    <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/logging-log4j2.git</developerConnection>
-    <url>https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;a=summary</url>
+    <connection>scm:git:https://gitbox.apache.org/repos/asf/logging-log4j2.git</connection>
+    <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/logging-log4j2.git</developerConnection>
+    <url>https://gitbox.apache.org/repos/asf?p=logging-log4j2.git</url>
     <tag>log4j-${Log4jReleaseVersion}</tag>
   </scm>
   <properties>
@@ -231,6 +229,7 @@
     <manifestfile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestfile>
     <maven.compiler.source>1.8</maven.compiler.source>
     <maven.compiler.target>1.8</maven.compiler.target>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <docLabel>Site Documentation</docLabel>
     <projectDir />
     <commonsLoggingVersion>1.2</commonsLoggingVersion>
@@ -668,12 +667,34 @@
         <artifactId>jctools-core</artifactId>
         <version>${jctoolsVersion}</version>
       </dependency>
+      <!-- JUnit 5 API dependency -->
+      <dependency>
+        <groupId>org.junit.jupiter</groupId>
+        <artifactId>junit-jupiter-api</artifactId>
+        <version>5.6.2</version>
+        <scope>test</scope>
+      </dependency>
+      <!-- JUnit 5 engine -->
+      <dependency>
+        <groupId>org.junit.jupiter</groupId>
+        <artifactId>junit-jupiter-engine</artifactId>
+        <version>5.6.2</version>
+        <scope>test</scope>
+      </dependency>
+      <!-- JUnit 4 API dependency -->
       <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <version>4.13</version>
         <scope>test</scope>
       </dependency>
+      <!-- JUnit 4 engine -->
+      <dependency>
+        <groupId>org.junit.vintage</groupId>
+        <artifactId>junit-vintage-engine</artifactId>
+        <version>5.6.2</version>
+        <scope>test</scope>
+      </dependency>
       <dependency>
         <groupId>org.assertj</groupId>
         <artifactId>assertj-core</artifactId>
@@ -695,7 +716,7 @@
       <dependency>
         <groupId>org.codehaus.plexus</groupId>
         <artifactId>plexus-utils</artifactId>
-        <version>3.1.0</version>
+        <version>3.2.0</version>
         <scope>test</scope>
       </dependency>
       <dependency>


[logging-log4j2] 01/06: Remove Travis config in favor of GH Actions

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mattsicker pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit b9ababc31f5788f9ba4ebaa7e6a9e459c954907f
Author: Matt Sicker <bo...@gmail.com>
AuthorDate: Sat Aug 22 19:17:42 2020 -0500

    Remove Travis config in favor of GH Actions
    
    Signed-off-by: Matt Sicker <bo...@gmail.com>
---
 .travis-toolchains.xml | 53 --------------------------------------------------
 .travis.yml            | 39 -------------------------------------
 2 files changed, 92 deletions(-)

diff --git a/.travis-toolchains.xml b/.travis-toolchains.xml
deleted file mode 100644
index 502a57e..0000000
--- a/.travis-toolchains.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements. See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache license, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License. You may obtain a copy of the License at
-  ~
-  ~      http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the license for the specific language governing permissions and
-  ~ limitations under the license.
-  -->
-<toolchains xmlns="http://maven.apache.org/TOOLCHAINS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/TOOLCHAINS/1.1.0 http://maven.apache.org/xsd/toolchains-1.1.0.xsd">
-  <toolchain>
-    <type>jdk</type>
-    <provides>
-      <id>java7</id>
-      <version>1.7</version>
-      <vendor>oracle</vendor>
-    </provides>
-    <configuration>
-      <jdkHome>/usr/lib/jvm/java-7-openjdk-amd64</jdkHome>
-    </configuration>
-  </toolchain>
-  <toolchain>
-    <type>jdk</type>
-    <provides>
-      <id>java8</id>
-      <version>1.8</version>
-      <vendor>oracle</vendor>
-    </provides>
-    <configuration>
-      <jdkHome>/usr/lib/jvm/java-8-openjdk-amd64</jdkHome>
-    </configuration>
-  </toolchain>
-  <toolchain>
-    <type>jdk</type>
-    <provides>
-      <id>java11</id>
-      <version>11</version>
-      <vendor>oracle</vendor>
-    </provides>
-    <configuration>
-      <jdkHome>/home/travis/openjdk11</jdkHome>
-    </configuration>
-  </toolchain>
-</toolchains>
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 190a8b0..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you may not use this file except in compliance with the License.
-#   You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing, software
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#   See the License for the specific language governing permissions and
-#   limitations under the License.
-
-language: java
-dist: trusty
-jdk:
-  - openjdk11
-
-env:
-  global:
-    JAVA_OPTS=-Xmx4g
-
-cache:
-  directories:
-    - "$HOME/.m2"
-before_cache:
-  - rm -rf $HOME/.m2/repository/org/apache/logging/log4j
-
-install:
-  - jdk_switcher use openjdk8
-  - mvn -t .travis-toolchains.xml install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
-
-script:
-  - $TRAVIS_BUILD_DIR/install-jdk.sh --install openjdk11 --target /home/travis/openjdk11
-  - jdk_switcher use openjdk8
-  - mvn -t .travis-toolchains.xml test -B -V
-
-after_success:
-  - jdk_switcher use openjdk8
-  - mvn -t .travis-toolchains.xml -pl !log4j-bom jacoco:prepare-agent test jacoco:report coveralls:report -B -V


[logging-log4j2] 04/06: Upgrade org.apache.logging.log4j.message tests

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mattsicker pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 3c6c04d25897082583e499f7240e65d468ab4b0c
Author: Matt Sicker <bo...@gmail.com>
AuthorDate: Sat Aug 8 11:48:28 2020 -0500

    Upgrade org.apache.logging.log4j.message tests
    
    This updates the tests in this package to JUnit 5.
---
 .../log4j/message/FormattedMessageTest.java        | 18 +++++++++---------
 .../log4j/message/LocalizedMessageFactoryTest.java |  7 ++++---
 .../log4j/message/LocalizedMessageTest.java        |  8 ++++----
 .../logging/log4j/message/MapMessageTest.java      | 14 +++++++-------
 .../log4j/message/MessageFormatMessageTest.java    | 12 ++++++------
 .../log4j/message/MessageFormatsPerfTest.java      |  8 +++++---
 .../log4j/message/ObjectArrayMessageTest.java      | 10 ++++++----
 .../logging/log4j/message/ObjectMessageTest.java   |  8 ++++----
 .../log4j/message/ParameterFormatterTest.java      |  5 +++--
 .../log4j/message/ParameterizedMessageTest.java    |  8 ++++----
 .../log4j/message/ReusableMessageFactoryTest.java  |  8 ++++----
 .../log4j/message/ReusableObjectMessageTest.java   |  4 ++--
 .../message/ReusableParameterizedMessageTest.java  |  8 ++++----
 .../log4j/message/ReusableSimpleMessageTest.java   |  4 ++--
 .../logging/log4j/message/SimpleMessageTest.java   |  4 ++--
 .../log4j/message/StringFormattedMessageTest.java  | 22 ++++++++++------------
 .../log4j/message/StructuredDataMessageTest.java   |  9 +++++----
 .../log4j/message/ThreadDumpMessageTest.java       | 22 +++++++++++-----------
 pom.xml                                            | 17 +++++++++++++----
 19 files changed, 105 insertions(+), 91 deletions(-)

diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/FormattedMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/FormattedMessageTest.java
index 937d659..588a81d 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/FormattedMessageTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/FormattedMessageTest.java
@@ -25,10 +25,10 @@ import java.util.Locale;
 
 import org.apache.logging.log4j.junit.Mutable;
 import org.apache.logging.log4j.util.Constants;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 /**
  *
@@ -141,7 +141,7 @@ public class FormattedMessageTest {
         // modify parameter before calling msg.getFormattedMessage
         param.set("XYZ");
         final String actual = msg.getFormattedMessage();
-        assertEquals("Expected most recent param value", "Test message XYZ", actual);
+        assertEquals("Test message XYZ", actual, "Expected most recent param value");
     }
 
     @Test
@@ -154,7 +154,7 @@ public class FormattedMessageTest {
         msg.getFormattedMessage(); // freeze the formatted message
         param.set("XYZ");
         final String actual = msg.getFormattedMessage();
-        assertEquals("Should use initial param value", "Test message abc", actual);
+        assertEquals("Test message abc", actual, "Should use initial param value");
     }
 
     @Test
@@ -167,9 +167,9 @@ public class FormattedMessageTest {
         final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
         final ObjectInputStream in = new ObjectInputStream(bais);
         final FormattedMessage actual = (FormattedMessage) in.readObject();
-        Assert.assertEquals(expected, actual);
-        Assert.assertEquals(expected.getFormat(), actual.getFormat());
-        Assert.assertEquals(expected.getFormattedMessage(), actual.getFormattedMessage());
-        Assert.assertArrayEquals(expected.getParameters(), actual.getParameters());
+        assertEquals(expected, actual);
+        assertEquals(expected.getFormat(), actual.getFormat());
+        assertEquals(expected.getFormattedMessage(), actual.getFormattedMessage());
+        assertArrayEquals(expected.getParameters(), actual.getParameters());
     }
 }
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/LocalizedMessageFactoryTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/LocalizedMessageFactoryTest.java
index 71bdf29..1e49a6f 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/LocalizedMessageFactoryTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/LocalizedMessageFactoryTest.java
@@ -16,11 +16,12 @@
  */
 package org.apache.logging.log4j.message;
 
+import org.junit.jupiter.api.Test;
+
 import java.util.Locale;
 import java.util.ResourceBundle;
 
-import org.junit.Assert;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 /**
  * Tests {@link LocalizedMessageFactory}.
@@ -32,6 +33,6 @@ public class LocalizedMessageFactoryTest {
         final LocalizedMessageFactory localizedMessageFactory = new LocalizedMessageFactory(
                 ResourceBundle.getBundle("MF", Locale.US));
         final Message message = localizedMessageFactory.newMessage("hello_world");
-        Assert.assertEquals("Hello world.", message.getFormattedMessage());
+        assertEquals("Hello world.", message.getFormattedMessage());
     }
 }
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/LocalizedMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/LocalizedMessageTest.java
index aebe6ed..4689a17 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/LocalizedMessageTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/LocalizedMessageTest.java
@@ -21,9 +21,9 @@ import java.util.Locale;
 
 import org.apache.commons.lang3.SerializationUtils;
 import org.apache.logging.log4j.junit.Mutable;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests LocalizedMessage.
@@ -71,7 +71,7 @@ public class LocalizedMessageTest {
         // modify parameter before calling msg.getFormattedMessage
         param.set("XYZ");
         final String actual = msg.getFormattedMessage();
-        assertEquals("Expected most recent param value", "Test message XYZ", actual);
+        assertEquals("Test message XYZ", actual, "Expected most recent param value");
     }
 
     @Test
@@ -84,6 +84,6 @@ public class LocalizedMessageTest {
         msg.getFormattedMessage();
         param.set("XYZ");
         final String actual = msg.getFormattedMessage();
-        assertEquals("Should use initial param value", "Test message abc", actual);
+        assertEquals("Test message abc", actual, "Should use initial param value");
     }
 }
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java
index 850024e..0df4685 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java
@@ -18,7 +18,7 @@ package org.apache.logging.log4j.message;
 
 import com.google.common.base.Strings;
 import org.apache.logging.log4j.util.StringBuilderFormattable;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.math.BigDecimal;
 import java.util.Arrays;
@@ -27,7 +27,7 @@ import java.util.LinkedHashMap;
 import java.util.LinkedList;
 import java.util.List;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  *
@@ -155,19 +155,19 @@ public class MapMessageTest {
         assertEquals(expectedJson, actualJson);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testJsonFormatterInfiniteRecursionPrevention() {
         final List<Object> recursiveValue = Arrays.asList(1, null);
         // noinspection CollectionAddedToSelf
         recursiveValue.set(1, recursiveValue);
-        new ObjectMapMessage()
+        assertThrows(IllegalArgumentException.class, () -> new ObjectMapMessage()
                 .with("key", recursiveValue)
-                .getFormattedMessage(new String[]{"JSON"});
+                .getFormattedMessage(new String[]{"JSON"}));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testJsonFormatterMaxDepthViolation() {
-        testJsonFormatterMaxDepth(MapMessageJsonFormatter.MAX_DEPTH - 1);
+        assertThrows(IllegalArgumentException.class, () -> testJsonFormatterMaxDepth(MapMessageJsonFormatter.MAX_DEPTH - 1));
     }
 
     @Test
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/MessageFormatMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/MessageFormatMessageTest.java
index d123b74..42c54a2 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/MessageFormatMessageTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/MessageFormatMessageTest.java
@@ -19,12 +19,12 @@ package org.apache.logging.log4j.message;
 
 import org.apache.logging.log4j.junit.Mutable;
 import org.apache.logging.log4j.util.Constants;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
+import org.junit.jupiter.api.Test;
 
 import java.util.Locale;
 
+import static org.junit.jupiter.api.Assertions.*;
+
 /**
  *
  */
@@ -84,7 +84,7 @@ public class MessageFormatMessageTest {
         final String expected = "Test message Apache";
         assertEquals(expected, result);
         final Throwable t = msg.getThrowable();
-        assertNotNull("No Throwable", t);
+        assertNotNull(t, "No Throwable");
     }
 
     @Test
@@ -96,7 +96,7 @@ public class MessageFormatMessageTest {
         // modify parameter before calling msg.getFormattedMessage
         param.set("XYZ");
         final String actual = msg.getFormattedMessage();
-        assertEquals("Expected most recent param value", "Test message XYZ", actual);
+        assertEquals("Test message XYZ", actual, "Expected most recent param value");
     }
 
     @Test
@@ -109,6 +109,6 @@ public class MessageFormatMessageTest {
         msg.getFormattedMessage();
         param.set("XYZ");
         final String actual = msg.getFormattedMessage();
-        assertEquals("Should use initial param value", "Test message abc", actual);
+        assertEquals("Test message abc", actual, "Should use initial param value");
     }
 }
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/MessageFormatsPerfTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/MessageFormatsPerfTest.java
index 7ebd325..6254b62 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/MessageFormatsPerfTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/MessageFormatsPerfTest.java
@@ -17,12 +17,14 @@
 package org.apache.logging.log4j.message;
 
 import org.apache.logging.log4j.util.Timer;
-import org.junit.AfterClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
 
 /**
  *
  */
+@Tag("performance")
 public class MessageFormatsPerfTest {
 
     private static final int LOOP_CNT = 500;
@@ -32,7 +34,7 @@ public class MessageFormatsPerfTest {
     private static long msgFormatTime = 0;
     private static long formattedTime = 0;
 
-    @AfterClass
+    @AfterAll
     public static void after() {
         if (stringTime > paramTime) {
             System.out.println(String.format("Parameterized is %1$.2f times faster than StringFormat.",
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/ObjectArrayMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/ObjectArrayMessageTest.java
index 5f11cf8..cfc8cf5 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/ObjectArrayMessageTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/ObjectArrayMessageTest.java
@@ -16,8 +16,10 @@
  */
 package org.apache.logging.log4j.message;
 
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 /**
  * @since 2.4
@@ -29,12 +31,12 @@ public class ObjectArrayMessageTest {
 
     @Test
     public void testGetParameters() {
-        Assert.assertArrayEquals(ARRAY, OBJECT_ARRAY_MESSAGE.getParameters());
+        assertArrayEquals(ARRAY, OBJECT_ARRAY_MESSAGE.getParameters());
     }
 
     @Test
     public void testGetThrowable() {
-        Assert.assertEquals(null, OBJECT_ARRAY_MESSAGE.getThrowable());
+        assertNull(OBJECT_ARRAY_MESSAGE.getThrowable());
     }
 
 }
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/ObjectMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/ObjectMessageTest.java
index 8f547ae..7579884 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/ObjectMessageTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/ObjectMessageTest.java
@@ -21,9 +21,9 @@ import java.math.BigDecimal;
 
 import org.apache.logging.log4j.junit.Mutable;
 import org.apache.logging.log4j.junit.SerialUtil;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests {@link ObjectMessage}.
@@ -53,7 +53,7 @@ public class ObjectMessageTest {
         // modify parameter before calling msg.getFormattedMessage
         param.set("XYZ");
         final String actual = msg.getFormattedMessage();
-        assertEquals("Expected most recent param value", "XYZ", actual);
+        assertEquals("XYZ", actual, "Expected most recent param value");
     }
 
     @Test
@@ -65,7 +65,7 @@ public class ObjectMessageTest {
         msg.getFormattedMessage();
         param.set("XYZ");
         final String actual = msg.getFormattedMessage();
-        assertEquals("Should use initial param value", "abc", actual);
+        assertEquals("abc", actual, "Should use initial param value");
     }
 
     @Test
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/ParameterFormatterTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/ParameterFormatterTest.java
index 6e728f6..f1b1917 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/ParameterFormatterTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/ParameterFormatterTest.java
@@ -16,11 +16,12 @@
  */
 package org.apache.logging.log4j.message;
 
+import org.junit.jupiter.api.Test;
+
 import java.util.ArrayList;
 import java.util.List;
-import org.junit.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests ParameterFormatter.
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/ParameterizedMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/ParameterizedMessageTest.java
index 2a5bac6..42978a9 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/ParameterizedMessageTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/ParameterizedMessageTest.java
@@ -17,9 +17,9 @@
 package org.apache.logging.log4j.message;
 
 import org.apache.logging.log4j.junit.Mutable;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  *
@@ -135,11 +135,11 @@ public class ParameterizedMessageTest {
         // modify parameter before calling msg.getFormattedMessage
         param.set("XYZ");
         final String actual = msg.getFormattedMessage();
-        assertEquals("Should use current param value", "Test message XYZ", actual);
+        assertEquals("Test message XYZ", actual, "Should use current param value");
 
         // modify parameter after calling msg.getFormattedMessage
         param.set("000");
         final String after = msg.getFormattedMessage();
-        assertEquals("Should not change after rendered once", "Test message XYZ", after);
+        assertEquals("Test message XYZ", after, "Should not change after rendered once");
     }
 }
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableMessageFactoryTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableMessageFactoryTest.java
index 7942e5f..0eb962d 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableMessageFactoryTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableMessageFactoryTest.java
@@ -16,9 +16,9 @@
  */
 package org.apache.logging.log4j.message;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests the ReusableMessageFactory class.
@@ -53,10 +53,10 @@ public class ReusableMessageFactoryTest {
     private void assertReusableParameterizeMessage(final Message message, final String txt, final Object[] params) {
         assertTrue(message instanceof ReusableParameterizedMessage);
         final ReusableParameterizedMessage msg = (ReusableParameterizedMessage) message;
-        assertTrue("reserved", msg.reserved);
+        assertTrue(msg.reserved, "reserved");
 
         assertEquals(txt, msg.getFormat());
-        assertEquals("count", msg.getParameterCount(), params.length);
+        assertEquals(msg.getParameterCount(), params.length, "count");
         final Object[] messageParams = msg.getParameters();
         for (int i = 0; i < params.length; i++) {
             assertEquals(messageParams[i], params[i]);
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableObjectMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableObjectMessageTest.java
index 614d54c..3fd7a73 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableObjectMessageTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableObjectMessageTest.java
@@ -16,9 +16,9 @@
  */
 package org.apache.logging.log4j.message;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests ReusableObjectMessage.
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableParameterizedMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableParameterizedMessageTest.java
index 93fe061..087c623 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableParameterizedMessageTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableParameterizedMessageTest.java
@@ -17,12 +17,12 @@
 package org.apache.logging.log4j.message;
 
 import org.apache.logging.log4j.junit.Mutable;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.util.LinkedList;
 import java.util.List;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests ReusableParameterizedMessage.
@@ -127,12 +127,12 @@ public class ReusableParameterizedMessageTest {
         // modify parameter before calling msg.getFormattedMessage
         param.set("XYZ");
         final String actual = msg.getFormattedMessage();
-        assertEquals("Should use current param value", "Test message XYZ", actual);
+        assertEquals("Test message XYZ", actual, "Should use current param value");
 
         // modify parameter after calling msg.getFormattedMessage
         param.set("000");
         final String after = msg.getFormattedMessage();
-        assertEquals("Renders again", "Test message 000", after);
+        assertEquals("Test message 000", after, "Renders again");
     }
 
     @Test
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableSimpleMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableSimpleMessageTest.java
index 1070a53..622f355 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableSimpleMessageTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/ReusableSimpleMessageTest.java
@@ -16,9 +16,9 @@
  */
 package org.apache.logging.log4j.message;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests ReusableSimpleMessage.
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/SimpleMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/SimpleMessageTest.java
index 383ecb4..a43d986 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/SimpleMessageTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/SimpleMessageTest.java
@@ -16,9 +16,9 @@
  */
 package org.apache.logging.log4j.message;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  * Tests the SimpleMessage class.
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/StringFormattedMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/StringFormattedMessageTest.java
index 1cda558..5d85d96 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/StringFormattedMessageTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/StringFormattedMessageTest.java
@@ -16,9 +16,6 @@
  */
 package org.apache.logging.log4j.message;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -27,8 +24,9 @@ import java.io.ObjectOutputStream;
 import java.util.Locale;
 
 import org.apache.logging.log4j.junit.Mutable;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  *
@@ -86,7 +84,7 @@ public class StringFormattedMessageTest {
         final String expected = "Test message Apache";
         assertEquals(expected, result);
         final Throwable t = msg.getThrowable();
-        assertNotNull("No Throwable", t);
+        assertNotNull(t, "No Throwable");
     }
 
     @Test
@@ -98,7 +96,7 @@ public class StringFormattedMessageTest {
         // modify parameter before calling msg.getFormattedMessage
         param.set("XYZ");
         final String actual = msg.getFormattedMessage();
-        assertEquals("Should use initial param value", "Test message XYZ", actual);
+        assertEquals("Test message XYZ", actual, "Should use initial param value");
     }
 
     @Test
@@ -111,7 +109,7 @@ public class StringFormattedMessageTest {
         msg.getFormattedMessage();
         param.set("XYZ");
         final String actual = msg.getFormattedMessage();
-        assertEquals("Should use initial param value", "Test message abc", actual);
+        assertEquals("Test message abc", actual, "Should use initial param value");
     }
 
     @Test
@@ -124,9 +122,9 @@ public class StringFormattedMessageTest {
         final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
         final ObjectInputStream in = new ObjectInputStream(bais);
         final StringFormattedMessage actual = (StringFormattedMessage) in.readObject();
-        Assert.assertEquals(expected, actual);
-        Assert.assertEquals(expected.getFormat(), actual.getFormat());
-        Assert.assertEquals(expected.getFormattedMessage(), actual.getFormattedMessage());
-        Assert.assertArrayEquals(expected.getParameters(), actual.getParameters());
+        assertEquals(expected, actual);
+        assertEquals(expected.getFormat(), actual.getFormat());
+        assertEquals(expected.getFormattedMessage(), actual.getFormattedMessage());
+        assertArrayEquals(expected.getParameters(), actual.getParameters());
     }
 }
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/StructuredDataMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/StructuredDataMessageTest.java
index 51a4cee..39e0d02 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/StructuredDataMessageTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/StructuredDataMessageTest.java
@@ -16,9 +16,9 @@
  */
 package org.apache.logging.log4j.message;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  *
@@ -82,11 +82,12 @@ public class StructuredDataMessageTest {
         assertEquals(expected, result);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testMsgWithKeyTooLong() {
         final String testMsg = "Test message {}";
         final StructuredDataMessage msg = new StructuredDataMessage("MsgId@12345", testMsg, "Alert");
-        msg.put("This is a very long key that will violate the key length validation", "Testing");
+        assertThrows(IllegalArgumentException.class, () ->
+                msg.put("This is a very long key that will violate the key length validation", "Testing"));
     }
 
     @Test
diff --git a/log4j-api/src/test/java/org/apache/logging/log4j/message/ThreadDumpMessageTest.java b/log4j-api/src/test/java/org/apache/logging/log4j/message/ThreadDumpMessageTest.java
index 8668d0a..61817c0 100644
--- a/log4j-api/src/test/java/org/apache/logging/log4j/message/ThreadDumpMessageTest.java
+++ b/log4j-api/src/test/java/org/apache/logging/log4j/message/ThreadDumpMessageTest.java
@@ -21,7 +21,7 @@ import java.util.concurrent.locks.ReentrantLock;
 
 import org.junit.Test;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
 
 /**
  *
@@ -34,9 +34,9 @@ public class ThreadDumpMessageTest {
 
         final String message = msg.getFormattedMessage();
         //System.out.print(message);
-        assertTrue("No header", message.contains("Testing"));
-        assertTrue("No RUNNABLE", message.contains("RUNNABLE"));
-        assertTrue("No ThreadDumpMessage", message.contains("ThreadDumpMessage"));
+        assertTrue(message.contains("Testing"), "No header");
+        assertTrue(message.contains("RUNNABLE"), "No RUNNABLE");
+        assertTrue(message.contains("ThreadDumpMessage"), "No ThreadDumpMessage");
     }
 
 
@@ -60,9 +60,9 @@ public class ThreadDumpMessageTest {
 
         final String message = msg.getFormattedMessage();
         //System.out.print(message);
-        assertTrue("No header", message.contains("Testing"));
-        assertTrue("No RUNNABLE", message.contains("RUNNABLE"));
-        assertTrue("No ThreadDumpMessage", message.contains("ThreadDumpMessage"));
+        assertTrue(message.contains("Testing"), "No header");
+        assertTrue(message.contains("RUNNABLE"), "No RUNNABLE");
+        assertTrue(message.contains("ThreadDumpMessage"), "No ThreadDumpMessage");
         //assertTrue("No Locks", message.contains("waiting on"));
         //assertTrue("No syncronizers", message.contains("locked syncrhonizers"));
     }
@@ -90,7 +90,7 @@ public class ThreadDumpMessageTest {
         other.start();
         other.join();
 
-        assertTrue("No mention of other thread in msg", !actual[0].contains("OtherThread"));
+        assertTrue(!actual[0].contains("OtherThread"), "No mention of other thread in msg");
     }
 
     @Test
@@ -98,7 +98,7 @@ public class ThreadDumpMessageTest {
 
         final ThreadDumpMessage message = new ThreadDumpMessage("");
         final String initial = message.getFormattedMessage();
-        assertFalse("no ThreadWithCountDownLatch thread yet", initial.contains("ThreadWithCountDownLatch"));
+        assertFalse(initial.contains("ThreadWithCountDownLatch"), "no ThreadWithCountDownLatch thread yet");
 
         final CountDownLatch started = new CountDownLatch(1);
         final CountDownLatch keepAlive = new CountDownLatch(1);
@@ -108,8 +108,8 @@ public class ThreadDumpMessageTest {
 
         final StringBuilder result = new StringBuilder();
         message.formatTo(result);
-        assertFalse("no ThreadWithCountDownLatch captured",
-                result.toString().contains("ThreadWithCountDownLatch"));
+        assertFalse(
+                result.toString().contains("ThreadWithCountDownLatch"), "no ThreadWithCountDownLatch captured");
         assertEquals(initial, result.toString());
         keepAlive.countDown(); // allow thread to die
     }
diff --git a/pom.xml b/pom.xml
index 603b2a2..222d3d1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -240,6 +240,8 @@
     <!-- Allow Clirr severity to be overriden by the command-line option -DminSeverity=level -->
     <minSeverity>info</minSeverity>
     <jctoolsVersion>1.2.1</jctoolsVersion>
+    <junitVersion>4.13</junitVersion>
+    <junitJupiterVersion>5.6.2</junitJupiterVersion>
     <mockitoVersion>2.25.1</mockitoVersion>
     <argLine>-Xms256m -Xmx1024m</argLine>
     <javaTargetVersion>1.8</javaTargetVersion>
@@ -671,28 +673,35 @@
       <dependency>
         <groupId>org.junit.jupiter</groupId>
         <artifactId>junit-jupiter-engine</artifactId>
-        <version>5.6.2</version>
+        <version>${junitJupiterVersion}</version>
         <scope>test</scope>
       </dependency>
       <!-- JUnit 4 to 5 migration support -->
       <dependency>
         <groupId>org.junit.jupiter</groupId>
         <artifactId>junit-jupiter-migrationsupport</artifactId>
-        <version>5.6.2</version>
+        <version>${junitJupiterVersion}</version>
+        <scope>test</scope>
+      </dependency>
+      <!-- JUnit 5 parameterized test support -->
+      <dependency>
+        <groupId>org.junit.jupiter</groupId>
+        <artifactId>junit-jupiter-params</artifactId>
+        <version>${junitJupiterVersion}</version>
         <scope>test</scope>
       </dependency>
       <!-- JUnit 4 API dependency -->
       <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
-        <version>4.13</version>
+        <version>${junitVersion}</version>
         <scope>test</scope>
       </dependency>
       <!-- JUnit 4 engine -->
       <dependency>
         <groupId>org.junit.vintage</groupId>
         <artifactId>junit-vintage-engine</artifactId>
-        <version>5.6.2</version>
+        <version>${junitJupiterVersion}</version>
         <scope>test</scope>
       </dependency>
       <dependency>