From 6fbeee2ec4758bd76ec7039134e9d2f2d87c5fa5 Mon Sep 17 00:00:00 2001 From: Paul Latzelsperger Date: Thu, 18 Jul 2024 09:36:23 +0200 Subject: [PATCH] wait for DP to be available --- gradle/libs.versions.toml | 3 ++- .../tests/transfer/TransferEndToEndTest.java | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 316bbcb2..60f9b452 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -45,6 +45,7 @@ edc-api-management-asset = { module = "org.eclipse.edc:asset-api", version.ref = edc-api-management-edr = { module = "org.eclipse.edc:edr-cache-api", version.ref = "edc" } edc-api-management-policy = { module = "org.eclipse.edc:policy-definition-api", version.ref = "edc" } edc-api-management-contractdef = { module = "org.eclipse.edc:contract-definition-api", version.ref = "edc" } +edc-api-management-dataplaneselector = { module = "org.eclipse.edc:data-plane-selector-api", version.ref = "edc" } edc-api-observability = { module = "org.eclipse.edc:api-observability", version.ref = "edc" } edc-api-control-configuration = { module = "org.eclipse.edc:control-api-configuration", version.ref = "edc" } edc-dsp = { module = "org.eclipse.edc:dsp", version.ref = "edc" } @@ -163,7 +164,7 @@ dpf = ["edc-dpf-selector-core", "edc-spi-dataplane-selector", "edc-dpf-selector- connector = ["edc-boot", "edc-core-connector", "edc-ext-http", "edc-ext-observability", "edc-ext-jsonld"] -controlplane = ["edc-controlplane-core", "edc-config-filesystem", "edc-auth-tokenbased", "edc-auth-configuration", "edc-api-management", "edc-api-management-config","edc-api-management-edr", +controlplane = ["edc-controlplane-core", "edc-config-filesystem", "edc-auth-tokenbased", "edc-auth-configuration", "edc-api-management", "edc-api-management-config","edc-api-management-edr","edc-api-management-dataplaneselector", "edc-api-observability", "edc-dsp", "edc-spi-jwt", "edc-ext-http", "edc-controlplane-callback-dispatcher-event", "edc-controlplane-callback-dispatcher-http", "edc-identity-core-did", "edc-dcp-core", "edc-identity-trust-transform", "edc-api-control-configuration", "edc-lib-transform", "edc-identity-vc-ldp", "edc-did-web", "edc-lib-jws2020", "edc-core-edrstore", "edc-edr-storereceiver"] diff --git a/tests/end2end/src/test/java/org/eclipse/edc/demo/tests/transfer/TransferEndToEndTest.java b/tests/end2end/src/test/java/org/eclipse/edc/demo/tests/transfer/TransferEndToEndTest.java index a5186a22..eb8d09b7 100644 --- a/tests/end2end/src/test/java/org/eclipse/edc/demo/tests/transfer/TransferEndToEndTest.java +++ b/tests/end2end/src/test/java/org/eclipse/edc/demo/tests/transfer/TransferEndToEndTest.java @@ -61,6 +61,7 @@ public class TransferEndToEndTest { private static final String PROVIDER_ID = "did:web:provider-identityhub%3A7083:provider"; // public API endpoint of the provider-qna connector, goes through the ingress controller private static final String PROVIDER_PUBLIC_URL = "http://127.0.0.1/provider-qna/public"; + private static final String PROVIDER_MANAGEMENT_URL = "http://127.0.0.1/provider-qna/cp"; private static final Duration TEST_TIMEOUT_DURATION = Duration.ofSeconds(120); private static final Duration TEST_POLL_DELAY = Duration.ofSeconds(2); @@ -163,6 +164,21 @@ void transferData() { }); + // wait until provider's dataplane is available + await().atMost(TEST_TIMEOUT_DURATION) + .pollDelay(TEST_POLL_DELAY) + .untilAsserted(() -> { + var jp= baseRequest() + .get(PROVIDER_MANAGEMENT_URL + "/api/management/v3/dataplanes") + .then() + .statusCode(200) + .log().ifValidationFails() + .extract().body().jsonPath(); + + var state = jp.getString("state"); + assertThat(state).contains("AVAILABLE"); + }); + //start transfer process var tpRequest = TestUtils.getResourceFileContentAsString("transfer-request.json") .replace("{{PROVIDER_ID}}", PROVIDER_ID)