Skip to content

Commit 69b190e

Browse files
committed
fix: use correct control plane endpoint for registration
1 parent eaddff4 commit 69b190e

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

dataplane-sdk-core/src/main/java/org/eclipse/dataplane/Dataplane.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,9 @@ public Result<Void> registerOn(String controlPlaneEndpoint) {
329329

330330
return toJson(message)
331331
.map(body -> HttpRequest.newBuilder()
332-
.uri(URI.create(controlPlaneEndpoint + "/dataplanes/register"))
332+
.uri(URI.create(controlPlaneEndpoint + "/dataplanes"))
333333
.header("content-type", "application/json")
334-
.POST(HttpRequest.BodyPublishers.ofString(body))
334+
.PUT(HttpRequest.BodyPublishers.ofString(body))
335335
.build()
336336
)
337337
.compose(request -> {

e2e-tests/src/test/java/org/eclipse/dataplane/DataplaneTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
import static com.github.tomakehurst.wiremock.client.WireMock.matchingJsonPath;
3939
import static com.github.tomakehurst.wiremock.client.WireMock.post;
4040
import static com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor;
41+
import static com.github.tomakehurst.wiremock.client.WireMock.put;
42+
import static com.github.tomakehurst.wiremock.client.WireMock.putRequestedFor;
4143
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
4244
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;
4345
import static org.assertj.core.api.Assertions.assertThat;
@@ -154,7 +156,7 @@ class RegisterDataplane {
154156

155157
@Test
156158
void shouldRegisterOnTheControlPlane() {
157-
controlPlane.stubFor(post(anyUrl()).willReturn(aResponse().withStatus(200)));
159+
controlPlane.stubFor(put(anyUrl()).willReturn(aResponse().withStatus(200)));
158160

159161
var dataplane = Dataplane.newInstance()
160162
.id("dataplane-id")
@@ -166,7 +168,7 @@ void shouldRegisterOnTheControlPlane() {
166168
var result = dataplane.registerOn(controlPlane.baseUrl());
167169

168170
assertThat(result.succeeded()).isTrue();
169-
controlPlane.verify(postRequestedFor(urlPathEqualTo("/dataplanes/register"))
171+
controlPlane.verify(putRequestedFor(urlPathEqualTo("/dataplanes"))
170172
.withRequestBody(and(
171173
matchingJsonPath("endpoint", equalTo("http://localhost/dataplane")),
172174
matchingJsonPath("transferTypes[0]", equalTo("SupportedTransferType-PUSH")),

0 commit comments

Comments
 (0)