Skip to content

Commit

Permalink
wait for DP to be available
Browse files Browse the repository at this point in the history
  • Loading branch information
paullatzelsperger committed Jul 18, 2024
1 parent 555366f commit 6fbeee2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down Expand Up @@ -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"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 6fbeee2

Please sign in to comment.