Index: trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/ClipboardUtilsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/ClipboardUtilsTest.java	(revision 16182)
+++ trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/ClipboardUtilsTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.gui.datatransfer;
 
-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.Assert.assertTrue;
+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 static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.Assume.assumeTrue;
 
@@ -17,6 +17,6 @@
 import java.io.IOException;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -28,5 +28,5 @@
  * @author Michael Zangl
  */
-public class ClipboardUtilsTest {
+class ClipboardUtilsTest {
     private static final class ThrowIllegalStateClipboard extends Clipboard {
         private int failingAccesses = 3;
@@ -70,5 +70,5 @@
      * No dependencies
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -78,5 +78,5 @@
      */
     @Test
-    public void testGetClipboard() {
+    void testGetClipboard() {
         Clipboard c = ClipboardUtils.getClipboard();
         assertNotNull(c);
@@ -88,5 +88,5 @@
      */
     @Test
-    public void testCopyPasteString() {
+    void testCopyPasteString() {
         ClipboardUtils.copyString("");
         assertEquals("", ClipboardUtils.getClipboardStringContent());
@@ -102,5 +102,5 @@
      */
     @Test
-    public void testGetContentIllegalState() {
+    void testGetContentIllegalState() {
         ThrowIllegalStateClipboard throwingClipboard = new ThrowIllegalStateClipboard("test");
 
@@ -118,5 +118,5 @@
      */
     @Test
-    public void testSystemSelectionDoesNotFail() {
+    void testSystemSelectionDoesNotFail() {
         assumeTrue(GraphicsEnvironment.isHeadless());
         assertNull(ClipboardUtils.getSystemSelection());
@@ -128,5 +128,5 @@
      */
     @Test
-    public void testUtilityClass() throws ReflectiveOperationException {
+    void testUtilityClass() throws ReflectiveOperationException {
         UtilityClassTestUtil.assertUtilityClassWellDefined(ClipboardUtils.class);
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/LayerTransferableTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/LayerTransferableTest.java	(revision 16182)
+++ trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/LayerTransferableTest.java	(revision 17275)
@@ -2,8 +2,9 @@
 package org.openstreetmap.josm.gui.datatransfer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.awt.datatransfer.DataFlavor;
@@ -11,6 +12,6 @@
 import java.util.Arrays;
 
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.gui.datatransfer.LayerTransferable.Data;
 import org.openstreetmap.josm.gui.layer.Layer;
@@ -24,5 +25,5 @@
  * @since 10605
  */
-public class LayerTransferableTest {
+class LayerTransferableTest {
     private TestLayer layer1;
     private TestLayer layer2;
@@ -32,5 +33,5 @@
      * Set up test data
      */
-    @Before
+    @BeforeEach
     public void createTestData() {
         layer1 = new LayerManagerTest.TestLayer();
@@ -45,5 +46,5 @@
      */
     @Test
-    public void testLayerData() {
+    void testLayerData() {
         Data data = new Data(manager, Arrays.<Layer>asList(layer1, layer2));
 
@@ -59,5 +60,5 @@
      */
     @Test
-    public void testSupportedDataFlavor() {
+    void testSupportedDataFlavor() {
         LayerTransferable transferable = new LayerTransferable(manager, Arrays.<Layer>asList(layer1, layer2));
 
@@ -75,5 +76,5 @@
      */
     @Test
-    public void testTransferData() throws Exception {
+    void testTransferData() throws Exception {
         LayerTransferable transferable = new LayerTransferable(manager, Arrays.<Layer>asList(layer1, layer2));
 
@@ -88,11 +89,10 @@
     /**
      * Test {@link LayerTransferable#getTransferData(DataFlavor)} for unsupported {@link DataFlavor}
-     * @throws Exception if any error occurs
      */
-    @Test(expected = UnsupportedFlavorException.class)
-    public void testTransferDataUnsupported() throws Exception {
+    @Test
+    void testTransferDataUnsupported() {
         LayerTransferable transferable = new LayerTransferable(manager, Arrays.<Layer>asList(layer1, layer2));
 
-        transferable.getTransferData(DataFlavor.imageFlavor);
+        assertThrows(UnsupportedFlavorException.class, () -> transferable.getTransferData(DataFlavor.imageFlavor));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandlerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandlerTest.java	(revision 16182)
+++ trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandlerTest.java	(revision 17275)
@@ -2,11 +2,11 @@
 package org.openstreetmap.josm.gui.datatransfer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Collections;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.actions.CopyAction;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -23,9 +23,9 @@
  * Unit tests of {@link OsmTransferHandler} class.
  */
-public class OsmTransferHandlerTest {
+class OsmTransferHandlerTest {
     /**
      * Prefs to use OSM primitives
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences().projection().main();
@@ -37,5 +37,5 @@
      */
     @Test
-    public void testPasteOn() {
+    void testPasteOn() {
         DataSet ds1 = new DataSet();
         Node n1 = new Node(new LatLon(43, 1));
@@ -63,5 +63,5 @@
      */
     @Test
-    public void testPasteTags() {
+    void testPasteTags() {
         Node n = new Node(LatLon.ZERO);
         MainApplication.getLayerManager().addLayer(new OsmDataLayer(new DataSet(n), "testPasteTags", null));
Index: trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/PrimitiveTransferableTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/PrimitiveTransferableTest.java	(revision 16182)
+++ trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/PrimitiveTransferableTest.java	(revision 17275)
@@ -2,7 +2,8 @@
 package org.openstreetmap.josm.gui.datatransfer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.awt.datatransfer.DataFlavor;
@@ -13,6 +14,6 @@
 import java.util.List;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.NodeData;
@@ -27,9 +28,9 @@
  * Unit tests of {@link PrimitiveTransferable} class.
  */
-public class PrimitiveTransferableTest {
+class PrimitiveTransferableTest {
     /**
      * Prefs to use OSM primitives
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -39,5 +40,5 @@
      */
     @Test
-    public void testGetTransferDataFlavors() {
+    void testGetTransferDataFlavors() {
         List<DataFlavor> flavors = Arrays.asList(new PrimitiveTransferable(null).getTransferDataFlavors());
         int ptd = flavors.indexOf(PrimitiveTransferData.DATA_FLAVOR);
@@ -57,5 +58,5 @@
      */
     @Test
-    public void testIsDataFlavorSupported() {
+    void testIsDataFlavorSupported() {
         assertTrue(new PrimitiveTransferable(null).isDataFlavorSupported(PrimitiveTransferData.DATA_FLAVOR));
         assertFalse(new PrimitiveTransferable(null).isDataFlavorSupported(DataFlavor.imageFlavor));
@@ -67,5 +68,5 @@
      */
     @Test
-    public void testGetTransferDataNominal() throws UnsupportedFlavorException {
+    void testGetTransferDataNominal() throws UnsupportedFlavorException {
         PrimitiveTransferData data = PrimitiveTransferData.getData(Collections.singleton(new Node(1)));
         PrimitiveTransferable pt = new PrimitiveTransferable(data);
@@ -83,10 +84,9 @@
     /**
      * Test of {@link PrimitiveTransferable#getTransferData} method - error case.
-     * @throws UnsupportedFlavorException always
      */
-    @Test(expected = UnsupportedFlavorException.class)
-    public void testGetTransferDataError() throws UnsupportedFlavorException {
+    @Test
+    void testGetTransferDataError() {
         PrimitiveTransferData data = PrimitiveTransferData.getData(Collections.singleton(new Node(1)));
-        new PrimitiveTransferable(data).getTransferData(DataFlavor.imageFlavor);
+        assertThrows(UnsupportedFlavorException.class, () -> new PrimitiveTransferable(data).getTransferData(DataFlavor.imageFlavor));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/RelationMemberTransferableTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/RelationMemberTransferableTest.java	(revision 16182)
+++ trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/RelationMemberTransferableTest.java	(revision 17275)
@@ -2,7 +2,8 @@
 package org.openstreetmap.josm.gui.datatransfer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.openstreetmap.josm.gui.datatransfer.RelationMemberTransferable.RELATION_MEMBER_DATA;
 
@@ -12,6 +13,6 @@
 import java.util.Collections;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.PrimitiveData;
@@ -26,10 +27,10 @@
  * Unit tests of {@link RelationMemberTransferable} class.
  */
-public class RelationMemberTransferableTest {
+class RelationMemberTransferableTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -39,5 +40,5 @@
      */
     @Test
-    public void testGetTransferDataFlavors() {
+    void testGetTransferDataFlavors() {
         DataFlavor[] flavors = new RelationMemberTransferable(Collections.<RelationMember>emptyList()).getTransferDataFlavors();
         assertEquals(3, flavors.length);
@@ -51,5 +52,5 @@
      */
     @Test
-    public void testIsDataFlavorSupported() {
+    void testIsDataFlavorSupported() {
         RelationMemberTransferable transferable = new RelationMemberTransferable(Collections.<RelationMember>emptyList());
         assertTrue(transferable.isDataFlavorSupported(RELATION_MEMBER_DATA));
@@ -63,5 +64,5 @@
      */
     @Test
-    public void testGetTransferDataNominal() throws UnsupportedFlavorException {
+    void testGetTransferDataNominal() throws UnsupportedFlavorException {
         RelationMemberTransferable rmt = new RelationMemberTransferable(Collections.singleton(new RelationMember("test", new Node(1))));
         assertEquals("node 1 test # incomplete\n", rmt.getTransferData(DataFlavor.stringFlavor));
@@ -80,9 +81,9 @@
     /**
      * Test of {@link RelationMemberTransferable#getTransferData} method - error case.
-     * @throws UnsupportedFlavorException always
      */
-    @Test(expected = UnsupportedFlavorException.class)
-    public void testGetTransferDataError() throws UnsupportedFlavorException {
-        new RelationMemberTransferable(Collections.singleton(new RelationMember(null, new Node(1)))).getTransferData(null);
+    @Test
+    void testGetTransferDataError() {
+        assertThrows(UnsupportedFlavorException.class,
+                () -> new RelationMemberTransferable(Collections.singleton(new RelationMember(null, new Node(1)))).getTransferData(null));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/TagTransferableTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/TagTransferableTest.java	(revision 16182)
+++ trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/TagTransferableTest.java	(revision 17275)
@@ -2,16 +2,16 @@
 package org.openstreetmap.josm.gui.datatransfer;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.awt.datatransfer.DataFlavor;
 import java.awt.datatransfer.UnsupportedFlavorException;
-import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
 import org.openstreetmap.josm.gui.datatransfer.data.TagTransferData;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -22,10 +22,10 @@
  * Unit tests of {@link TagTransferable} class.
  */
-public class TagTransferableTest {
+class TagTransferableTest {
 
     /**
      * Setup tests
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -35,5 +35,5 @@
      */
     @Test
-    public void testIsDataFlavorSupported() {
+    void testIsDataFlavorSupported() {
         TagTransferable tt = new TagTransferable(null);
         assertTrue(tt.isDataFlavorSupported(TagTransferData.FLAVOR));
@@ -48,5 +48,5 @@
      */
     @Test
-    public void testGetTransferDataNominal() throws Exception {
+    void testGetTransferDataNominal() throws Exception {
         Map<String, String> tags = new HashMap<>();
         tags.put("foo", "bar");
@@ -58,10 +58,8 @@
     /**
      * Test of {@link TagTransferable#getTransferData} method - error case.
-     * @throws UnsupportedFlavorException always
-     * @throws IOException never
      */
-    @Test(expected = UnsupportedFlavorException.class)
-    public void testGetTransferDataError() throws UnsupportedFlavorException, IOException {
-        new TagTransferable(null).getTransferData(null);
+    @Test
+    void testGetTransferDataError() {
+        assertThrows(UnsupportedFlavorException.class, () -> new TagTransferable(null).getTransferData(null));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/data/PrimitiveTagTransferDataTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/data/PrimitiveTagTransferDataTest.java	(revision 16182)
+++ trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/data/PrimitiveTagTransferDataTest.java	(revision 17275)
@@ -2,13 +2,13 @@
 package org.openstreetmap.josm.gui.datatransfer.data;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Arrays;
 import java.util.Map;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.NodeData;
@@ -26,9 +26,9 @@
  * @author Michael Zangl
  */
-public class PrimitiveTagTransferDataTest {
+class PrimitiveTagTransferDataTest {
     /**
      * Prefs only required because of the dependencies of OSM primitives.
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules().preferences();
@@ -42,5 +42,5 @@
      */
     @Test
-    public void testPrimitiveTagTransferDataPrimitiveTransferData() {
+    void testPrimitiveTagTransferDataPrimitiveTransferData() {
         PrimitiveTagTransferData data = new PrimitiveTagTransferData(PrimitiveTransferData.getData(Arrays.asList(new Node(), new Node())));
         assertEquals(2, data.getSourcePrimitiveCount(OsmPrimitiveType.NODE));
@@ -53,5 +53,5 @@
      */
     @Test
-    public void testIsHeterogeneousSource() {
+    void testIsHeterogeneousSource() {
         // 0 item
         assertFalse(isHeterogeneousSource());
@@ -74,5 +74,5 @@
      */
     @Test
-    public void testGetForPrimitives() {
+    void testGetForPrimitives() {
         PrimitiveTagTransferData data = createTestData();
         TagCollection forNode = data.getForPrimitives(OsmPrimitiveType.NODE);
@@ -100,5 +100,5 @@
      */
     @Test
-    public void testGetSourcePrimitiveCount() {
+    void testGetSourcePrimitiveCount() {
         PrimitiveTagTransferData data = createTestData();
         assertEquals(2, data.getSourcePrimitiveCount(OsmPrimitiveType.NODE));
@@ -111,5 +111,5 @@
      */
     @Test
-    public void testGetStatistics() {
+    void testGetStatistics() {
         PrimitiveTagTransferData data = createTestData();
         Map<OsmPrimitiveType, Integer> stats = data.getStatistics();
Index: trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/importers/OsmLinkPasterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/importers/OsmLinkPasterTest.java	(revision 16182)
+++ trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/importers/OsmLinkPasterTest.java	(revision 17275)
@@ -2,9 +2,9 @@
 package org.openstreetmap.josm.gui.datatransfer.importers;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -16,9 +16,9 @@
  * @author Michael Zangl
  */
-public class OsmLinkPasterTest {
+class OsmLinkPasterTest {
     /**
      * No dependencies
      */
-    @Rule
+    @RegisterExtension
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     public JOSMTestRules test = new JOSMTestRules();
@@ -28,5 +28,5 @@
      */
     @Test
-    public void testParseLatLon() {
+    void testParseLatLon() {
         assertEquals(new LatLon(51.71873, 8.76164),
                 OsmLinkPaster.parseLatLon("https://www.openstreetmap.org/#map=17/51.71873/8.76164"));
