Index: trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java	(revision 17194)
+++ trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java	(revision 17195)
@@ -82,5 +82,5 @@
                         .withStatus(404)));
 
-        new AddImageryLayerAction(new ImageryInfo("localhost", "http://localhost:" + wireMockRule.port() + "/wms?",
+        new AddImageryLayerAction(new ImageryInfo("localhost", wireMockRule.url("/wms?"),
                 "wms_endpoint", null, null)).actionPerformed(null);
         List<WMSLayer> wmsLayers = MainApplication.getLayerManager().getLayersOfType(WMSLayer.class);
Index: trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTaskTestParent.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTaskTestParent.java	(revision 17194)
+++ trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTaskTestParent.java	(revision 17195)
@@ -53,5 +53,5 @@
      */
     protected final String getRemoteFileUrl() {
-        return "http://localhost:" + wireMockRule.port() + "/" + getRemoteFile();
+        return wireMockRule.url(getRemoteFile());
     }
 
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/DefaultNameFormatterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/DefaultNameFormatterTest.java	(revision 17194)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/DefaultNameFormatterTest.java	(revision 17195)
@@ -63,5 +63,5 @@
                     .withHeader("Content-Type", "text/xml")
                     .withBodyFile(source)));
-        TaggingPresets.addTaggingPresets(TaggingPresetReader.readAll("http://localhost:" + wireMockRule.port() + "/" + source, true));
+        TaggingPresets.addTaggingPresets(TaggingPresetReader.readAll(wireMockRule.url(source), true));
 
         Comparator<IRelation<?>> comparator = DefaultNameFormatter.getInstance().getRelationComparator();
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceHighLevelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceHighLevelTest.java	(revision 17194)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceHighLevelTest.java	(revision 17195)
@@ -88,5 +88,5 @@
         Config.getPref().put("pluginmanager.lastupdate", "999");
         Config.getPref().putList("pluginmanager.sites",
-            Collections.singletonList(String.format("http://localhost:%s/plugins", this.pluginServerRule.port()))
+            Collections.singletonList(this.pluginServerRule.url("/plugins"))
         );
 
@@ -835,5 +835,5 @@
             new PluginServer.RemotePlugin(this.referenceDummyJarNew),
             new PluginServer.RemotePlugin(this.referenceBazJarNew, Collections.singletonMap(
-                "6800_Plugin-Url", "6;http://localhost:" + this.pluginServerRule.port() + bazOldServePath
+                "6800_Plugin-Url", "6;" + this.pluginServerRule.url(bazOldServePath)
             ))
         );
Index: trunk/test/unit/org/openstreetmap/josm/io/OverpassDownloadReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/OverpassDownloadReaderTest.java	(revision 17194)
+++ trunk/test/unit/org/openstreetmap/josm/io/OverpassDownloadReaderTest.java	(revision 17195)
@@ -55,5 +55,5 @@
     @Before
     public void setUp() {
-        NameFinder.NOMINATIM_URL_PROP.put("http://localhost:" + wireMockRule.port() + NOMINATIM_URL_PATH);
+        NameFinder.NOMINATIM_URL_PROP.put(wireMockRule.url(NOMINATIM_URL_PATH));
     }
 
Index: trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerJOSMTooOldTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerJOSMTooOldTest.java	(revision 17194)
+++ trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerJOSMTooOldTest.java	(revision 17195)
@@ -64,5 +64,5 @@
         Config.getPref().put("pluginmanager.lastupdate", "999");
         Config.getPref().putList("pluginmanager.sites",
-                Collections.singletonList(String.format("http://localhost:%s/plugins", this.pluginServerRule.port()))
+                Collections.singletonList(this.pluginServerRule.url("/plugins"))
         );
 
@@ -310,5 +310,5 @@
             new PluginServer.RemotePlugin(this.referenceBazJarOld),
             new PluginServer.RemotePlugin(this.referenceQuxJarNewer, Collections.singletonMap(
-                "7499_Plugin-Url", "346;http://localhost:" + this.pluginServerRule.port() + "/dont/bother.jar"
+                "7499_Plugin-Url", "346;" + this.pluginServerRule.url("/dont/bother.jar")
             ))
         );
Index: trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerMultiVersionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerMultiVersionTest.java	(revision 17194)
+++ trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerMultiVersionTest.java	(revision 17195)
@@ -60,5 +60,5 @@
         Config.getPref().put("pluginmanager.lastupdate", "999");
         Config.getPref().putList("pluginmanager.sites",
-                Collections.singletonList(String.format("http://localhost:%s/plugins", this.pluginServerRule.port()))
+                Collections.singletonList(this.pluginServerRule.url("/plugins"))
         );
 
@@ -101,7 +101,7 @@
         final String quxNewerServePath = "/qux/newer.jar";
         final Map<String, String> attrOverrides = new HashMap<String, String>() {{
-            put("7500_Plugin-Url", "432;http://localhost:" + pluginServerRule.port() + quxNewerServePath);
-            put("7499_Plugin-Url", "346;http://localhost:" + pluginServerRule.port() + "/not/served.jar");
-            put("6999_Plugin-Url", "345;http://localhost:" + pluginServerRule.port() + "/not/served/eithejar");
+            put("7500_Plugin-Url", "432;" + pluginServerRule.url(quxNewerServePath));
+            put("7499_Plugin-Url", "346;" + pluginServerRule.url("/not/served.jar"));
+            put("6999_Plugin-Url", "345;" + pluginServerRule.url("/not/served/eithejar"));
         }};
         final PluginServer pluginServer = new PluginServer(
@@ -167,7 +167,7 @@
 
         final Map<String, String> attrOverrides = new HashMap<String, String>() {{
-            put("7500_Plugin-Url", "432;http://localhost:" + pluginServerRule.port() + "/dont.jar");
-            put("7499_Plugin-Url", "346;http://localhost:" + pluginServerRule.port() + "/even.jar");
-            put("6999_Plugin-Url", "345;http://localhost:" + pluginServerRule.port() + "/bother.jar");
+            put("7500_Plugin-Url", "432;" + pluginServerRule.url("/dont.jar"));
+            put("7499_Plugin-Url", "346;" + pluginServerRule.url("/even.jar"));
+            put("6999_Plugin-Url", "345;" + pluginServerRule.url("/bother.jar"));
         }};
         final PluginServer pluginServer = new PluginServer(
Index: trunk/test/unit/org/openstreetmap/josm/testutils/PluginServer.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/testutils/PluginServer.java	(revision 17194)
+++ trunk/test/unit/org/openstreetmap/josm/testutils/PluginServer.java	(revision 17195)
@@ -139,9 +139,9 @@
         }
 
-        public String getPluginURL(Integer port) {
+        public String getPluginURL(WireMockServer wireMockServer) {
             if (this.pluginURL != null) {
                 return this.pluginURL;
-            } else if (port != null && this.getJarPathBeneathFilesDir() != null) {
-                return String.format("http://localhost:%s%s", port, this.getPluginURLPath());
+            } else if (wireMockServer != null && this.getJarPathBeneathFilesDir() != null) {
+                return wireMockServer.url(this.getPluginURLPath());
             }
             return "http://example.com" + this.getPluginURLPath();
@@ -157,9 +157,9 @@
         }
 
-        public String getRemotePluginsListSection(Integer port) {
+        public String getRemotePluginsListSection(WireMockServer wireMockServer) {
             return String.format(
                 "%s.jar;%s\n%s",
                 this.getName(),
-                this.getPluginURL(port),
+                this.getPluginURL(wireMockServer),
                 this.getRemotePluginsListManifestSection()
             );
@@ -199,5 +199,5 @@
                 WireMock.aResponse().withStatus(200).withHeader("Content-Type", "text/plain").withBody(
                     this.pluginList.stream().map(
-                        remotePlugin -> remotePlugin.getRemotePluginsListSection(wireMockServer.port())
+                        remotePlugin -> remotePlugin.getRemotePluginsListSection(wireMockServer)
                     ).collect(Collectors.joining())
                 )
Index: trunk/test/unit/org/openstreetmap/josm/testutils/TileSourceRule.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/testutils/TileSourceRule.java	(revision 17194)
+++ trunk/test/unit/org/openstreetmap/josm/testutils/TileSourceRule.java	(revision 17195)
@@ -243,5 +243,5 @@
                     // to the mock server seems to prompt it to start earlier (though this request itself is not
                     // expected to succeed). see https://github.com/tomakehurst/wiremock/issues/97
-                    (new java.net.URL(String.format("http://localhost:%d/_poke", TileSourceRule.this.port()))).getContent();
+                    new java.net.URL(TileSourceRule.this.url("/_poke")).getContent();
                 } catch (IOException e) {
                     Logging.trace(e);
Index: trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportSenderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportSenderTest.java	(revision 17194)
+++ trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportSenderTest.java	(revision 17195)
@@ -78,5 +78,5 @@
         List<URI> calledURIs = OpenBrowserMocker.getCalledURIs();
         assertEquals(1, calledURIs.size());
-        assertEquals(wireMockRule.baseUrl() + "/josmticket?pdata_stored=6bccff5c0417217bfbbe5fff", calledURIs.get(0).toString());
+        assertEquals(wireMockRule.url("/josmticket?pdata_stored=6bccff5c0417217bfbbe5fff"), calledURIs.get(0).toString());
     }
 }
