Index: trunk/test/unit/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSourceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSourceTest.java	(revision 18376)
+++ trunk/test/unit/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSourceTest.java	(revision 18381)
@@ -237,5 +237,7 @@
             IllegalArgumentException exception = assertThrows(IllegalArgumentException.class,
                             () -> new TemplatedWMSTileSource(testImageryWMS, projection));
-            assertEquals(tr("Could not retrieve API key for imagery with id={0}. Cannot add layer.", testImageryWMS.getId()),
+            assertEquals(tr("Could not retrieve API key for imagery with id={0}. Cannot add layer.\n"
+                            + "API key for imagery with id=TemplatedWMSTileSourceTest#testApiKeyInvalid may not be available.",
+                            testImageryWMS.getId()),
                     exception.getMessage());
         } finally {
Index: trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java	(revision 18376)
+++ trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java	(revision 18381)
@@ -472,9 +472,11 @@
             testImageryWMTS.setUrl(testImageryWMTS.getUrl().replace(TestUtils.getTestDataRoot(), "{apikey}"));
             assertTrue(testImageryWMTS.getUrl().contains("{apikey}"));
-            testImageryWMTS.setId("TemplatedWMSTileSourceTest#testApiKeyInvalid");
+            testImageryWMTS.setId("WMTSTileSourceTest#testApiKeyInvalid");
             org.openstreetmap.josm.data.projection.Projection projection = Projections.getProjectionByCode("EPSG:4326");
             IllegalArgumentException exception = assertThrows(IllegalArgumentException.class,
                             () -> new WMTSTileSource(testImageryWMTS, projection));
-            assertEquals(tr("Could not retrieve API key for imagery with id={0}. Cannot add layer.", testImageryWMTS.getId()),
+            assertEquals(tr("Could not retrieve API key for imagery with id={0}. Cannot add layer.\n" +
+                            "API key for imagery with id=WMTSTileSourceTest#testApiKeyInvalid may not be available.",
+                            testImageryWMTS.getId()),
                     exception.getMessage());
         } finally {
