Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java	(revision 14550)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java	(revision 14551)
@@ -2,4 +2,5 @@
 package org.openstreetmap.josm.gui.preferences.imagery;
 
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
@@ -63,4 +64,7 @@
 public class ImageryPreferenceTestIT {
 
+    private static final LatLon GREENWICH = new LatLon(51.47810, -0.00170);
+    private static final int DEFAULT_ZOOM = 12;
+
     /**
      * Setup rule
@@ -133,5 +137,5 @@
     }
 
-    private void checkTileUrl(ImageryInfo info, AbstractTileSource tileSource, ICoordinate center, int zoom)
+    private boolean checkTileUrl(ImageryInfo info, AbstractTileSource tileSource, ICoordinate center, int zoom)
             throws IOException {
         TileXY xy = tileSource.latLonToTileXY(center, zoom);
@@ -142,12 +146,15 @@
                     try (ByteArrayInputStream bais = new ByteArrayInputStream(data)) {
                         if (ImageIO.read(bais) == null) {
-                            addImageError(info, url, data, "did not return an image");
+                            addImageError(info, url, data, zoom, "did not return an image");
                         }
                     } catch (IOException e) {
-                        addImageError(info, url, data, e.toString());
+                        addImageError(info, url, data, zoom, e.toString());
                         Logging.trace(e);
                     }
                 });
-                return;
+                // Determines if this is a success (no error message with current zoom marker)
+                return errors.getOrDefault(info.getCountryCode(), Collections.emptyMap())
+                              .getOrDefault(info, Collections.emptyList())
+                              .stream().noneMatch(e -> e.contains(zoomMarker(zoom)));
             } catch (IOException e) {
                 // Try up to three times max to allow Bing source to initialize itself
@@ -164,10 +171,15 @@
             }
         }
-    }
-
-    private void addImageError(ImageryInfo info, String url, byte[] data, String defaultMessage) {
+        return false;
+    }
+
+    private static String zoomMarker(int zoom) {
+        return " -> zoom " + zoom + " -> ";
+    }
+
+    private void addImageError(ImageryInfo info, String url, byte[] data, int zoom, String defaultMessage) {
         // Check if we have received an error message
         String error = helper.detectErrorMessage(new String(data, StandardCharsets.UTF_8));
-        addError(info, url + " -> " + (error != null ? error.split("\\n")[0] : defaultMessage));
+        addError(info, url + zoomMarker(zoom) + (error != null ? error.split("\\n")[0] : defaultMessage));
     }
 
@@ -241,10 +253,16 @@
             ImageryBounds bounds = info.getBounds();
             // Some imagery sources do not define tiles at (0,0). So pickup Greenwich Royal Observatory for global sources
-            ICoordinate center = CoordinateConversion.llToCoor(bounds != null ? getCenter(bounds) : new LatLon(51.47810, -0.00170));
+            ICoordinate center = CoordinateConversion.llToCoor(bounds != null ? getCenter(bounds) : GREENWICH);
             AbstractTileSource tileSource = getTileSource(info);
-            checkTileUrl(info, tileSource, center, info.getMinZoom());
+            // test min zoom and try to detect the correct value in case of error
+            int maxZoom = info.getMaxZoom() > 0 ? Math.min(DEFAULT_ZOOM, info.getMaxZoom()) : DEFAULT_ZOOM;
+            for (int zoom = info.getMinZoom(); zoom < maxZoom; zoom++) {
+                if (checkTileUrl(info, tileSource, center, zoom)) {
+                    break;
+                }
+            }
             // checking max zoom for real is complex, see https://josm.openstreetmap.de/ticket/16073#comment:27
             if (info.getMaxZoom() > 0 && info.getImageryType() != ImageryType.SCANEX) {
-                checkTileUrl(info, tileSource, center, Utils.clamp(12, info.getMinZoom() + 1, info.getMaxZoom()));
+                checkTileUrl(info, tileSource, center, Utils.clamp(DEFAULT_ZOOM, info.getMinZoom() + 1, info.getMaxZoom()));
             }
         } catch (IOException | RuntimeException | WMSGetCapabilitiesException | WMTSGetCapabilitiesException e) {
@@ -314,4 +332,5 @@
         assertTrue(errors.toString().replaceAll("\\}, ", "\n\\}, ").replaceAll(", ImageryInfo\\{", "\n      ,ImageryInfo\\{"),
                 errors.isEmpty());
+        assertFalse(workingURLs.isEmpty());
     }
 }
