Index: /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackActionTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackActionTest.java	(revision 14065)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackActionTest.java	(revision 14066)
@@ -16,4 +16,5 @@
 import org.openstreetmap.josm.gui.layer.gpx.DownloadWmsAlongTrackAction.PrecacheWmsTask;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.TileSourceRule;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@@ -29,5 +30,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().main().projection().timeout(20000);
+    public JOSMTestRules test = new JOSMTestRules().platform().main().projection().fakeImagery().timeout(20000);
 
     /**
@@ -45,6 +46,9 @@
     @Test
     public void testTMSLayer() throws Exception {
-        // Create new TMS layer and clear cache
-        TMSLayer layer = new TMSLayer(new ImageryInfo("OSM TMS", "https://a.tile.openstreetmap.org/{zoom}/{x}/{y}.png", "tms", null, null));
+        final TileSourceRule tileSourceRule = this.test.getTileSourceRule();
+
+        TMSLayer layer = new TMSLayer(
+            tileSourceRule.getSourcesList().get(0).getImageryInfo(tileSourceRule.port())
+        );
         try {
             MainApplication.getLayerManager().addLayer(layer);
Index: /trunk/test/unit/org/openstreetmap/josm/testutils/TileSourceRule.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/testutils/TileSourceRule.java	(revision 14065)
+++ /trunk/test/unit/org/openstreetmap/josm/testutils/TileSourceRule.java	(revision 14066)
@@ -214,4 +214,13 @@
             this.stubFor(source.getMappingBuilder().willReturn(source.getResponseDefinitionBuilder()));
         }
+    }
+
+    /**
+     * Get the tile sources served by this TileSourceRule.
+     *
+     * @return an unmodifiable list of the tile sources served by this TileSourceRule
+     */
+    public List<ConstSource> getSourcesList() {
+        return Collections.unmodifiableList(this.sourcesList);
     }
 
