- Timestamp:
- 2020-10-13T22:31:09+02:00 (4 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java
r14138 r17195 82 82 .withStatus(404))); 83 83 84 new AddImageryLayerAction(new ImageryInfo("localhost", "http://localhost:" +wireMockRule.port() +"/wms?",84 new AddImageryLayerAction(new ImageryInfo("localhost", wireMockRule.url("/wms?"), 85 85 "wms_endpoint", null, null)).actionPerformed(null); 86 86 List<WMSLayer> wmsLayers = MainApplication.getLayerManager().getLayersOfType(WMSLayer.class); -
trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTaskTestParent.java
r13300 r17195 53 53 */ 54 54 protected final String getRemoteFileUrl() { 55 return "http://localhost:" +wireMockRule.port() + "/" +getRemoteFile();55 return wireMockRule.url(getRemoteFile()); 56 56 } 57 57 -
trunk/test/unit/org/openstreetmap/josm/data/osm/DefaultNameFormatterTest.java
r16952 r17195 63 63 .withHeader("Content-Type", "text/xml") 64 64 .withBodyFile(source))); 65 TaggingPresets.addTaggingPresets(TaggingPresetReader.readAll( "http://localhost:" +wireMockRule.port() + "/" + source, true));65 TaggingPresets.addTaggingPresets(TaggingPresetReader.readAll(wireMockRule.url(source), true)); 66 66 67 67 Comparator<IRelation<?>> comparator = DefaultNameFormatter.getInstance().getRelationComparator(); -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceHighLevelTest.java
r16161 r17195 88 88 Config.getPref().put("pluginmanager.lastupdate", "999"); 89 89 Config.getPref().putList("pluginmanager.sites", 90 Collections.singletonList( String.format("http://localhost:%s/plugins",this.pluginServerRule.port()))90 Collections.singletonList(this.pluginServerRule.url("/plugins")) 91 91 ); 92 92 … … 835 835 new PluginServer.RemotePlugin(this.referenceDummyJarNew), 836 836 new PluginServer.RemotePlugin(this.referenceBazJarNew, Collections.singletonMap( 837 "6800_Plugin-Url", "6; http://localhost:" + this.pluginServerRule.port() +bazOldServePath837 "6800_Plugin-Url", "6;" + this.pluginServerRule.url(bazOldServePath) 838 838 )) 839 839 ); -
trunk/test/unit/org/openstreetmap/josm/io/OverpassDownloadReaderTest.java
r16358 r17195 55 55 @Before 56 56 public void setUp() { 57 NameFinder.NOMINATIM_URL_PROP.put( "http://localhost:" +wireMockRule.port() +NOMINATIM_URL_PATH);57 NameFinder.NOMINATIM_URL_PROP.put(wireMockRule.url(NOMINATIM_URL_PATH)); 58 58 } 59 59 -
trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerJOSMTooOldTest.java
r17089 r17195 64 64 Config.getPref().put("pluginmanager.lastupdate", "999"); 65 65 Config.getPref().putList("pluginmanager.sites", 66 Collections.singletonList( String.format("http://localhost:%s/plugins",this.pluginServerRule.port()))66 Collections.singletonList(this.pluginServerRule.url("/plugins")) 67 67 ); 68 68 … … 310 310 new PluginServer.RemotePlugin(this.referenceBazJarOld), 311 311 new PluginServer.RemotePlugin(this.referenceQuxJarNewer, Collections.singletonMap( 312 "7499_Plugin-Url", "346; http://localhost:" + this.pluginServerRule.port() +"/dont/bother.jar"312 "7499_Plugin-Url", "346;" + this.pluginServerRule.url("/dont/bother.jar") 313 313 )) 314 314 ); -
trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerMultiVersionTest.java
r16161 r17195 60 60 Config.getPref().put("pluginmanager.lastupdate", "999"); 61 61 Config.getPref().putList("pluginmanager.sites", 62 Collections.singletonList( String.format("http://localhost:%s/plugins",this.pluginServerRule.port()))62 Collections.singletonList(this.pluginServerRule.url("/plugins")) 63 63 ); 64 64 … … 101 101 final String quxNewerServePath = "/qux/newer.jar"; 102 102 final Map<String, String> attrOverrides = new HashMap<String, String>() {{ 103 put("7500_Plugin-Url", "432; http://localhost:" + pluginServerRule.port() +quxNewerServePath);104 put("7499_Plugin-Url", "346; http://localhost:" + pluginServerRule.port() +"/not/served.jar");105 put("6999_Plugin-Url", "345; http://localhost:" + pluginServerRule.port() +"/not/served/eithejar");103 put("7500_Plugin-Url", "432;" + pluginServerRule.url(quxNewerServePath)); 104 put("7499_Plugin-Url", "346;" + pluginServerRule.url("/not/served.jar")); 105 put("6999_Plugin-Url", "345;" + pluginServerRule.url("/not/served/eithejar")); 106 106 }}; 107 107 final PluginServer pluginServer = new PluginServer( … … 167 167 168 168 final Map<String, String> attrOverrides = new HashMap<String, String>() {{ 169 put("7500_Plugin-Url", "432; http://localhost:" + pluginServerRule.port() +"/dont.jar");170 put("7499_Plugin-Url", "346; http://localhost:" + pluginServerRule.port() +"/even.jar");171 put("6999_Plugin-Url", "345; http://localhost:" + pluginServerRule.port() +"/bother.jar");169 put("7500_Plugin-Url", "432;" + pluginServerRule.url("/dont.jar")); 170 put("7499_Plugin-Url", "346;" + pluginServerRule.url("/even.jar")); 171 put("6999_Plugin-Url", "345;" + pluginServerRule.url("/bother.jar")); 172 172 }}; 173 173 final PluginServer pluginServer = new PluginServer( -
trunk/test/unit/org/openstreetmap/josm/testutils/PluginServer.java
r16161 r17195 139 139 } 140 140 141 public String getPluginURL( Integer port) {141 public String getPluginURL(WireMockServer wireMockServer) { 142 142 if (this.pluginURL != null) { 143 143 return this.pluginURL; 144 } else if ( port!= null && this.getJarPathBeneathFilesDir() != null) {145 return String.format("http://localhost:%s%s", port,this.getPluginURLPath());144 } else if (wireMockServer != null && this.getJarPathBeneathFilesDir() != null) { 145 return wireMockServer.url(this.getPluginURLPath()); 146 146 } 147 147 return "http://example.com" + this.getPluginURLPath(); … … 157 157 } 158 158 159 public String getRemotePluginsListSection( Integer port) {159 public String getRemotePluginsListSection(WireMockServer wireMockServer) { 160 160 return String.format( 161 161 "%s.jar;%s\n%s", 162 162 this.getName(), 163 this.getPluginURL( port),163 this.getPluginURL(wireMockServer), 164 164 this.getRemotePluginsListManifestSection() 165 165 ); … … 199 199 WireMock.aResponse().withStatus(200).withHeader("Content-Type", "text/plain").withBody( 200 200 this.pluginList.stream().map( 201 remotePlugin -> remotePlugin.getRemotePluginsListSection(wireMockServer .port())201 remotePlugin -> remotePlugin.getRemotePluginsListSection(wireMockServer) 202 202 ).collect(Collectors.joining()) 203 203 ) -
trunk/test/unit/org/openstreetmap/josm/testutils/TileSourceRule.java
r14201 r17195 243 243 // to the mock server seems to prompt it to start earlier (though this request itself is not 244 244 // expected to succeed). see https://github.com/tomakehurst/wiremock/issues/97 245 (new java.net.URL(String.format("http://localhost:%d/_poke",TileSourceRule.this.port()))).getContent();245 new java.net.URL(TileSourceRule.this.url("/_poke")).getContent(); 246 246 } catch (IOException e) { 247 247 Logging.trace(e); -
trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportSenderTest.java
r17189 r17195 78 78 List<URI> calledURIs = OpenBrowserMocker.getCalledURIs(); 79 79 assertEquals(1, calledURIs.size()); 80 assertEquals(wireMockRule. baseUrl() +"/josmticket?pdata_stored=6bccff5c0417217bfbbe5fff", calledURIs.get(0).toString());80 assertEquals(wireMockRule.url("/josmticket?pdata_stored=6bccff5c0417217bfbbe5fff"), calledURIs.get(0).toString()); 81 81 } 82 82 }
Note:
See TracChangeset
for help on using the changeset viewer.