Index: /trunk/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/MVTTileTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/MVTTileTest.java	(revision 18891)
+++ /trunk/test/unit/org/openstreetmap/josm/data/imagery/vectortile/mapbox/MVTTileTest.java	(revision 18892)
@@ -9,6 +9,9 @@
 import java.util.stream.Stream;
 
+import org.apache.commons.jcs3.access.behavior.ICacheAccess;
 import org.awaitility.Awaitility;
 import org.awaitility.Durations;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.params.ParameterizedTest;
@@ -18,4 +21,5 @@
 import org.openstreetmap.gui.jmapviewer.interfaces.TileJob;
 import org.openstreetmap.josm.TestUtils;
+import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry;
 import org.openstreetmap.josm.data.cache.JCSCacheManager;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
@@ -26,13 +30,26 @@
  */
 class MVTTileTest {
+    private static ICacheAccess<String, BufferedImageCacheEntry> cache;
     private MapboxVectorTileSource tileSource;
     private MapboxVectorCachedTileLoader loader;
+
+    @BeforeAll
+    static void classSetup() {
+        cache = JCSCacheManager.getCache("testMapillaryCache");
+    }
+
+    @AfterAll
+    static void classTearDown() {
+        cache.clear();
+        cache = null;
+    }
+
     @BeforeEach
     void setup() {
+        cache.clear();
         tileSource = new MapboxVectorTileSource(new ImageryInfo("Test Mapillary", "file:/" + TestUtils.getTestDataRoot()
           + "pbf/mapillary/{z}/{x}/{y}.mvt"));
-        loader = new MapboxVectorCachedTileLoader(null,
-          JCSCacheManager.getCache("testMapillaryCache"), new TileJobOptions(1, 1, Collections
-          .emptyMap(), 3600));
+        final TileJobOptions options = new TileJobOptions(1, 1, Collections.emptyMap(), 3600);
+        loader = new MapboxVectorCachedTileLoader(null, cache, options);
     }
 
@@ -58,8 +75,9 @@
 
         TileJob job = loader.createTileLoaderJob(tile);
-        job.submit();
+        // Ensure that we are not getting a cached tile
+        job.submit(true);
         Awaitility.await().atMost(Durations.ONE_SECOND).until(tile::isLoaded);
         if (isLoaded) {
-            Awaitility.await().atMost(Durations.ONE_SECOND).until(() -> tile.getLayers() != null && tile.getLayers().size() > 1);
+            Awaitility.await().atMost(Durations.ONE_SECOND).until(() -> tile.getImage() == MVTTile.CLEAR_LOADED);
             assertEquals(2, tile.getLayers().size());
             assertEquals(4096, tile.getExtent());
