Index: build.xml
===================================================================
--- build.xml	(revision 16646)
+++ build.xml	(working copy)
@@ -462,6 +462,7 @@
 	                    <jvmarg value="${jacocoagent@{testfamily}@{testITsuffix}}" if:set="jacocoagent@{testfamily}@{testITsuffix}" />
 	                    <jvmarg value="-Dfile.encoding=UTF-8"/>
 	                    <jvmarg value="-javaagent:${test.dir}/lib/jmockit.jar"/>
+                        <jvmarg value="-Djunit.jupiter.extensions.autodetection.enabled=true"/>
 	                    <jvmarg value="--add-modules" if:set="isJava9" unless:set="isJava11" />
 	                    <jvmarg value="java.activation,java.se.ee" if:set="isJava9" unless:set="isJava11" />
 	                    <jvmarg value="--add-exports" if:set="isJava9" unless:set="noJavaFX" />
Index: test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
===================================================================
--- test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java	(revision 16646)
+++ test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java	(working copy)
@@ -103,6 +103,12 @@
     private boolean territories;
     private boolean metric;
     private boolean main;
+    /**
+     * This boolean is only used to indicate if JUnit5 is used in a test. If it is,
+     * we must not call after in {@link JOSMTestRules.CreateJosmEnvironment#evaluate}.
+     * TODO: Remove JUnit4 as a whole sometime after 2021-01-01 (~6 month lead time for plugins)
+     */
+    private boolean junit5;
 
     /**
      * Disable the default timeout for this test. Use with care.
@@ -437,6 +443,7 @@
 
     @Override
     public void beforeEach(ExtensionContext context) throws Exception {
+        this.junit5 = true;
         Statement temporaryStatement = new Statement() {
             @Override
             public void evaluate() throws Throwable {
@@ -454,7 +461,7 @@
 
     @Override
     public void afterEach(ExtensionContext context) throws Exception {
-        // do nothing for now
+        after();
     }
 
     /**
@@ -689,7 +696,9 @@
             try {
                 base.evaluate();
             } finally {
-                after();
+                if (!junit5) {
+                    after();
+                }
             }
         }
     }
