From a3c38aca579ff2807050dbe4367551f320794c9e Mon Sep 17 00:00:00 2001 From: "taylor.smock" Date: Wed, 19 Jun 2024 18:17:08 +0000 Subject: [PATCH] See #23743: MinimapDialogTest was failing This re-adds parameter resolution for DownloadWmsAlongTrackActionTest git-svn-id: https://josm.openstreetmap.de/svn/trunk@19118 0c6e7542-c601-0410-84e7-c038aed88b3b --- .../testutils/annotations/FakeImagery.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/unit/org/openstreetmap/josm/testutils/annotations/FakeImagery.java b/test/unit/org/openstreetmap/josm/testutils/annotations/FakeImagery.java index 9d185236431..bc154102749 100644 --- a/test/unit/org/openstreetmap/josm/testutils/annotations/FakeImagery.java +++ b/test/unit/org/openstreetmap/josm/testutils/annotations/FakeImagery.java @@ -16,6 +16,8 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.ParameterContext; +import org.junit.jupiter.api.extension.ParameterResolutionException; import org.openstreetmap.josm.data.imagery.ImageryInfo; import org.openstreetmap.josm.data.imagery.ImageryLayerInfo; import org.openstreetmap.josm.gui.bbox.JosmMapViewer; @@ -125,6 +127,24 @@ protected void onAfterEach(ExtensionContext extensionContext, WireMockRuntimeInf } } + @Override + public boolean supportsParameter(ParameterContext parameterContext, ExtensionContext extensionContext) + throws ParameterResolutionException { + if (parameterContext.getParameter().getType().equals(FakeImageryWireMockExtension.class)) { + return true; + } + return super.supportsParameter(parameterContext, extensionContext); + } + + @Override + public Object resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext) + throws ParameterResolutionException { + if (parameterContext.getParameter().getType().equals(FakeImageryWireMockExtension.class)) { + return this; + } + return super.resolveParameter(parameterContext, extensionContext); + } + private void registerLayers(ExtensionContext.Store store, WireMockRuntimeInfo wireMockRuntimeInfo) { if (this.clearSlippyMapSources) { try {