From 69b190ee632b9d1433353b3fa7e6280769b8d04b Mon Sep 17 00:00:00 2001 From: Ronja Quensel Date: Fri, 26 Jun 2026 09:54:53 +0200 Subject: [PATCH] fix: use correct control plane endpoint for registration --- .../src/main/java/org/eclipse/dataplane/Dataplane.java | 4 ++-- .../src/test/java/org/eclipse/dataplane/DataplaneTest.java | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dataplane-sdk-core/src/main/java/org/eclipse/dataplane/Dataplane.java b/dataplane-sdk-core/src/main/java/org/eclipse/dataplane/Dataplane.java index a821e2a..0f0dfd1 100644 --- a/dataplane-sdk-core/src/main/java/org/eclipse/dataplane/Dataplane.java +++ b/dataplane-sdk-core/src/main/java/org/eclipse/dataplane/Dataplane.java @@ -329,9 +329,9 @@ public Result registerOn(String controlPlaneEndpoint) { return toJson(message) .map(body -> HttpRequest.newBuilder() - .uri(URI.create(controlPlaneEndpoint + "/dataplanes/register")) + .uri(URI.create(controlPlaneEndpoint + "/dataplanes")) .header("content-type", "application/json") - .POST(HttpRequest.BodyPublishers.ofString(body)) + .PUT(HttpRequest.BodyPublishers.ofString(body)) .build() ) .compose(request -> { diff --git a/e2e-tests/src/test/java/org/eclipse/dataplane/DataplaneTest.java b/e2e-tests/src/test/java/org/eclipse/dataplane/DataplaneTest.java index 8a288e0..d43acfa 100644 --- a/e2e-tests/src/test/java/org/eclipse/dataplane/DataplaneTest.java +++ b/e2e-tests/src/test/java/org/eclipse/dataplane/DataplaneTest.java @@ -38,6 +38,8 @@ import static com.github.tomakehurst.wiremock.client.WireMock.matchingJsonPath; import static com.github.tomakehurst.wiremock.client.WireMock.post; import static com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor; +import static com.github.tomakehurst.wiremock.client.WireMock.put; +import static com.github.tomakehurst.wiremock.client.WireMock.putRequestedFor; import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options; import static org.assertj.core.api.Assertions.assertThat; @@ -154,7 +156,7 @@ class RegisterDataplane { @Test void shouldRegisterOnTheControlPlane() { - controlPlane.stubFor(post(anyUrl()).willReturn(aResponse().withStatus(200))); + controlPlane.stubFor(put(anyUrl()).willReturn(aResponse().withStatus(200))); var dataplane = Dataplane.newInstance() .id("dataplane-id") @@ -166,7 +168,7 @@ void shouldRegisterOnTheControlPlane() { var result = dataplane.registerOn(controlPlane.baseUrl()); assertThat(result.succeeded()).isTrue(); - controlPlane.verify(postRequestedFor(urlPathEqualTo("/dataplanes/register")) + controlPlane.verify(putRequestedFor(urlPathEqualTo("/dataplanes")) .withRequestBody(and( matchingJsonPath("endpoint", equalTo("http://localhost/dataplane")), matchingJsonPath("transferTypes[0]", equalTo("SupportedTransferType-PUSH")),