Index: applications/editors/josm/plugins/pbf/test/unit/org/openstreetmap/josm/plugins/pbf/io/PbfExporterTest.java
===================================================================
--- applications/editors/josm/plugins/pbf/test/unit/org/openstreetmap/josm/plugins/pbf/io/PbfExporterTest.java	(revision 36034)
+++ applications/editors/josm/plugins/pbf/test/unit/org/openstreetmap/josm/plugins/pbf/io/PbfExporterTest.java	(revision 36064)
@@ -1,4 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.pbf.io;
+
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 
 import java.io.FileInputStream;
@@ -6,7 +8,8 @@
 import java.nio.file.Files;
 import java.nio.file.Path;
+import java.nio.file.Paths;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -14,17 +17,12 @@
 import org.openstreetmap.josm.io.Compression;
 import org.openstreetmap.josm.io.OsmReader;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 
 /**
  * Unit tests for {@link PbfExporter}.
  */
-public class PbfExporterTest {
-
-    /**
-     * Setup test.
-     */
-    @Rule
-    public JOSMTestRules rules = new JOSMTestRules().preferences().timeout(20000);
-
+@BasicPreferences
+@Timeout(20)
+class PbfExporterTest {
     /**
      * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/11169">Ticket #11169</a>.
@@ -32,10 +30,11 @@
      */
     @Test
-    public void testTicket11169() throws Exception {
+    void testTicket11169() throws Exception {
         try (InputStream is = Compression.ZIP.getUncompressedInputStream(
-                new FileInputStream(TestUtils.getRegressionDataFile(11169, "Portsmouth_Area.osm.zip")))) {
+                Files.newInputStream(Paths.get(TestUtils.getRegressionDataFile(11169, "Portsmouth_Area.osm.zip"))))) {
             DataSet ds = OsmReader.parseDataSet(is, null);
             Path out = Files.createTempFile("pbf-bug-11169", "pbf");
-            new PbfExporter().doSave(out.toFile(), new OsmDataLayer(ds, null, null));
+            PbfExporter exporter = new PbfExporter();
+            assertDoesNotThrow(() -> exporter.doSave(out.toFile(), new OsmDataLayer(ds, null, null)));
             Files.delete(out);
         }
Index: applications/editors/josm/plugins/pbf/test/unit/org/openstreetmap/josm/plugins/pbf/io/PbfImporterTest.java
===================================================================
--- applications/editors/josm/plugins/pbf/test/unit/org/openstreetmap/josm/plugins/pbf/io/PbfImporterTest.java	(revision 36034)
+++ applications/editors/josm/plugins/pbf/test/unit/org/openstreetmap/josm/plugins/pbf/io/PbfImporterTest.java	(revision 36064)
@@ -2,12 +2,11 @@
 package org.openstreetmap.josm.plugins.pbf.io;
 
-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.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 import java.io.IOException;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -16,23 +15,17 @@
 import org.openstreetmap.josm.data.osm.User;
 import org.openstreetmap.josm.io.IllegalDataException;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 
 /**
  * Unit tests for {@link PbfImporter}.
  */
-public class PbfImporterTest {
-
-    /**
-     * Setup test.
-     */
-    @Rule
-    public JOSMTestRules rules = new JOSMTestRules().preferences();
-
+@BasicPreferences
+class PbfImporterTest {
     private static void checkUserNull(OsmPrimitive osm, boolean hasToBeNull) {
         User usr = osm.getUser();
         if (hasToBeNull) {
-            assertNull(osm + " -> " + usr, usr);
+            assertNull(usr, osm + " -> " + usr);
         } else {
-            assertNotNull(osm + " -> " + usr, usr);
+            assertNotNull(usr, osm + " -> " + usr);
         }
     }
@@ -55,5 +48,5 @@
      */
     @Test
-    public void testParseDataSet() throws Exception {
+    void testParseDataSet() throws Exception {
         doTestMonaco(TestUtils.getTestDataRoot() + "/monaco-latest.osm.pbf", false);
     }
@@ -64,5 +57,5 @@
      */
     @Test
-    public void testTicket10132() throws Exception {
+    void testTicket10132() throws Exception {
         doTestMonaco(TestUtils.getRegressionDataFile(10132, "Monaco-SP.osm.pbf"), true);
     }
@@ -73,5 +66,5 @@
      */
     @Test
-    public void testTicket12567() throws Exception {
+    void testTicket12567() throws Exception {
         DataSet ds = new PbfImporter().parseDataSet(TestUtils.getRegressionDataFile(12567, "12390008.osm.pbf"));
         assertNotNull(ds);
@@ -86,5 +79,5 @@
      */
     @Test
-    public void testTicket14545() throws Exception {
+    void testTicket14545() throws Exception {
         DataSet ds = new PbfImporter().parseDataSet(TestUtils.getRegressionDataFile(14545, "reg14545.osm.pbf"));
         assertNotNull(ds);
