Index: trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java	(revision 19154)
+++ trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java	(revision 19155)
@@ -10,4 +10,5 @@
 import java.util.List;
 
+import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.gui.jmapviewer.FeatureAdapter;
@@ -21,6 +22,4 @@
 import org.openstreetmap.josm.testutils.annotations.Projection;
 
-import com.github.tomakehurst.wiremock.WireMockServer;
-
 /**
  * Unit tests for class {@link AddImageryLayerAction}.
@@ -31,10 +30,4 @@
 @Projection
 final class AddImageryLayerActionTest {
-    /**
-     * HTTP mock.
-     */
-    @BasicWiremock
-    WireMockServer wireMockServer;
-
     /**
      * Unit test of {@link AddImageryLayerAction#updateEnabledState}.
@@ -65,14 +58,14 @@
      */
     @Test
-    void testActionPerformedEnabledWms() {
-        wireMockServer.stubFor(get(urlEqualTo("/wms?apikey=random_key&SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.1.1"))
+    void testActionPerformedEnabledWms(WireMockRuntimeInfo wireMockRuntimeInfo) {
+        wireMockRuntimeInfo.getWireMock().register(get(urlEqualTo("/wms?apikey=random_key&SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.1.1"))
                 .willReturn(aResponse()
                         .withStatus(200)
                         .withHeader("Content-Type", "text/xml")
                         .withBodyFile("imagery/wms-capabilities.xml")));
-        wireMockServer.stubFor(get(urlEqualTo("/wms?apikey=random_key&SERVICE=WMS&REQUEST=GetCapabilities"))
+        wireMockRuntimeInfo.getWireMock().register(get(urlEqualTo("/wms?apikey=random_key&SERVICE=WMS&REQUEST=GetCapabilities"))
                 .willReturn(aResponse()
                         .withStatus(404)));
-        wireMockServer.stubFor(get(urlEqualTo("/wms?apikey=random_key&SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.3.0"))
+        wireMockRuntimeInfo.getWireMock().register(get(urlEqualTo("/wms?apikey=random_key&SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.3.0"))
                 .willReturn(aResponse()
                         .withStatus(404)));
@@ -80,5 +73,5 @@
         try {
             FeatureAdapter.registerApiKeyAdapter(id -> "random_key");
-            final ImageryInfo imageryInfo = new ImageryInfo("localhost", wireMockServer.url("/wms?apikey={apikey}"),
+            final ImageryInfo imageryInfo = new ImageryInfo("localhost", wireMockRuntimeInfo.getHttpBaseUrl() + "/wms?apikey={apikey}",
                     "wms_endpoint", null, null);
             imageryInfo.setId("testActionPerformedEnabledWms");
Index: trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTaskTestParent.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTaskTestParent.java	(revision 19154)
+++ trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTaskTestParent.java	(revision 19155)
@@ -6,8 +6,8 @@
 import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
 
+import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
+import org.junit.jupiter.api.BeforeEach;
 import org.openstreetmap.josm.testutils.annotations.BasicWiremock;
 import org.openstreetmap.josm.testutils.annotations.HTTPS;
-
-import com.github.tomakehurst.wiremock.WireMockServer;
 
 /**
@@ -17,9 +17,9 @@
 @HTTPS
 public abstract class AbstractDownloadTaskTestParent {
-    /**
-     * HTTP mock.
-     */
-    @BasicWiremock
-    WireMockServer wireMockServer;
+    WireMockRuntimeInfo wireMockServer;
+    @BeforeEach
+    void setup(WireMockRuntimeInfo wireMockRuntimeInfo) {
+        this.wireMockServer = wireMockRuntimeInfo;
+    }
 
     /**
@@ -43,5 +43,9 @@
      */
     protected final String getRemoteFileUrl() {
-        return wireMockServer.url(getRemoteFile());
+        final String remote = getRemoteFile();
+        if (remote.startsWith("/")) {
+            return wireMockServer.getHttpBaseUrl() + getRemoteFile();
+        }
+        return wireMockServer.getHttpBaseUrl() + '/' + getRemoteFile();
     }
 
@@ -50,5 +54,5 @@
      */
     protected final void mockHttp() {
-        wireMockServer.stubFor(get(urlEqualTo("/" + getRemoteFile()))
+        wireMockServer.getWireMock().register(get(urlEqualTo("/" + getRemoteFile()))
                 .willReturn(aResponse()
                     .withStatus(200)
Index: trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJobTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJobTest.java	(revision 19154)
+++ trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJobTest.java	(revision 19155)
@@ -21,4 +21,5 @@
 import java.util.concurrent.TimeUnit;
 
+import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
 import org.apache.commons.jcs3.access.behavior.ICacheAccess;
 import org.apache.commons.jcs3.engine.behavior.ICacheElement;
@@ -33,5 +34,4 @@
 import org.openstreetmap.josm.tools.Logging;
 
-import com.github.tomakehurst.wiremock.WireMockServer;
 import com.github.tomakehurst.wiremock.matching.UrlPattern;
 
@@ -47,6 +47,5 @@
      * mocked tile server
      */
-    @BasicWiremock
-    WireMockServer tileServer;
+    WireMockRuntimeInfo tileServer;
 
     private static class TestCachedTileLoaderJob extends JCSCachedTileLoaderJob<String, CacheEntry> {
@@ -105,18 +104,21 @@
     /**
      * Always clear cache before tests
-     * @throws Exception when clearing fails
      */
     @BeforeEach
-    void clearCache() throws Exception {
+    void clearCache() {
         getCache().clear();
     }
 
+    @BeforeEach
+    void setup(WireMockRuntimeInfo wireMockRuntimeInfo) {
+        this.tileServer = wireMockRuntimeInfo;
+    }
+
     /**
      * Test status codes
-     * @throws InterruptedException in case of thread interruption
      * @throws IOException in case of I/O error
      */
     @Test
-    void testStatusCodes() throws IOException, InterruptedException {
+    void testStatusCodes() throws IOException {
         doTestStatusCode(200);
         doTestStatusCode(401);
@@ -155,5 +157,5 @@
 
     private void doTestStatusCode(int responseCode) throws IOException {
-        tileServer.stubFor(get(urlEqualTo("/httpstat/" + responseCode)).willReturn(aResponse().withStatus(responseCode)));
+        tileServer.getWireMock().register(get(urlEqualTo("/httpstat/" + responseCode)).willReturn(aResponse().withStatus(responseCode)));
         TestCachedTileLoaderJob job = getStatusLoaderJob(responseCode);
         Listener listener = submitJob(job);
@@ -196,7 +198,7 @@
         createHeadGetStub(urlEqualTo("/test"), expires, testStart, "eTag", "mock entry");
 
-        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob(tileServer.url("/test"), "test");
-        Listener listener = submitJob(job, false);
-        tileServer.verify(0, getRequestedFor(anyUrl()));
+        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob(tileServer.getHttpBaseUrl() + "/test", "test");
+        Listener listener = submitJob(job, false);
+        tileServer.getWireMock().verifyThat(0, getRequestedFor(anyUrl()));
         assertArrayEquals("cached entry".getBytes(StandardCharsets.UTF_8), listener.data);
     }
@@ -217,7 +219,7 @@
         createHeadGetStub(urlEqualTo("/test"), expires, testStart, "eTag", "mock entry");
 
-        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob(tileServer.url("/test"), "test");
+        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob(tileServer.getHttpBaseUrl() + "/test", "test");
         Listener listener = submitJob(job, true);
-        tileServer.verify(1, getRequestedFor(urlEqualTo("/test")));
+        tileServer.getWireMock().verifyThat(1, getRequestedFor(urlEqualTo("/test")));
         assertArrayEquals("mock entry".getBytes(StandardCharsets.UTF_8), listener.data);
     }
@@ -231,9 +233,9 @@
     void testSettingMinimumExpiryWhenNoExpires() throws IOException {
         long testStart = System.currentTimeMillis();
-        tileServer.stubFor(get(urlEqualTo("/test")).willReturn(aResponse().withBody("mock entry")));
-
-        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob(tileServer.url("/test"), "test");
-        Listener listener = submitJob(job, false);
-        tileServer.verify(1, getRequestedFor(urlEqualTo("/test")));
+        tileServer.getWireMock().register(get(urlEqualTo("/test")).willReturn(aResponse().withBody("mock entry")));
+
+        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob(tileServer.getHttpBaseUrl() + "/test", "test");
+        Listener listener = submitJob(job, false);
+        tileServer.getWireMock().verifyThat(1, getRequestedFor(urlEqualTo("/test")));
 
         assertTrue(listener.attributes.getExpirationTime() >= testStart + JCSCachedTileLoaderJob.DEFAULT_EXPIRE_TIME,
@@ -260,5 +262,5 @@
         long testStart = System.currentTimeMillis();
         long expires = TimeUnit.DAYS.toSeconds(1);
-        tileServer.stubFor(get(urlEqualTo("/test"))
+        tileServer.getWireMock().register(get(urlEqualTo("/test"))
                 .willReturn(aResponse()
                         .withHeader("Cache-control", "max-age=" + expires)
@@ -267,7 +269,7 @@
                 );
 
-        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob(tileServer.url("/test"), "test");
-        Listener listener = submitJob(job, false);
-        tileServer.verify(1, getRequestedFor(urlEqualTo("/test")));
+        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob(tileServer.getHttpBaseUrl() + "/test", "test");
+        Listener listener = submitJob(job, false);
+        tileServer.getWireMock().verifyThat(1, getRequestedFor(urlEqualTo("/test")));
 
         assertTrue(listener.attributes.getExpirationTime() >= testStart + TimeUnit.SECONDS.toMillis(expires),
@@ -298,7 +300,7 @@
         createHeadGetStub(urlEqualTo("/test"), (JCSCachedTileLoaderJob.DEFAULT_EXPIRE_TIME / 10), testStart, "eTag", "mock entry");
 
-        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob(tileServer.url("/test"), "test", minimumExpiryTimeSeconds);
-        Listener listener = submitJob(job, false);
-        tileServer.verify(1, getRequestedFor(urlEqualTo("/test")));
+        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob(tileServer.getHttpBaseUrl() + "/test", "test", minimumExpiryTimeSeconds);
+        Listener listener = submitJob(job, false);
+        tileServer.getWireMock().verifyThat(1, getRequestedFor(urlEqualTo("/test")));
         assertArrayEquals("mock entry".getBytes(StandardCharsets.UTF_8), listener.data);
 
@@ -331,7 +333,7 @@
         createHeadGetStub(urlEqualTo("/test"), (JCSCachedTileLoaderJob.DEFAULT_EXPIRE_TIME / 10), testStart, "eTag", "mock entry");
 
-        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob(tileServer.url("/test"), "test", minimumExpiryTimeSeconds);
-        Listener listener = submitJob(job, false);
-        tileServer.verify(1, getRequestedFor(urlEqualTo("/test")));
+        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob(tileServer.getHttpBaseUrl() + "/test", "test", minimumExpiryTimeSeconds);
+        Listener listener = submitJob(job, false);
+        tileServer.getWireMock().verifyThat(1, getRequestedFor(urlEqualTo("/test")));
         assertArrayEquals("mock entry".getBytes(StandardCharsets.UTF_8), listener.data);
 
@@ -367,5 +369,5 @@
         int minimumExpiryTimeSeconds = 0;
 
-        tileServer.stubFor(get(urlEqualTo("/test"))
+        tileServer.getWireMock().register(get(urlEqualTo("/test"))
                 .willReturn(aResponse()
                         .withHeader("Expires", TestUtils.getHTTPDate(testStart + (JCSCachedTileLoaderJob.DEFAULT_EXPIRE_TIME / 10)))
@@ -375,5 +377,5 @@
                         )
                 );
-        tileServer.stubFor(head(urlEqualTo("/test"))
+        tileServer.getWireMock().register(head(urlEqualTo("/test"))
                 .willReturn(aResponse()
                         .withHeader("Expires", TestUtils.getHTTPDate(testStart + (JCSCachedTileLoaderJob.DEFAULT_EXPIRE_TIME / 10)))
@@ -382,7 +384,7 @@
                         )
                 );
-        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob(tileServer.url("/test"), "test", minimumExpiryTimeSeconds);
-        Listener listener = submitJob(job, false);
-        tileServer.verify(1, getRequestedFor(urlEqualTo("/test")));
+        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob(tileServer.getHttpBaseUrl() + "/test", "test", minimumExpiryTimeSeconds);
+        Listener listener = submitJob(job, false);
+        tileServer.getWireMock().verifyThat(1, getRequestedFor(urlEqualTo("/test")));
         assertArrayEquals("mock entry".getBytes(StandardCharsets.UTF_8), listener.data);
 
@@ -413,5 +415,5 @@
         int minimumExpiryTimeSeconds = 0;
 
-        tileServer.stubFor(get(urlEqualTo("/test"))
+        tileServer.getWireMock().register(get(urlEqualTo("/test"))
                 .willReturn(aResponse()
                         .withHeader("Cache-Control", "" +
@@ -422,5 +424,5 @@
                         )
                 );
-        tileServer.stubFor(head(urlEqualTo("/test"))
+        tileServer.getWireMock().register(head(urlEqualTo("/test"))
                 .willReturn(aResponse()
                         .withHeader("Cache-Control", "" +
@@ -429,7 +431,7 @@
                         )
                 ));
-        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob(tileServer.url("/test"), "test", minimumExpiryTimeSeconds);
-        Listener listener = submitJob(job, false);
-        tileServer.verify(1, getRequestedFor(urlEqualTo("/test")));
+        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob(tileServer.getHttpBaseUrl() + "/test", "test", minimumExpiryTimeSeconds);
+        Listener listener = submitJob(job, false);
+        tileServer.getWireMock().verifyThat(1, getRequestedFor(urlEqualTo("/test")));
         assertArrayEquals("mock entry".getBytes(StandardCharsets.UTF_8), listener.data);
 
@@ -461,5 +463,5 @@
                 );
 
-        tileServer.stubFor(get(urlEqualTo("/test"))
+        tileServer.getWireMock().register(get(urlEqualTo("/test"))
                 .willReturn(aResponse()
                         .withHeader("Expires", TestUtils.getHTTPDate(testStart + expires))
@@ -469,5 +471,5 @@
                         )
                 );
-        tileServer.stubFor(head(urlEqualTo("/test"))
+        tileServer.getWireMock().register(head(urlEqualTo("/test"))
                 .willReturn(aResponse()
                         .withHeader("Expires", TestUtils.getHTTPDate(testStart + expires))
@@ -477,12 +479,12 @@
                 );
 
-        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob(tileServer.url("/test"), "test");
+        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob(tileServer.getHttpBaseUrl() + "/test", "test");
         Listener listener = submitJob(job, false); // cache entry is expired, no need to force refetch
-        tileServer.verify(1, getRequestedFor(urlEqualTo("/test")));
+        tileServer.getWireMock().verifyThat(1, getRequestedFor(urlEqualTo("/test")));
         assertArrayEquals("mock entry".getBytes(StandardCharsets.UTF_8), listener.data);
 
         // cache entry should be retrieved from cache
         listener = submitJob(job, false);
-        tileServer.verify(1, getRequestedFor(urlEqualTo("/test")));
+        tileServer.getWireMock().verifyThat(1, getRequestedFor(urlEqualTo("/test")));
         assertArrayEquals("mock entry".getBytes(StandardCharsets.UTF_8), listener.data);
 
@@ -494,8 +496,8 @@
 
         // because cache entry is invalid - HEAD request shall be made
-        tileServer.verify(0, headRequestedFor(urlEqualTo("/test"))); // no head requests were made until now
+        tileServer.getWireMock().verifyThat(0, headRequestedFor(urlEqualTo("/test"))); // no head requests were made until now
         listener = submitJob(job, false);
-        tileServer.verify(1, headRequestedFor(urlEqualTo("/test"))); // verify head requests were made
-        tileServer.verify(1, getRequestedFor(urlEqualTo("/test"))); // verify no more get requests were made
+        tileServer.getWireMock().verifyThat(1, headRequestedFor(urlEqualTo("/test"))); // verify head requests were made
+        tileServer.getWireMock().verifyThat(1, getRequestedFor(urlEqualTo("/test"))); // verify no more get requests were made
         assertArrayEquals("mock entry".getBytes(StandardCharsets.UTF_8), listener.data);
         assertTrue(listener.attributes.getExpirationTime() >= testStart + expires);
@@ -503,6 +505,6 @@
         // cache entry should be retrieved from cache
         listener = submitJob(job, false); // cache entry is expired, no need to force refetch
-        tileServer.verify(1, getRequestedFor(urlEqualTo("/test")));
-        tileServer.verify(1, getRequestedFor(urlEqualTo("/test")));
+        tileServer.getWireMock().verifyThat(1, getRequestedFor(urlEqualTo("/test")));
+        tileServer.getWireMock().verifyThat(1, getRequestedFor(urlEqualTo("/test")));
         assertArrayEquals("mock entry".getBytes(StandardCharsets.UTF_8), listener.data);
     }
@@ -522,5 +524,5 @@
                 );
 
-        tileServer.stubFor(get(urlEqualTo("/test"))
+        tileServer.getWireMock().register(get(urlEqualTo("/test"))
                 .willReturn(status(304)
                         .withHeader("Expires", TestUtils.getHTTPDate(testStart + expires))
@@ -530,15 +532,15 @@
                 );
 
-        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob(tileServer.url("/test"), "test");
-        Listener listener = submitJob(job, false);
-        tileServer.verify(1, getRequestedFor(urlEqualTo("/test")));
+        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob(tileServer.getHttpBaseUrl() + "/test", "test");
+        Listener listener = submitJob(job, false);
+        tileServer.getWireMock().verifyThat(1, getRequestedFor(urlEqualTo("/test")));
         assertArrayEquals("cached dummy".getBytes(StandardCharsets.UTF_8), listener.data);
         assertTrue(testStart + expires <= listener.attributes.getExpirationTime());
         submitJob(job, false);
-        tileServer.verify(1, getRequestedFor(urlEqualTo("/test"))); // no more requests were made
+        tileServer.getWireMock().verifyThat(1, getRequestedFor(urlEqualTo("/test"))); // no more requests were made
     }
 
     private void createHeadGetStub(UrlPattern url, long expires, long lastModified, String eTag, String body) {
-        tileServer.stubFor(get(url)
+        tileServer.getWireMock().register(get(url)
                 .willReturn(aResponse()
                         .withHeader("Expires", TestUtils.getHTTPDate(lastModified + expires))
@@ -548,5 +550,5 @@
                         )
                 );
-        tileServer.stubFor(head(url)
+        tileServer.getWireMock().register(head(url)
                 .willReturn(aResponse()
                         .withHeader("Expires", TestUtils.getHTTPDate(lastModified + expires))
@@ -567,5 +569,5 @@
 
     private TestCachedTileLoaderJob getStatusLoaderJob(int responseCode) {
-        return new TestCachedTileLoaderJob(tileServer.url("/httpstat/" + responseCode), "key_" + responseCode);
+        return new TestCachedTileLoaderJob(tileServer.getHttpBaseUrl() + "/httpstat/" + responseCode, "key_" + responseCode);
     }
 
Index: trunk/test/unit/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJobTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJobTest.java	(revision 19154)
+++ trunk/test/unit/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJobTest.java	(revision 19155)
@@ -16,4 +16,5 @@
 import java.util.regex.Pattern;
 
+import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
 import org.apache.commons.jcs3.access.behavior.ICacheAccess;
 import org.junit.jupiter.api.BeforeEach;
@@ -31,5 +32,4 @@
 import org.openstreetmap.josm.tools.Utils;
 
-import com.github.tomakehurst.wiremock.WireMockServer;
 import com.github.tomakehurst.wiremock.client.WireMock;
 
@@ -43,10 +43,14 @@
      * mocked tile server
      */
-    @BasicWiremock
-    WireMockServer tileServer;
+    private WireMockRuntimeInfo wireMockRuntimeInfo;
 
     @BeforeEach
-    void clearCache() throws Exception {
+    void clearCache() {
         getCache().clear();
+    }
+
+    @BeforeEach
+    void setup(WireMockRuntimeInfo wireMockRuntimeInfo) {
+        this.wireMockRuntimeInfo = wireMockRuntimeInfo;
     }
 
@@ -126,5 +130,5 @@
 
         @Override
-        public String getTileUrl(int zoom, int tilex, int tiley) throws IOException {
+        public String getTileUrl(int zoom, int tilex, int tiley) {
             return url;
         }
@@ -219,5 +223,5 @@
     void testNoCacheHeaders() throws IOException {
         long testStart = System.currentTimeMillis();
-        tileServer.stubFor(
+        wireMockRuntimeInfo.getWireMock().register(
                 WireMock.get(WireMock.urlEqualTo("/test"))
                 .willReturn(WireMock.aResponse()
@@ -226,10 +230,10 @@
                 );
 
-        TestCachedTileLoaderJob job = submitJob(new MockTile(tileServer.url("/test")), "test", false);
+        TestCachedTileLoaderJob job = submitJob(new MockTile(wireMockRuntimeInfo.getHttpBaseUrl() + "/test"), "test", false);
         assertExpirationAtLeast(testStart + TMSCachedTileLoaderJob.MINIMUM_EXPIRES.get(), job);
         assertArrayEquals("mock entry".getBytes(StandardCharsets.UTF_8), job.get().getContent());
-        job = submitJob(new MockTile(tileServer.url("/test")), "test", false); // submit another job for the same tile
+        job = submitJob(new MockTile(wireMockRuntimeInfo.getHttpBaseUrl() + "/test"), "test", false); // submit another job for the same tile
         // only one request to tile server should be made, second should come from cache
-        tileServer.verify(1, WireMock.getRequestedFor(WireMock.urlEqualTo("/test")));
+        wireMockRuntimeInfo.getWireMock().verifyThat(1, WireMock.getRequestedFor(WireMock.urlEqualTo("/test")));
         assertArrayEquals("mock entry".getBytes(StandardCharsets.UTF_8), job.get().getContent());
     }
@@ -257,5 +261,5 @@
     private void noCacheHeadersMinimumExpires(int minimumExpires) throws IOException {
         long testStart = System.currentTimeMillis();
-        tileServer.stubFor(
+        wireMockRuntimeInfo.getWireMock().register(
                 WireMock.get(WireMock.urlEqualTo("/test"))
                 .willReturn(WireMock.aResponse()
@@ -263,10 +267,10 @@
                         )
                 );
-        TestCachedTileLoaderJob job = submitJob(new MockTile(tileServer.url("/test")), "test", minimumExpires, false);
+        TestCachedTileLoaderJob job = submitJob(new MockTile(wireMockRuntimeInfo.getHttpBaseUrl() + "/test"), "test", minimumExpires, false);
         assertExpirationAtLeast(testStart + minimumExpires, job);
         assertArrayEquals("mock entry".getBytes(StandardCharsets.UTF_8), job.get().getContent());
-        job = submitJob(new MockTile(tileServer.url("/test")), "test", false); // submit another job for the same tile
+        job = submitJob(new MockTile(wireMockRuntimeInfo.getHttpBaseUrl() + "/test"), "test", false); // submit another job for the same tile
         // only one request to tile server should be made, second should come from cache
-        tileServer.verify(1, WireMock.getRequestedFor(WireMock.urlEqualTo("/test")));
+        wireMockRuntimeInfo.getWireMock().verifyThat(1, WireMock.getRequestedFor(WireMock.urlEqualTo("/test")));
         assertArrayEquals("mock entry".getBytes(StandardCharsets.UTF_8), job.get().getContent());
     }
@@ -280,5 +284,5 @@
         long testStart = System.currentTimeMillis();
         long expires = TMSCachedTileLoaderJob.MINIMUM_EXPIRES.get() / 2;
-        tileServer.stubFor(
+        wireMockRuntimeInfo.getWireMock().register(
                 WireMock.get(WireMock.urlEqualTo("/test"))
                 .willReturn(WireMock.aResponse()
@@ -287,10 +291,10 @@
                         )
                 );
-        TestCachedTileLoaderJob job = submitJob(new MockTile(tileServer.url("/test")), "test", false);
+        TestCachedTileLoaderJob job = submitJob(new MockTile(wireMockRuntimeInfo.getHttpBaseUrl() + "/test"), "test", false);
         assertExpirationAtLeast(testStart + TMSCachedTileLoaderJob.MINIMUM_EXPIRES.get(), job);
         assertArrayEquals("mock entry".getBytes(StandardCharsets.UTF_8), job.get().getContent());
-        job = submitJob(new MockTile(tileServer.url("/test")), "test", false); // submit another job for the same tile
+        job = submitJob(new MockTile(wireMockRuntimeInfo.getHttpBaseUrl() + "/test"), "test", false); // submit another job for the same tile
         // only one request to tile server should be made, second should come from cache
-        tileServer.verify(1, WireMock.getRequestedFor(WireMock.urlEqualTo("/test")));
+        wireMockRuntimeInfo.getWireMock().verifyThat(1, WireMock.getRequestedFor(WireMock.urlEqualTo("/test")));
         assertArrayEquals("mock entry".getBytes(StandardCharsets.UTF_8), job.get().getContent());
     }
@@ -312,5 +316,5 @@
         long testStart = System.currentTimeMillis();
         long expires = TMSCachedTileLoaderJob.MAXIMUM_EXPIRES.get() * 2;
-        tileServer.stubFor(
+        wireMockRuntimeInfo.getWireMock().register(
                 WireMock.get(WireMock.urlEqualTo("/test"))
                 .willReturn(WireMock.aResponse()
@@ -319,12 +323,12 @@
                         )
                 );
-        TestCachedTileLoaderJob job = submitJob(new MockTile(tileServer.url("/test")), "test", false);
+        TestCachedTileLoaderJob job = submitJob(new MockTile(wireMockRuntimeInfo.getHttpBaseUrl() + "/test"), "test", false);
         // give 1 second margin
         assertExpirationAtMost(testStart + TMSCachedTileLoaderJob.MAXIMUM_EXPIRES.get() + TimeUnit.SECONDS.toMillis(1), job);
 
         assertArrayEquals("mock entry".getBytes(StandardCharsets.UTF_8), job.get().getContent());
-        job = submitJob(new MockTile(tileServer.url("/test")), "test", false); // submit another job for the same tile
+        job = submitJob(new MockTile(wireMockRuntimeInfo.getHttpBaseUrl() + "/test"), "test", false); // submit another job for the same tile
         // only one request to tile server should be made, second should come from cache
-        tileServer.verify(1, WireMock.getRequestedFor(WireMock.urlEqualTo("/test")));
+        wireMockRuntimeInfo.getWireMock().verifyThat(1, WireMock.getRequestedFor(WireMock.urlEqualTo("/test")));
         assertArrayEquals("mock entry".getBytes(StandardCharsets.UTF_8), job.get().getContent());
     }
Index: trunk/test/unit/org/openstreetmap/josm/data/imagery/WMSEndpointTileSourceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/imagery/WMSEndpointTileSourceTest.java	(revision 19154)
+++ trunk/test/unit/org/openstreetmap/josm/data/imagery/WMSEndpointTileSourceTest.java	(revision 19155)
@@ -11,4 +11,6 @@
 import java.util.Collections;
 
+import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
+import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.gui.jmapviewer.interfaces.TemplatedTileSource;
@@ -22,5 +24,4 @@
 import org.openstreetmap.josm.testutils.annotations.Projection;
 
-import com.github.tomakehurst.wiremock.WireMockServer;
 import com.github.tomakehurst.wiremock.client.WireMock;
 
@@ -29,11 +30,14 @@
 @Projection
 class WMSEndpointTileSourceTest implements TileSourceTest {
-    @BasicWiremock
-    WireMockServer tileServer;
+    WireMockRuntimeInfo tileServer;
+    @BeforeEach
+    void setup(WireMockRuntimeInfo wireMockRuntimeInfo) {
+        this.tileServer = wireMockRuntimeInfo;
+    }
 
     private void basicMock() {
         final byte[] response = assertDoesNotThrow(() -> Files.readAllBytes(
                 Paths.get(TestUtils.getTestDataRoot() + "wms/geofabrik-osm-inspector.xml")));
-        tileServer.stubFor(
+        tileServer.getWireMock().register(
                 WireMock.get(WireMock.urlEqualTo("/capabilities?SERVICE=WMS&REQUEST=GetCapabilities"))
                         .willReturn(WireMock.aResponse().withBody(response))
@@ -45,5 +49,5 @@
         this.basicMock();
         final ImageryInfo info = new ImageryInfo("WMSEndpointTileSourceTest");
-        info.setExtendedUrl(tileServer.url("/capabilities"));
+        info.setExtendedUrl(tileServer.getHttpBaseUrl() + "/capabilities");
         info.setDefaultLayers(Collections.singletonList(new DefaultLayer(ImageryType.WMS_ENDPOINT,
                 "single_node_in_way", "default", null)));
@@ -60,5 +64,5 @@
     void testDefaultLayerSetInMaps() throws Exception {
 
-        tileServer.stubFor(
+        tileServer.getWireMock().register(
                 WireMock.get(WireMock.urlEqualTo("/capabilities?SERVICE=WMS&REQUEST=GetCapabilities"))
                 .willReturn(
@@ -68,5 +72,5 @@
                 );
 
-        tileServer.stubFor(WireMock.get(WireMock.urlEqualTo("/other/maps")).willReturn(WireMock.aResponse().withBody(
+        tileServer.getWireMock().register(WireMock.get(WireMock.urlEqualTo("/other/maps")).willReturn(WireMock.aResponse().withBody(
                 "<?xml version='1.0' encoding='UTF-8'?>\n" +
                 "<imagery xmlns=\"http://josm.openstreetmap.de/maps-1.0\">\n" +
@@ -76,5 +80,5 @@
                 "<type>wms_endpoint</type>\n" +
                 "<category>qa</category>\n" +
-                "<url><![CDATA[" + tileServer.url("/capabilities") + "]]></url>\n" +
+                "<url><![CDATA[" + tileServer.getHttpBaseUrl() + "/capabilities]]></url>\n" +
                 "<icon>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsSAAALEgHS3X78AAAB5UlEQVQ4y4WTwWsTURDG" +
                 "fy8W1yYmXZOqtGJJFyGw6KF7CEigwYuS0kthrYUi4i0iORS9BU9hQdA/ILcixVBrwENKLz1FUBB0wWOwYFAqxUNYTZq6BfM8yC5d05iBObz3vfnmm3kz4sqDh/zP" +
@@ -95,5 +99,5 @@
                 )));
 
-        Config.getPref().putList("imagery.layers.sites", Collections.singletonList(tileServer.url("/other/maps")));
+        Config.getPref().putList("imagery.layers.sites", Collections.singletonList(tileServer.getHttpBaseUrl() + "/other/maps"));
         ImageryLayerInfo.instance.loadDefaults(true, null, false);
         assertEquals(1, ImageryLayerInfo.instance.getDefaultLayers().size());
@@ -110,5 +114,5 @@
     @Test
     void testCustomHeadersServerSide() throws IOException {
-        tileServer.stubFor(
+        tileServer.getWireMock().register(
                 WireMock.get(WireMock.urlEqualTo("/capabilities?SERVICE=WMS&REQUEST=GetCapabilities"))
                 .willReturn(
@@ -118,5 +122,5 @@
                 );
 
-        tileServer.stubFor(WireMock.get(WireMock.urlEqualTo("/other/maps")).willReturn(WireMock.aResponse().withBody(
+        tileServer.getWireMock().register(WireMock.get(WireMock.urlEqualTo("/other/maps")).willReturn(WireMock.aResponse().withBody(
                 "<?xml version='1.0' encoding='UTF-8'?>\n" +
                 "<imagery xmlns=\"http://josm.openstreetmap.de/maps-1.0\">\n" +
@@ -129,5 +133,5 @@
                 "        <country-code>NO</country-code>\n" +
                 "        <description lang=\"en\">Historic Norwegian orthophotos and maps, courtesy of Geovekst and Norkart.</description>\n" +
-                "        <url><![CDATA[" + tileServer.url("/capabilities?SERVICE=WMS&REQUEST=GetCapabilities") + "]]></url>\n" +
+                "        <url><![CDATA[" + tileServer.getHttpBaseUrl() + "/capabilities?SERVICE=WMS&REQUEST=GetCapabilities]]></url>\n" +
                 "        <custom-http-header header-name=\"X-WAAPI-TOKEN\" header-value=\"b8e36d51-119a-423b-b156-d744d54123d5\" />\n" +
                 "        <attribution-text>© Geovekst</attribution-text>\n" +
@@ -141,5 +145,5 @@
                 )));
 
-        Config.getPref().putList("imagery.layers.sites", Collections.singletonList(tileServer.url("/other/maps")));
+        Config.getPref().putList("imagery.layers.sites", Collections.singletonList(tileServer.getHttpBaseUrl() + "/other/maps"));
         ImageryLayerInfo.instance.loadDefaults(true, null, false);
         ImageryInfo wmsImageryInfo = ImageryLayerInfo.instance.getDefaultLayers().get(0);
@@ -150,5 +154,5 @@
         assertEquals("b8e36d51-119a-423b-b156-d744d54123d5", tileSource.getHeaders().get("X-WAAPI-TOKEN"));
         assertTrue(wmsImageryInfo.isGeoreferenceValid());
-        tileServer.verify(
+        tileServer.getWireMock().verifyThat(
                 WireMock.getRequestedFor(WireMock.urlEqualTo("/capabilities?SERVICE=WMS&REQUEST=GetCapabilities"))
                 .withHeader("X-WAAPI-TOKEN", WireMock.equalTo("b8e36d51-119a-423b-b156-d744d54123d5")));
Index: trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java	(revision 19154)
+++ trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java	(revision 19155)
@@ -23,4 +23,5 @@
 import java.util.concurrent.TimeUnit;
 
+import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
 import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
@@ -45,5 +46,4 @@
 import org.openstreetmap.josm.tools.ReflectionUtils;
 
-import com.github.tomakehurst.wiremock.WireMockServer;
 import com.github.tomakehurst.wiremock.client.WireMock;
 
@@ -56,7 +56,4 @@
 @Timeout(value = 5, unit = TimeUnit.MINUTES)
 class WMTSTileSourceTest {
-    @BasicWiremock
-    WireMockServer tileServer;
-
     private final ImageryInfo testImageryTMS = new ImageryInfo("test imagery", "http://localhost", "tms", null, null);
     private final ImageryInfo testImageryPSEUDO_MERCATOR = getImagery(TestUtils.getTestDataRoot() + "wmts/getcapabilities-pseudo-mercator.xml");
@@ -367,9 +364,9 @@
 
     @Test
-    void testDefaultLayer() throws Exception {
+    void testDefaultLayer(WireMockRuntimeInfo wireMockRuntimeInfo) throws Exception {
         // https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/1.0.0/WMTSCapabilities.xml
         // do not use withFileBody as it needs different directory layout :(
 
-        tileServer.stubFor(
+        wireMockRuntimeInfo.getWireMock().register(
                 WireMock.get("/getcapabilities.xml")
                 .willReturn(
@@ -381,5 +378,5 @@
                 );
 
-        tileServer.stubFor(
+        wireMockRuntimeInfo.getWireMock().register(
                 WireMock.get("/other/maps")
                 .willReturn(
@@ -392,5 +389,5 @@
                 "<type>wmts</type>\n" +
                 "<category>photo</category>\n" +
-                "<url><![CDATA[" + tileServer.url("/getcapabilities.xml") + "]]></url>\n" +
+                "<url><![CDATA[" + wireMockRuntimeInfo.getHttpBaseUrl() + "/getcapabilities.xml]]></url>\n" +
                 "<default-layers>" +
                 "<layer name=\"GEOGRAPHICALGRIDSYSTEMS.MAPS\" />" +
@@ -400,5 +397,5 @@
                 )));
 
-        Config.getPref().putList("imagery.layers.sites", Collections.singletonList(tileServer.url("/other/maps")));
+        Config.getPref().putList("imagery.layers.sites", Collections.singletonList(wireMockRuntimeInfo.getHttpBaseUrl() + "/other/maps"));
         ImageryLayerInfo.instance.loadDefaults(true, null, false);
 
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/DefaultNameFormatterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/DefaultNameFormatterTest.java	(revision 19154)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/DefaultNameFormatterTest.java	(revision 19155)
@@ -15,4 +15,5 @@
 import java.util.stream.IntStream;
 
+import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
@@ -25,6 +26,4 @@
 import org.openstreetmap.josm.testutils.annotations.HTTP;
 import org.xml.sax.SAXException;
-
-import com.github.tomakehurst.wiremock.WireMockServer;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@@ -39,11 +38,6 @@
 class DefaultNameFormatterTest {
     /**
-     * HTTP mock.
-     */
-    @BasicWiremock
-    WireMockServer wireMockServer;
-
-    /**
      * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/9632">#9632</a>.
+     * @param wireMockRuntimeInfo Wiremock information
      * @throws IllegalDataException if an error was found while parsing the data from the source
      * @throws IOException if any I/O error occurs
@@ -52,12 +46,12 @@
     @Test
     @SuppressFBWarnings(value = "ITA_INEFFICIENT_TO_ARRAY")
-    void testTicket9632() throws IllegalDataException, IOException, SAXException {
+    void testTicket9632(WireMockRuntimeInfo wireMockRuntimeInfo) throws IllegalDataException, IOException, SAXException {
         String source = "presets/Presets_BicycleJunction-preset.xml";
-        wireMockServer.stubFor(get(urlEqualTo("/" + source))
+        wireMockRuntimeInfo.getWireMock().register(get(urlEqualTo("/" + source))
                 .willReturn(aResponse()
                     .withStatus(200)
                     .withHeader("Content-Type", "text/xml")
                     .withBodyFile(source)));
-        TaggingPresets.addTaggingPresets(TaggingPresetReader.readAll(wireMockServer.url(source), true));
+        TaggingPresets.addTaggingPresets(TaggingPresetReader.readAll(wireMockRuntimeInfo.getHttpBaseUrl() + '/' + source, true));
 
         Comparator<IRelation<?>> comparator = DefaultNameFormatter.getInstance().getRelationComparator();
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ApiUrlTestTaskTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ApiUrlTestTaskTest.java	(revision 19154)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ApiUrlTestTaskTest.java	(revision 19155)
@@ -14,4 +14,6 @@
 import java.awt.Component;
 
+import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
+import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Timeout;
@@ -20,6 +22,4 @@
 import org.openstreetmap.josm.testutils.annotations.HTTP;
 import org.openstreetmap.josm.tools.Logging;
-
-import com.github.tomakehurst.wiremock.WireMockServer;
 
 /**
@@ -31,11 +31,13 @@
 @HTTP
 class ApiUrlTestTaskTest {
-    /**
-     * HTTP mock.
-     */
-    @BasicWiremock
-    WireMockServer wireMockServer;
+    private WireMockRuntimeInfo wireMockServer;
+
 
     private static final Component PARENT = new JLabel();
+
+    @BeforeEach
+    void setup(WireMockRuntimeInfo wireMockServer) {
+        this.wireMockServer = wireMockServer;
+    }
 
     /**
@@ -52,5 +54,5 @@
     @Test
     void testNominalUrl() {
-        ApiUrlTestTask task = new ApiUrlTestTask(PARENT, wireMockServer.url("/__files/api"));
+        ApiUrlTestTask task = new ApiUrlTestTask(PARENT, wireMockServer.getHttpBaseUrl() + "/__files/api");
         task.run();
         assertTrue(task.isSuccess());
@@ -89,8 +91,8 @@
     void testAlertInvalidServerResult() {
         Logging.clearLastErrorAndWarnings();
-        wireMockServer.stubFor(get(urlEqualTo("/does-not-exist/0.6/capabilities"))
+        wireMockServer.getWireMock().register(get(urlEqualTo("/does-not-exist/0.6/capabilities"))
                 .willReturn(aResponse().withStatus(404)));
 
-        ApiUrlTestTask task = new ApiUrlTestTask(PARENT, wireMockServer.url("/does-not-exist"));
+        ApiUrlTestTask task = new ApiUrlTestTask(PARENT, wireMockServer.getHttpBaseUrl() + "/does-not-exist");
         task.run();
         assertFalse(task.isSuccess());
@@ -105,10 +107,11 @@
     void testAlertInvalidCapabilities() {
         Logging.clearLastErrorAndWarnings();
-        ApiUrlTestTask task = new ApiUrlTestTask(PARENT, wireMockServer.url("/__files/invalid_api"));
+        final String url = wireMockServer.getHttpBaseUrl() + "/__files/invalid_api";
+        ApiUrlTestTask task = new ApiUrlTestTask(PARENT, url);
         task.run();
         assertFalse(task.isSuccess());
         assertThat(Logging.getLastErrorAndWarnings().toString(), containsString(
                 "The OSM API server at 'XXX' did not return a valid response.<br>It is likely that 'XXX' is not an OSM API server."
-                        .replace("XXX", wireMockServer.url("/__files/invalid_api"))));
+                        .replace("XXX", url)));
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/io/OsmServerHistoryReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/OsmServerHistoryReaderTest.java	(revision 19154)
+++ trunk/test/unit/org/openstreetmap/josm/io/OsmServerHistoryReaderTest.java	(revision 19155)
@@ -6,4 +6,5 @@
 import java.time.Instant;
 
+import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
@@ -17,6 +18,4 @@
 import org.openstreetmap.josm.testutils.annotations.HTTP;
 
-import com.github.tomakehurst.wiremock.WireMockServer;
-
 /**
  * Unit tests of {@link OsmServerHistoryReader} class.
@@ -27,15 +26,9 @@
 class OsmServerHistoryReaderTest {
     /**
-     * HTTP mock.
-     */
-    @BasicWiremock
-    WireMockServer wireMockServer;
-
-    /**
      * Setup tests.
      */
     @BeforeEach
-    void setUp() {
-        Config.getPref().put("osm-server.url", wireMockServer.url("/__files/api"));
+    void setUp(WireMockRuntimeInfo wireMockRuntimeInfo) {
+        Config.getPref().put("osm-server.url", wireMockRuntimeInfo.getHttpBaseUrl() + "/__files/api");
     }
 
Index: trunk/test/unit/org/openstreetmap/josm/io/OverpassDownloadReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/OverpassDownloadReaderTest.java	(revision 19154)
+++ trunk/test/unit/org/openstreetmap/josm/io/OverpassDownloadReaderTest.java	(revision 19155)
@@ -14,4 +14,5 @@
 import java.util.regex.Matcher;
 
+import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
@@ -25,6 +26,4 @@
 import org.openstreetmap.josm.tools.date.DateUtils;
 
-import com.github.tomakehurst.wiremock.WireMockServer;
-
 /**
  * Unit tests of {@link OverpassDownloadReader} class.
@@ -34,9 +33,5 @@
 @HTTP
 class OverpassDownloadReaderTest {
-    /**
-     * HTTP mock.
-     */
-    @BasicWiremock
-    WireMockServer wireMockServer;
+    private WireMockRuntimeInfo wireMockServer;
 
     private static final String NOMINATIM_URL_PATH = "/search?format=xml&q=";
@@ -46,6 +41,7 @@
      */
     @BeforeEach
-    public void setUp() {
-        NameFinder.NOMINATIM_URL_PROP.put(wireMockServer.url(NOMINATIM_URL_PATH));
+    public void setUp(WireMockRuntimeInfo wireMockRuntimeInfo) {
+        this.wireMockServer = wireMockRuntimeInfo;
+        NameFinder.NOMINATIM_URL_PROP.put(wireMockServer.getHttpBaseUrl() + NOMINATIM_URL_PATH);
     }
 
@@ -74,5 +70,5 @@
 
     private void stubNominatim(String query) {
-        wireMockServer.stubFor(get(urlEqualTo(NOMINATIM_URL_PATH + query))
+        wireMockServer.getWireMock().register(get(urlEqualTo(NOMINATIM_URL_PATH + query))
                 .willReturn(aResponse()
                     .withStatus(200)
Index: trunk/test/unit/org/openstreetmap/josm/io/imagery/WMSImageryTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/imagery/WMSImageryTest.java	(revision 19154)
+++ trunk/test/unit/org/openstreetmap/josm/io/imagery/WMSImageryTest.java	(revision 19155)
@@ -11,4 +11,6 @@
 import java.util.List;
 
+import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
+import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
@@ -18,5 +20,4 @@
 import org.openstreetmap.josm.testutils.annotations.Projection;
 
-import com.github.tomakehurst.wiremock.WireMockServer;
 import com.github.tomakehurst.wiremock.client.WireMock;
 
@@ -28,6 +29,11 @@
 @Projection
 class WMSImageryTest {
-    @BasicWiremock
-    WireMockServer tileServer;
+
+    private WireMockRuntimeInfo tileServer;
+
+    @BeforeEach
+    void setup(WireMockRuntimeInfo wireMockRuntimeRule) {
+        this.tileServer = wireMockRuntimeRule;
+    }
 
     /**
@@ -52,9 +58,9 @@
     @Test
     void testTicket15730() throws IOException, WMSGetCapabilitiesException {
-        tileServer.stubFor(WireMock.get(WireMock.anyUrl()).willReturn(WireMock.aResponse().withBody(
+        tileServer.getWireMock().register(WireMock.get(WireMock.anyUrl()).willReturn(WireMock.aResponse().withBody(
                 Files.readAllBytes(Paths.get(TestUtils.getRegressionDataDir(15730), "capabilities.xml"))
                 )));
 
-        WMSImagery wms = new WMSImagery(tileServer.url("capabilities.xml"));
+        WMSImagery wms = new WMSImagery(tileServer.getHttpBaseUrl() + "/capabilities.xml");
         assertEquals(1, wms.getLayers().size());
         assertTrue(wms.getLayers().get(0).getAbstract().startsWith("South Carolina  NAIP Imagery 2017    Resolution: 100CM "));
@@ -63,7 +69,7 @@
     @Test
     void testNestedLayers() throws Exception {
-        tileServer.stubFor(WireMock.get(WireMock.anyUrl()).willReturn(WireMock.aResponse().withBody(
+        tileServer.getWireMock().register(WireMock.get(WireMock.anyUrl()).willReturn(WireMock.aResponse().withBody(
                 Files.readAllBytes(Paths.get(TestUtils.getTestDataRoot() + "wms/mapa-um-warszawa-pl.xml")))));
-        WMSImagery wmsi = new WMSImagery(tileServer.url("/serwis"));
+        WMSImagery wmsi = new WMSImagery(tileServer.getHttpBaseUrl() + "/serwis");
         assertEquals(1, wmsi.getLayers().size());
         assertEquals("Server WMS m.st. Warszawy", wmsi.getLayers().get(0).toString());
@@ -79,6 +85,6 @@
     void testTicket16248() throws IOException, WMSGetCapabilitiesException {
         byte[] capabilities = Files.readAllBytes(Paths.get(TestUtils.getRegressionDataFile(16248, "capabilities.xml")));
-        tileServer.stubFor(WireMock.get(WireMock.anyUrl()).willReturn(WireMock.aResponse().withBody(capabilities)));
-        WMSImagery wms = new WMSImagery(tileServer.url("any"));
+        tileServer.getWireMock().register(WireMock.get(WireMock.anyUrl()).willReturn(WireMock.aResponse().withBody(capabilities)));
+        WMSImagery wms = new WMSImagery(tileServer.getHttpBaseUrl() + "/any");
         assertEquals("http://wms.hgis.cartomatic.pl/topo/3857/m25k?", wms.buildRootUrl());
         assertEquals("wms.hgis.cartomatic.pl", wms.getLayers().get(0).getName());
@@ -96,6 +102,6 @@
     void testTicket19193() throws IOException, WMSGetCapabilitiesException {
         byte[] capabilities = Files.readAllBytes(Paths.get(TestUtils.getRegressionDataFile(19193, "capabilities.xml")));
-        tileServer.stubFor(WireMock.get(WireMock.anyUrl()).willReturn(WireMock.aResponse().withBody(capabilities)));
-        WMSImagery wms = new WMSImagery(tileServer.url("any"));
+        tileServer.getWireMock().register(WireMock.get(WireMock.anyUrl()).willReturn(WireMock.aResponse().withBody(capabilities)));
+        WMSImagery wms = new WMSImagery(tileServer.getHttpBaseUrl() + "/any");
         assertEquals("https://inspire.brandenburg.de/services/gn_alkis_wms?", wms.buildRootUrl());
         assertEquals(1, wms.getLayers().size());
@@ -114,5 +120,5 @@
     @Test
     void testTicket16333() throws IOException, WMSGetCapabilitiesException {
-        tileServer.stubFor(
+        tileServer.getWireMock().register(
                 WireMock.get(WireMock.anyUrl())
                 .willReturn(WireMock.aResponse().withBody(
@@ -120,5 +126,5 @@
                 ))
         );
-        WMSImagery wms = new WMSImagery(tileServer.url("any"));
+        WMSImagery wms = new WMSImagery(tileServer.getHttpBaseUrl() + "/any");
         assertEquals("https://duinoord.xs4all.nl/geoserver/ows?SERVICE=WMS&", wms.buildRootUrl());
         assertNull(wms.getLayers().get(0).getName());
@@ -131,5 +137,5 @@
     @Test
     void testForTitleWithinAttribution_ticket16940() throws IOException, WMSGetCapabilitiesException {
-        tileServer.stubFor(
+        tileServer.getWireMock().register(
                 WireMock.get(WireMock.anyUrl())
                 .willReturn(WireMock.aResponse().withBody(
@@ -137,5 +143,5 @@
                 ))
         );
-        WMSImagery wms = new WMSImagery(tileServer.url("any"));
+        WMSImagery wms = new WMSImagery(tileServer.getHttpBaseUrl() + "/any");
         assertEquals("Hipsográfico", wms.getLayers().stream().findFirst().get().getTitle());
     }
Index: trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportSenderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportSenderTest.java	(revision 19154)
+++ trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportSenderTest.java	(revision 19155)
@@ -16,4 +16,5 @@
 import java.util.List;
 
+import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.actions.ShowStatusReportAction;
@@ -23,6 +24,4 @@
 import org.openstreetmap.josm.testutils.annotations.HTTP;
 import org.openstreetmap.josm.testutils.mockers.OpenBrowserMocker;
-
-import com.github.tomakehurst.wiremock.WireMockServer;
 
 /**
@@ -34,17 +33,11 @@
 class BugReportSenderTest {
     /**
-     * HTTP mock
-     */
-    @BasicWiremock
-    WireMockServer wireMockServer;
-
-    /**
      * Unit test for {@link BugReportSender#BugReportSender}.
      * @throws InterruptedException if the thread is interrupted
      */
     @Test
-    void testBugReportSender() throws InterruptedException {
-        Config.getPref().put("josm.url", wireMockServer.baseUrl());
-        wireMockServer.stubFor(post(urlEqualTo("/josmticket"))
+    void testBugReportSender(WireMockRuntimeInfo wireMockRuntimeInfo) throws InterruptedException {
+        Config.getPref().put("josm.url", wireMockRuntimeInfo.getHttpBaseUrl());
+        wireMockRuntimeInfo.getWireMock().register(post(urlEqualTo("/josmticket"))
                 .willReturn(aResponse()
                         .withStatus(200)
@@ -66,9 +59,10 @@
         assertFalse(sender.isAlive());
         assertNull(sender.getErrorMessage(), sender.getErrorMessage());
-        wireMockServer.verify(exactly(1), postRequestedFor(urlEqualTo("/josmticket")).withRequestBody(containing("pdata=")));
+        wireMockRuntimeInfo.getWireMock().verifyThat(exactly(1),
+                postRequestedFor(urlEqualTo("/josmticket")).withRequestBody(containing("pdata=")));
 
         List<URI> calledURIs = OpenBrowserMocker.getCalledURIs();
         assertEquals(1, calledURIs.size());
-        assertEquals(wireMockServer.url("/josmticket?pdata_stored=6bccff5c0417217bfbbe5fff"), calledURIs.get(0).toString());
+        assertEquals(wireMockRuntimeInfo.getHttpBaseUrl() + "/josmticket?pdata_stored=6bccff5c0417217bfbbe5fff", calledURIs.get(0).toString());
     }
 }
