From e6cd7444597cd72964970218de86da31bc1c8579 Mon Sep 17 00:00:00 2001 From: Richard Treier Date: Fri, 11 Oct 2024 16:35:13 +0200 Subject: [PATCH] split putAll into put and addParameterResolver --- .../edc/extension/e2e/junit/CeE2eTestExtension.java | 6 ++++-- .../extension/e2e/junit/CeIntegrationTestExtension.java | 9 ++++----- .../extension/e2e/junit/utils/InstancesForJunitTest.java | 3 +-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/utils/test-utils/src/main/java/de/sovity/edc/extension/e2e/junit/CeE2eTestExtension.java b/utils/test-utils/src/main/java/de/sovity/edc/extension/e2e/junit/CeE2eTestExtension.java index bed0f0126..3d0eedb1f 100644 --- a/utils/test-utils/src/main/java/de/sovity/edc/extension/e2e/junit/CeE2eTestExtension.java +++ b/utils/test-utils/src/main/java/de/sovity/edc/extension/e2e/junit/CeE2eTestExtension.java @@ -73,7 +73,8 @@ public class CeE2eTestExtension @Override public void beforeAll(ExtensionContext context) throws Exception { - instances.putAll(instancesForEachConnector); + instances.put(instancesForEachConnector); + instances.addParameterResolver(instancesForEachConnector); for (CeE2eTestSide side : CeE2eTestSide.values()) { var extension = CeIntegrationTestExtension.builder() @@ -91,7 +92,8 @@ public void beforeAll(ExtensionContext context) throws Exception { .build(); // Register DbRuntimePerClassExtension - instancesForEachConnector.forSide(side).putAll(extension); + instancesForEachConnector.forSide(side).put(extension); + instancesForEachConnector.forSide(side).addParameterResolver(extension); // Start EDC extension.beforeAll(context); diff --git a/utils/test-utils/src/main/java/de/sovity/edc/extension/e2e/junit/CeIntegrationTestExtension.java b/utils/test-utils/src/main/java/de/sovity/edc/extension/e2e/junit/CeIntegrationTestExtension.java index 5d21ed40e..4572557be 100644 --- a/utils/test-utils/src/main/java/de/sovity/edc/extension/e2e/junit/CeIntegrationTestExtension.java +++ b/utils/test-utils/src/main/java/de/sovity/edc/extension/e2e/junit/CeIntegrationTestExtension.java @@ -24,15 +24,12 @@ import de.sovity.edc.extension.e2e.junit.edc.RuntimePerClassExtensionFixed; import de.sovity.edc.extension.e2e.junit.utils.InstancesForJunitTest; import de.sovity.edc.utils.config.ConfigProps; -import de.sovity.edc.utils.config.utils.ReflectionUtils; import lombok.AccessLevel; import lombok.Builder; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Singular; import lombok.experimental.Delegate; -import org.eclipse.edc.spi.monitor.ConsoleMonitor; -import org.eclipse.edc.spi.system.ServiceExtensionContext; import org.jetbrains.annotations.Nullable; import org.junit.jupiter.api.extension.AfterAllCallback; import org.junit.jupiter.api.extension.BeforeAllCallback; @@ -75,7 +72,8 @@ public void beforeAll(ExtensionContext extensionContext) throws Exception { // Start DB if (!skipDb) { var dbExtension = TestDatabaseExtension.builder().build(); - instances.putAll(dbExtension); + instances.put(dbExtension); + instances.addParameterResolver(dbExtension); dbExtension.beforeAll(extensionContext); } @@ -93,7 +91,8 @@ public void beforeAll(ExtensionContext extensionContext) throws Exception { beforeEdcStartup.accept(connectorExtension); connectorExtension.beforeAll(extensionContext); - instances.putAll(connectorExtension); + instances.put(connectorExtension); + instances.addParameterResolver(connectorExtension); // Configure Clients and Utilities var config = runtime.getContext().getConfig(); diff --git a/utils/test-utils/src/main/java/de/sovity/edc/extension/e2e/junit/utils/InstancesForJunitTest.java b/utils/test-utils/src/main/java/de/sovity/edc/extension/e2e/junit/utils/InstancesForJunitTest.java index 37ecfa547..e6ca5fe3f 100644 --- a/utils/test-utils/src/main/java/de/sovity/edc/extension/e2e/junit/utils/InstancesForJunitTest.java +++ b/utils/test-utils/src/main/java/de/sovity/edc/extension/e2e/junit/utils/InstancesForJunitTest.java @@ -37,8 +37,7 @@ public class InstancesForJunitTest implements ParameterResolver { private final Map, LazyOrValue> instances = new HashMap<>(); private final List childResolvers = new ArrayList<>(); - public void putAll(ParameterResolver resolver) { - put(resolver); + public void addParameterResolver(ParameterResolver resolver) { childResolvers.add(resolver); }