Skip to content

Commit

Permalink
split putAll into put and addParameterResolver
Browse files Browse the repository at this point in the history
  • Loading branch information
richardtreier committed Oct 11, 2024
1 parent 6b49167 commit e6cd744
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ public class InstancesForJunitTest implements ParameterResolver {
private final Map<Class<?>, LazyOrValue> instances = new HashMap<>();
private final List<ParameterResolver> childResolvers = new ArrayList<>();

public void putAll(ParameterResolver resolver) {
put(resolver);
public void addParameterResolver(ParameterResolver resolver) {
childResolvers.add(resolver);
}

Expand Down

0 comments on commit e6cd744

Please sign in to comment.