Index: trunk/test/functional/org/openstreetmap/josm/tools/HttpClientTest.java
===================================================================
--- trunk/test/functional/org/openstreetmap/josm/tools/HttpClientTest.java	(revision 17809)
+++ trunk/test/functional/org/openstreetmap/josm/tools/HttpClientTest.java	(revision 18106)
@@ -16,6 +16,7 @@
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.text.IsEqualIgnoringCase.equalToIgnoringCase;
-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.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.io.BufferedReader;
@@ -34,38 +35,33 @@
 import java.util.stream.Collectors;
 
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.Version;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
+import org.openstreetmap.josm.testutils.annotations.BasicWiremock;
+import org.openstreetmap.josm.testutils.annotations.HTTP;
 import org.openstreetmap.josm.tools.HttpClient.Response;
 
-import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
+import com.github.tomakehurst.wiremock.WireMockServer;
 import com.github.tomakehurst.wiremock.http.HttpHeader;
 import com.github.tomakehurst.wiremock.http.HttpHeaders;
-import com.github.tomakehurst.wiremock.junit.WireMockRule;
 import com.github.tomakehurst.wiremock.matching.UrlPattern;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
 /**
  * Tests the {@link HttpClient}.
  */
-public class HttpClientTest {
-
-    /**
-     * Setup test
-     */
-    @Rule
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().timeout(15000);
-
+@HTTP
+@BasicWiremock
+@BasicPreferences
+@Timeout(15)
+class HttpClientTest {
     /**
      * mocked local http server
      */
-    @Rule
-    public WireMockRule localServer = new WireMockRule(WireMockConfiguration.options().dynamicPort());
+    @BasicWiremock
+    public WireMockServer localServer;
 
     private ProgressMonitor progress;
@@ -91,5 +87,5 @@
      * Setup test.
      */
-    @Before
+    @BeforeEach
     public void setUp() {
         localServer.resetAll();
@@ -105,5 +101,5 @@
      */
     @Test
-    public void testConstructorGetterSetter() throws IOException {
+    void testConstructorGetterSetter() throws IOException {
         final URL localUrl = url("");
         final HttpClient client = HttpClient.create(localUrl);
@@ -127,5 +123,5 @@
      */
     @Test
-    public void testGet() throws IOException {
+    void testGet() throws IOException {
         final UrlPattern pattern = urlEqualTo("/get?foo=bar");
         localServer.stubFor(get(pattern).willReturn(aResponse().withStatusMessage("OK")
@@ -151,5 +147,5 @@
      */
     @Test
-    public void testHeaders() throws IOException {
+    void testHeaders() throws IOException {
         final UrlPattern pattern = urlEqualTo("/headers");
         localServer.stubFor(get(pattern).willReturn(aResponse()));
@@ -166,5 +162,5 @@
      */
     @Test
-    public void testFetchUtf8Content() throws IOException {
+    void testFetchUtf8Content() throws IOException {
         localServer.stubFor(get(urlEqualTo("/encoding/utf8"))
                 .willReturn(aResponse().withBody("∀x∈ℝ: UTF-8 encoded sample plain-text file")));
@@ -181,5 +177,5 @@
      */
     @Test
-    public void testPost() throws IOException {
+    void testPost() throws IOException {
         final UrlPattern pattern = urlEqualTo("/post");
         localServer.stubFor(post(pattern).willReturn(aResponse()));
@@ -200,5 +196,5 @@
      */
     @Test
-    public void testPostZero() throws IOException {
+    void testPostZero() throws IOException {
         final UrlPattern pattern = urlEqualTo("/post");
         localServer.stubFor(post(pattern).willReturn(aResponse()));
@@ -215,5 +211,5 @@
 
     @Test
-    public void testRelativeRedirects() throws IOException {
+    void testRelativeRedirects() throws IOException {
         mockRedirects(false, 3);
         final Response response = connect("/relative-redirect/3");
@@ -223,5 +219,5 @@
 
     @Test
-    public void testAbsoluteRedirects() throws IOException {
+    void testAbsoluteRedirects() throws IOException {
         mockRedirects(true, 3);
         final Response response = connect("/absolute-redirect/3");
@@ -234,8 +230,8 @@
      * @throws IOException if an I/O error occurs
      */
-    @Test(expected = IOException.class)
-    public void testTooMuchRedirects() throws IOException {
+    @Test
+    void testTooMuchRedirects() throws IOException {
         mockRedirects(false, 3);
-        HttpClient.create(url("/relative-redirect/3")).setMaxRedirects(2).connect(progress);
+        assertThrows(IOException.class, () -> HttpClient.create(url("/relative-redirect/3")).setMaxRedirects(2).connect(progress));
     }
 
@@ -245,5 +241,5 @@
      */
     @Test
-    public void testHttp418() throws IOException {
+    void testHttp418() throws IOException {
         // https://tools.ietf.org/html/rfc2324
         final Response response = doTestHttp(418, "I'm a teapot!", "I'm a teapot!",
@@ -257,5 +253,5 @@
      */
     @Test
-    public void testHttp401() throws IOException {
+    void testHttp401() throws IOException {
         // https://tools.ietf.org/html/rfc2324
         doTestHttp(401, "UNAUTHORIZED", null);
@@ -267,5 +263,5 @@
      */
     @Test
-    public void testHttp402() throws IOException {
+    void testHttp402() throws IOException {
         // https://tools.ietf.org/html/rfc2324
         doTestHttp(402, "PAYMENT REQUIRED", "Fuck you, pay me!");
@@ -277,5 +273,5 @@
      */
     @Test
-    public void testHttp403() throws IOException {
+    void testHttp403() throws IOException {
         // https://tools.ietf.org/html/rfc2324
         doTestHttp(403, "FORBIDDEN", null);
@@ -287,5 +283,5 @@
      */
     @Test
-    public void testHttp404() throws IOException {
+    void testHttp404() throws IOException {
         // https://tools.ietf.org/html/rfc2324
         doTestHttp(404, "NOT FOUND", null);
@@ -297,5 +293,5 @@
      */
     @Test
-    public void testHttp500() throws IOException {
+    void testHttp500() throws IOException {
         // https://tools.ietf.org/html/rfc2324
         doTestHttp(500, "INTERNAL SERVER ERROR", null);
@@ -307,5 +303,5 @@
      */
     @Test
-    public void testRequestInTime() throws IOException {
+    void testRequestInTime() throws IOException {
         mockDelay(1);
         final Response response = HttpClient.create(url("/delay/1")).setReadTimeout(2000).connect(progress);
@@ -317,8 +313,8 @@
      * @throws IOException always
      */
-    @Test(expected = IOException.class)
-    public void testTakesTooLong() throws IOException {
+    @Test
+    void testTakesTooLong() throws IOException {
         mockDelay(1);
-        HttpClient.create(url("/delay/1")).setReadTimeout(500).connect(progress);
+        assertThrows(IOException.class, () -> HttpClient.create(url("/delay/1")).setReadTimeout(500).connect(progress));
     }
 
@@ -328,5 +324,5 @@
      */
     @Test
-    public void testGzip() throws IOException {
+    void testGzip() throws IOException {
         localServer.stubFor(get(urlEqualTo("/gzip")).willReturn(aResponse().withBody("foo")));
         final Response response = connect("/gzip");
@@ -341,5 +337,5 @@
      */
     @Test
-    public void testOpenUrlGzip() throws IOException {
+    void testOpenUrlGzip() throws IOException {
         final Path path = Paths.get(TestUtils.getTestDataRoot(), "tracks/tracks.gpx.gz");
         final byte[] gpx = Files.readAllBytes(path);
@@ -361,5 +357,5 @@
      */
     @Test
-    public void testOpenUrlBzip() throws IOException {
+    void testOpenUrlBzip() throws IOException {
         final Path path = Paths.get(TestUtils.getTestDataRoot(), "tracks/tracks.gpx.bz2");
         final byte[] gpx = Files.readAllBytes(path);
@@ -381,5 +377,5 @@
      */
     @Test
-    public void testOpenUrlBzipAccordingToContentDisposition() throws IOException {
+    void testOpenUrlBzipAccordingToContentDisposition() throws IOException {
         final Path path = Paths.get(TestUtils.getTestDataRoot(), "tracks/tracks.gpx.bz2");
         final byte[] gpx = Files.readAllBytes(path);
@@ -402,5 +398,5 @@
      */
     @Test
-    public void testTomcatErrorMessage() {
+    void testTomcatErrorMessage() {
         Matcher m = HttpClient.getTomcatErrorMatcher(
             "<html><head><title>Apache Tomcat/DGFiP - Rapport d''erreur</title><style><!--"+
