Index: applications/editors/josm/plugins/poly/test/unit/poly/PolyExporterTest.java
===================================================================
--- applications/editors/josm/plugins/poly/test/unit/poly/PolyExporterTest.java	(revision 35995)
+++ applications/editors/josm/plugins/poly/test/unit/poly/PolyExporterTest.java	(revision 36064)
@@ -2,16 +2,16 @@
 package poly;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.nio.file.Files;
 import java.nio.file.Path;
 
-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;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 
 /**
@@ -19,12 +19,7 @@
  * @author Gerd Petermann
  */
-public class PolyExporterTest {
-
-    /**
-     * Setup test.
-     */
-    @Rule
-    public JOSMTestRules rules = new JOSMTestRules().preferences().timeout(20000);
-
+@BasicPreferences
+@Timeout(20)
+class PolyExporterTest {
     /**
      * Import file, export it, import the exported file and compare content
@@ -32,5 +27,5 @@
      */
     @Test
-    public void testSimpleExport() throws Exception {
+    void testSimpleExport() throws Exception {
         DataSet dsIn1 = new PolyImporter().parseDataSet(TestUtils.getTestDataRoot() + "/simple.poly");
         assertNotNull(dsIn1);
@@ -55,5 +50,5 @@
      */
     @Test
-    public void testExport() throws Exception {
+    void testExport() throws Exception {
         DataSet dsIn1 = new PolyImporter().parseDataSet(TestUtils.getTestDataRoot() + "/holes.poly");
         assertNotNull(dsIn1);
Index: applications/editors/josm/plugins/poly/test/unit/poly/PolyImporterTest.java
===================================================================
--- applications/editors/josm/plugins/poly/test/unit/poly/PolyImporterTest.java	(revision 35995)
+++ applications/editors/josm/plugins/poly/test/unit/poly/PolyImporterTest.java	(revision 36064)
@@ -2,14 +2,13 @@
 package poly;
 
-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.assertThrows;
 
-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;
 import org.openstreetmap.josm.io.IllegalDataException;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
 
 /**
@@ -17,17 +16,11 @@
  * @author Gerd Petermann
  */
-public class PolyImporterTest {
-
-    /**
-     * Setup test.
-     */
-    @Rule
-    public JOSMTestRules rules = new JOSMTestRules().preferences();
-
+@BasicPreferences
+class PolyImporterTest {
     /**
      * @throws Exception if an error occurs
      */
     @Test
-    public void testSimple() throws Exception {
+    void testSimple() throws Exception {
         DataSet ds = new PolyImporter().parseDataSet(TestUtils.getTestDataRoot() + "/simple.poly");
         assertNotNull(ds);
@@ -42,5 +35,5 @@
      */
     @Test
-    public void testSimple2() throws Exception {
+    void testSimple2() throws Exception {
         DataSet ds = new PolyImporter().parseDataSet(TestUtils.getTestDataRoot() + "/splitter.poly");
         assertNotNull(ds);
@@ -54,5 +47,5 @@
      */
     @Test
-    public void testHoles() throws Exception {
+    void testHoles() throws Exception {
         DataSet ds = new PolyImporter().parseDataSet(TestUtils.getTestDataRoot() + "/holes.poly");
         assertNotNull(ds);
@@ -66,5 +59,5 @@
      */
     @Test
-    public void testTwoOuter() throws Exception {
+    void testTwoOuter() throws Exception {
         DataSet ds = new PolyImporter().parseDataSet(TestUtils.getTestDataRoot() + "/australia_v.poly");
         assertNotNull(ds);
@@ -78,5 +71,5 @@
      */
     @Test
-    public void testDoubleEnd() throws Exception {
+    void testDoubleEnd() throws Exception {
         DataSet ds = new PolyImporter().parseDataSet(TestUtils.getTestDataRoot() + "/bremen-double-end.poly");
         assertNotNull(ds);
@@ -90,5 +83,5 @@
      */
     @Test
-    public void testMultipleFile() throws Exception {
+    void testMultipleFile() throws Exception {
         DataSet ds = new PolyImporter().parseDataSet(TestUtils.getTestDataRoot() + "/multi-concat.poly");
         assertNotNull(ds);
@@ -100,10 +93,9 @@
     /**
      * Should throw an IllegalDataException
-     * @throws Exception if an error occurs
      */
-    @Test (expected = IllegalDataException.class)
-    public void testNameMissing() throws Exception {
-        DataSet ds = new PolyImporter().parseDataSet(TestUtils.getTestDataRoot() + "/name-missing.poly");
-        assertNull(ds);
+    @Test
+    void testNameMissing() {
+        final PolyImporter importer = new PolyImporter();
+        assertThrows(IllegalDataException.class, () -> importer.parseDataSet(TestUtils.getTestDataRoot() + "/name-missing.poly"));
     }
 
