From 215defae89e25b64434148e5d30bcd0b9f8e1d52 Mon Sep 17 00:00:00 2001 From: Enrico Risa Date: Fri, 17 Jan 2025 10:04:59 +0100 Subject: [PATCH] chore: fix compatibility tests + EDC version bump --- gradle/libs.stable.versions.toml | 2 +- gradle/libs.versions.toml | 2 +- .../tests/fixtures/BaseParticipant.java | 6 +++--- .../tests/fixtures/LocalParticipant.java | 16 +++++++-------- .../tests/fixtures/RemoteParticipant.java | 20 ++++++++----------- 5 files changed, 20 insertions(+), 26 deletions(-) diff --git a/gradle/libs.stable.versions.toml b/gradle/libs.stable.versions.toml index e756848..8fad73c 100644 --- a/gradle/libs.stable.versions.toml +++ b/gradle/libs.stable.versions.toml @@ -2,7 +2,7 @@ format.version = "1.1" [versions] -edc = "0.10.1" +edc = "0.11.0" postgres = "42.7.4" # add here diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 225105c..420367d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ format.version = "1.1" [versions] -edc = "0.11.0-SNAPSHOT" +edc = "0.12.0-SNAPSHOT" postgres = "42.7.4" jakarta-json = "2.1.3" jackson = "2.18.2" diff --git a/tests/compatibility-tests/src/test/java/org/eclipse/edc/compatibility/tests/fixtures/BaseParticipant.java b/tests/compatibility-tests/src/test/java/org/eclipse/edc/compatibility/tests/fixtures/BaseParticipant.java index 78206bc..c2fbea4 100644 --- a/tests/compatibility-tests/src/test/java/org/eclipse/edc/compatibility/tests/fixtures/BaseParticipant.java +++ b/tests/compatibility-tests/src/test/java/org/eclipse/edc/compatibility/tests/fixtures/BaseParticipant.java @@ -77,7 +77,7 @@ public void pullData(DataAddress edr, Map queryParams, ThrowingC public void waitForDataPlane() { await().atMost(timeout) .untilAsserted(() -> { - var jp = managementEndpoint.baseRequest() + var jp = baseManagementRequest() .get("/v3/dataplanes") .then() .statusCode(200) @@ -97,7 +97,7 @@ public void waitForDataPlane() { * @return The cached {@link DataAddress} */ public DataAddress getEdr(String transferProcessId) { - var dataAddressRaw = managementEndpoint.baseRequest() + var dataAddressRaw = baseManagementRequest() .contentType(JSON) .when() .get("/v3/edrs/{id}/dataaddress", transferProcessId) @@ -127,6 +127,6 @@ public static class Builder

controlPlaneConfiguration() { put("edc.api.auth.key", API_KEY); put("web.http.port", String.valueOf(controlPlaneDefault.getPort())); put("web.http.path", "/api"); - put("web.http.protocol.port", String.valueOf(protocolEndpoint.getUrl().getPort())); - put("web.http.protocol.path", protocolEndpoint.getUrl().getPath()); - put("web.http.management.port", String.valueOf(managementEndpoint.getUrl().getPort())); - put("web.http.management.path", managementEndpoint.getUrl().getPath()); + put("web.http.protocol.port", String.valueOf(controlPlaneProtocol.get().getPort())); + put("web.http.protocol.path", controlPlaneProtocol.get().getPath()); + put("web.http.management.port", String.valueOf(controlPlaneManagement.get().getPort())); + put("web.http.management.path", controlPlaneManagement.get().getPath()); put("web.http.version.port", String.valueOf(controlPlaneVersion.getPort())); put("web.http.version.path", controlPlaneVersion.getPath()); put("web.http.control.port", String.valueOf(controlPlaneControl.getPort())); put("web.http.control.path", controlPlaneControl.getPath()); - put("edc.dsp.callback.address", protocolEndpoint.getUrl().toString()); + put("edc.dsp.callback.address", controlPlaneProtocol.get().toString()); put("edc.transfer.proxy.endpoint", dataPlanePublic.toString()); put("edc.transfer.send.retry.limit", "1"); put("edc.transfer.send.retry.base-delay.ms", "100"); @@ -110,10 +109,9 @@ public static Builder newInstance() { @Override public LocalParticipant build() { - var headers = Map.of("x-api-key", API_KEY); - super.managementEndpoint(new Endpoint(URI.create("http://localhost:" + getFreePort() + "/api/management"), headers)); - super.protocolEndpoint(new Endpoint(URI.create("http://localhost:" + getFreePort() + "/protocol"))); super.build(); + var headers = Map.of("x-api-key", API_KEY); + participant.enrichManagementRequest = req -> req.headers(headers); return participant; } } diff --git a/tests/compatibility-tests/src/test/java/org/eclipse/edc/compatibility/tests/fixtures/RemoteParticipant.java b/tests/compatibility-tests/src/test/java/org/eclipse/edc/compatibility/tests/fixtures/RemoteParticipant.java index 55b6b9b..01c7d52 100644 --- a/tests/compatibility-tests/src/test/java/org/eclipse/edc/compatibility/tests/fixtures/RemoteParticipant.java +++ b/tests/compatibility-tests/src/test/java/org/eclipse/edc/compatibility/tests/fixtures/RemoteParticipant.java @@ -14,12 +14,9 @@ package org.eclipse.edc.compatibility.tests.fixtures; -import java.net.URI; import java.util.HashMap; import java.util.Map; -import static org.eclipse.edc.util.io.Ports.getFreePort; - public class RemoteParticipant extends BaseParticipant { private static final String API_KEY = "password"; @@ -31,15 +28,15 @@ public Map controlPlaneEnv() { put("EDC_API_AUTH_KEY", API_KEY); put("WEB_HTTP_PORT", String.valueOf(controlPlaneDefault.getPort())); put("WEB_HTTP_PATH", "/api"); - put("WEB_HTTP_PROTOCOL_PORT", String.valueOf(protocolEndpoint.getUrl().getPort())); - put("WEB_HTTP_PROTOCOL_PATH", protocolEndpoint.getUrl().getPath()); - put("WEB_HTTP_MANAGEMENT_PORT", String.valueOf(managementEndpoint.getUrl().getPort())); - put("WEB_HTTP_MANAGEMENT_PATH", managementEndpoint.getUrl().getPath()); + put("WEB_HTTP_PROTOCOL_PORT", String.valueOf(controlPlaneProtocol.get().getPort())); + put("WEB_HTTP_PROTOCOL_PATH", controlPlaneProtocol.get().getPath()); + put("WEB_HTTP_MANAGEMENT_PORT", String.valueOf(controlPlaneManagement.get().getPort())); + put("WEB_HTTP_MANAGEMENT_PATH", controlPlaneManagement.get().getPath()); put("WEB_HTTP_VERSION_PORT", String.valueOf(controlPlaneVersion.getPort())); put("WEB_HTTP_VERSION_PATH", controlPlaneVersion.getPath()); put("WEB_HTTP_CONTROL_PORT", String.valueOf(controlPlaneControl.getPort())); put("WEB_HTTP_CONTROL_PATH", controlPlaneControl.getPath()); - put("EDC_DSP_CALLBACK_ADDRESS", protocolEndpoint.getUrl().toString()); + put("EDC_DSP_CALLBACK_ADDRESS", controlPlaneProtocol.get().toString()); put("EDC_DATASOURCE_DEFAULT_URL", "jdbc:postgresql://localhost:5432/%s".formatted(getId())); put("EDC_DATASOURCE_DEFAULT_USER", "postgres"); put("EDC_DATASOURCE_DEFAULT_PASSWORD", "password"); @@ -85,13 +82,12 @@ protected Builder() { public static Builder newInstance() { return new Builder(); } - + @Override public RemoteParticipant build() { - var headers = Map.of("x-api-key", API_KEY); - super.managementEndpoint(new Endpoint(URI.create("http://localhost:" + getFreePort() + "/api/management"), headers)); - super.protocolEndpoint(new Endpoint(URI.create("http://localhost:" + getFreePort() + "/protocol"))); super.build(); + var headers = Map.of("x-api-key", API_KEY); + participant.enrichManagementRequest = req -> req.headers(headers); return participant; } }