From 45cd7b58eaa1efd1d6e245be44b4a7fc09343f80 Mon Sep 17 00:00:00 2001 From: Per Hermansson Date: Wed, 3 Jun 2026 16:23:46 +0200 Subject: [PATCH 1/3] fix: call DSP consumers using callbackAddress --- .../dps/system/client/DspClient.java | 10 +-- .../dps/system/client/http/HttpDspClient.java | 31 ++++++---- .../system/client/local/LocalDspClient.java | 10 +-- .../ControlPlaneSignalingPipeline.java | 61 ++++++++++--------- 4 files changed, 61 insertions(+), 51 deletions(-) diff --git a/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/DspClient.java b/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/DspClient.java index 29cbda9..1fe1b16 100644 --- a/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/DspClient.java +++ b/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/DspClient.java @@ -16,16 +16,16 @@ public interface DspClient { - String dspTransferState(String processId); + String dspTransferState(String callbackAddress, String processId); - void sendTransferStartMessage(String processId); + void sendTransferStartMessage(String callbackAddress, String processId); - void sendTransferCompletionMessage(String processId); + void sendTransferCompletionMessage(String callbackAddress, String processId); - void sendTransferTerminationMessage(String processId); + void sendTransferTerminationMessage(String callbackAddress, String processId); String sendTransferRequestMessage(String address, String agreementId, String transferType); - void sendTransferSuspensionMessage(String processId); + void sendTransferSuspensionMessage(String callbackAddress, String processId); } diff --git a/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/http/HttpDspClient.java b/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/http/HttpDspClient.java index 14edc14..dc8ba7d 100644 --- a/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/http/HttpDspClient.java +++ b/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/http/HttpDspClient.java @@ -31,22 +31,23 @@ public class HttpDspClient implements DspClient { private static final MediaType JSON = MediaType.get("application/json"); - private final String protocolUrl; + private final String initialDspUrl; private final Monitor monitor; private final OkHttpClient httpClient; private final ObjectMapper mapper; public HttpDspClient(String protocolUrl, Monitor monitor, ObjectMapper mapper) { - this.protocolUrl = protocolUrl; + this.initialDspUrl = protocolUrl; this.monitor = monitor; this.mapper = mapper; this.httpClient = new OkHttpClient(); } @Override - public String dspTransferState(String processId) { + public String dspTransferState(String callbackAddress, String processId) { try { - var url = protocolUrl + "/transfers/" + processId; + var address = callbackAddress == null ? this.initialDspUrl : callbackAddress; + var url = address + "/transfers/" + processId; var authentication = Map.of("clientId", "providerId"); var request = new Request.Builder() @@ -62,27 +63,31 @@ public String dspTransferState(String processId) { } @Override - public void sendTransferStartMessage(String processId) { + public void sendTransferStartMessage(String callbackAddress, String processId) { + var address = callbackAddress == null ? this.initialDspUrl : callbackAddress; var requestBody = message(processId, "TransferStartMessage"); - send(protocolUrl + "/transfers/" + processId + "/start", requestBody, "providerId"); + send(address + "/transfers/" + processId + "/start", requestBody, "providerId"); } @Override - public void sendTransferCompletionMessage(String processId) { + public void sendTransferCompletionMessage(String callbackAddress, String processId) { + var address = callbackAddress == null ? this.initialDspUrl : callbackAddress; var requestBody = message(processId, "TransferCompletionMessage"); - send(protocolUrl + "/transfers/" + processId + "/completion", requestBody, "providerId"); + send(address + "/transfers/" + processId + "/completion", requestBody, "providerId"); } @Override - public void sendTransferTerminationMessage(String processId) { + public void sendTransferTerminationMessage(String callbackAddress, String processId) { + var address = callbackAddress == null ? this.initialDspUrl : callbackAddress; var requestBody = message(processId, "TransferTerminationMessage"); - send(protocolUrl + "/transfers/" + processId + "/termination", requestBody, "providerId"); + send(address + "/transfers/" + processId + "/termination", requestBody, "providerId"); } @Override - public void sendTransferSuspensionMessage(String processId) { + public void sendTransferSuspensionMessage(String callbackAddress, String processId) { + var address = callbackAddress == null ? this.initialDspUrl : callbackAddress; var requestBody = message(processId, "TransferSuspensionMessage"); - send(protocolUrl + "/transfers/" + processId + "/suspension", requestBody, "providerId"); + send(address + "/transfers/" + processId + "/suspension", requestBody, "providerId"); } @Override @@ -95,7 +100,7 @@ public String sendTransferRequestMessage(String address, String agreementId, Str "agreementId", agreementId, "format", transferType ); - var response = send(protocolUrl + "/transfers/request", requestBody, "consumerId"); + var response = send(initialDspUrl + "/transfers/request", requestBody, "providerId"); return response.get("providerPid").toString(); } diff --git a/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/local/LocalDspClient.java b/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/local/LocalDspClient.java index 953e023..b35f163 100644 --- a/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/local/LocalDspClient.java +++ b/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/local/LocalDspClient.java @@ -30,22 +30,22 @@ public LocalDspClient(LocalControlPlaneConnector connector) { } @Override - public String dspTransferState(String processId) { + public String dspTransferState(String callbackAddress, String processId) { return connector.getTransferState(processId); } @Override - public void sendTransferStartMessage(String processId) { + public void sendTransferStartMessage(String callbackAddress, String processId) { connector.receiveTransferStart(processId); } @Override - public void sendTransferCompletionMessage(String processId) { + public void sendTransferCompletionMessage(String callbackAddress, String processId) { connector.receiveTransferCompletion(processId); } @Override - public void sendTransferTerminationMessage(String processId) { + public void sendTransferTerminationMessage(String callbackAddress, String processId) { connector.receiveTransferTermination(processId); } @@ -55,7 +55,7 @@ public String sendTransferRequestMessage(String address, String agreementId, Str } @Override - public void sendTransferSuspensionMessage(String processId) { + public void sendTransferSuspensionMessage(String callbackAddress, String processId) { connector.receiveTransferSuspension(processId); } diff --git a/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/pipeline/ControlPlaneSignalingPipeline.java b/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/pipeline/ControlPlaneSignalingPipeline.java index 2971a3f..e079418 100644 --- a/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/pipeline/ControlPlaneSignalingPipeline.java +++ b/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/pipeline/ControlPlaneSignalingPipeline.java @@ -68,7 +68,7 @@ public class ControlPlaneSignalingPipeline extends AbstractAsyncPipeline lastDpsReceivedMessage = new AtomicReference<>(); private final AtomicReference> lastDspReceivedMessage = new AtomicReference<>(); - private final AtomicReference counterPartyProcessId = new AtomicReference<>(); + private final AtomicReference lastCounterParty = new AtomicReference<>(); private final AtomicReference capturedProcessId = new AtomicReference<>(); private final AtomicReference lastReceivedDataFlowId = new AtomicReference<>(); private final AtomicReference lastReceivedCallbackAddress = new AtomicReference<>(); @@ -215,12 +215,12 @@ public ControlPlaneSignalingPipeline thenWaitForTransferRequestMessage() { public ControlPlaneSignalingPipeline thenWaitForTransferToBeInState(String state) { return thenWait("transfer to be in state " + state, () -> { - var id = counterPartyProcessId.get(); - if (id == null) { + var counterParty = lastCounterParty.get(); + if (counterParty == null) { throw new RuntimeException("Cannot signal completion: no actual process ID received from prepare message"); } - var actualState = dspClient.dspTransferState(id); - monitor.debug("TCK. DSP: expecting processId %s state to be %s. Actual state: %s".formatted(id, state, actualState)); + var actualState = dspClient.dspTransferState(counterParty.address(), counterParty.processId()); + monitor.debug("TCK. DSP: expecting processId %s state to be %s. Actual state: %s".formatted(counterParty.processId(), state, actualState)); return Objects.equals(actualState, state); }); } @@ -229,55 +229,55 @@ public ControlPlaneSignalingPipeline sendTransferRequestMessage(String agreement stages.add(() -> { monitor.debug("Send DSP TransferRequestMessage"); var id = dspClient.sendTransferRequestMessage(endpoint.getAddress(), agreementId, transferType); - counterPartyProcessId.set(id); + lastCounterParty.set(new CounterParty(id, null)); }); return this; } public ControlPlaneSignalingPipeline sendTransferStartMessage() { stages.add(() -> { - var id = counterPartyProcessId.get(); - if (id == null) { + var counterParty = lastCounterParty.get(); + if (counterParty == null) { throw new RuntimeException("Cannot signal start: no actual process ID received from prepare message"); } - monitor.debug("TCK. DSP: send TransferStartMessage for processId=" + id); - dspClient.sendTransferStartMessage(id); + monitor.debug("TCK. DSP: send TransferStartMessage for processId=" + counterParty.processId()); + dspClient.sendTransferStartMessage(counterParty.address(), counterParty.processId()); }); return this; } public ControlPlaneSignalingPipeline sendTransferCompletionMessage() { stages.add(() -> { - var id = counterPartyProcessId.get(); - if (id == null) { + var counterParty = lastCounterParty.get(); + if (counterParty == null) { throw new RuntimeException("Cannot signal completion: no actual process ID received from prepare message"); } - monitor.debug("TCK. DSP: send TransferCompletionMessage for processId=" + id); - dspClient.sendTransferCompletionMessage(id); + monitor.debug("TCK. DSP: send TransferCompletionMessage for processId=" + counterParty.processId()); + dspClient.sendTransferCompletionMessage(counterParty.address(), counterParty.processId()); }); return this; } public ControlPlaneSignalingPipeline sendTransferTerminationMessage() { stages.add(() -> { - var id = counterPartyProcessId.get(); - if (id == null) { + var counterParty = lastCounterParty.get(); + if (counterParty == null) { throw new RuntimeException("Cannot signal termination: no actual process ID received from prepare message"); } - monitor.debug("TCK. DSP: send TransferTerminationMessage for processId=" + id); - dspClient.sendTransferTerminationMessage(id); + monitor.debug("TCK. DSP: send TransferTerminationMessage for processId=" + counterParty.processId()); + dspClient.sendTransferTerminationMessage(counterParty.address(), counterParty.processId()); }); return this; } public ControlPlaneSignalingPipeline sendTransferSuspensionMessage() { stages.add(() -> { - var id = counterPartyProcessId.get(); - if (id == null) { + var counterParty = lastCounterParty.get(); + if (counterParty == null) { throw new RuntimeException("Cannot signal suspension: no actual process ID received"); } - monitor.debug("TCK. DSP: send TransferSuspensionMessage for processId=" + id); - dspClient.sendTransferSuspensionMessage(id); + monitor.debug("TCK. DSP: send TransferSuspensionMessage for processId=" + counterParty.processId()); + dspClient.sendTransferSuspensionMessage(counterParty.address(), counterParty.processId()); }); return this; } @@ -343,13 +343,15 @@ private void registerDspTransferRequestHandler() { try { var message = mapper.readValue(body, Map.class); lastDspReceivedMessage.set(message); - counterPartyProcessId.set((String) message.get("consumerPid")); - monitor.debug("Received TransferRequestMessage from control plane: %s, processId=%s".formatted(message, counterPartyProcessId.get())); + var consumerProcessId = (String) message.get("consumerPid"); + var callbackAddress = (String) message.get("callbackAddress"); + lastCounterParty.set(new CounterParty(consumerProcessId, callbackAddress)); + monitor.debug("Received TransferRequestMessage from control plane: %s, processId=%s".formatted(message, consumerProcessId)); return new HandlerResponse(200, mapper.writeValueAsString(Map.of( "@context", "https://w3id.org/dspace/2025/1/context.jsonld", "@type", "TransferProcess", "providerPid", UUID.randomUUID().toString(), - "consumerPid", counterPartyProcessId.get() + "consumerPid", consumerProcessId ))); } catch (IOException e) { return new HandlerResponse(400, "Failed to parse TransferRequestMessage: " + e.getMessage()); @@ -363,12 +365,13 @@ private void registerDspTransferStartHandler() { try { var message = mapper.readValue(body, Map.class); lastDspReceivedMessage.set(message); - counterPartyProcessId.set((String) message.get("providerPid")); - monitor.debug("Received TransferStartMessage from control plane: %s. processId=%s".formatted(message, counterPartyProcessId.get())); + var providerProcessId = (String) message.get("providerPid"); + lastCounterParty.set(new CounterParty(providerProcessId, null)); + monitor.debug("Received TransferStartMessage from control plane: %s. processId=%s".formatted(message, providerProcessId)); return new HandlerResponse(200, mapper.writeValueAsString(Map.of( "@context", "https://w3id.org/dspace/2025/1/context.jsonld", "@type", "TransferProcess", - "providerPid", counterPartyProcessId.get(), + "providerPid", providerProcessId, "consumerPid", UUID.randomUUID() ))); } catch (IOException e) { @@ -409,4 +412,6 @@ private HandlerResponse badRequest(List validationErrors) { } record ReceivedDpsMessage(String path, DpsMessage type, Map content) {} + + record CounterParty(String processId, String address) {} } From 1709bb80e0c0058c504a975df1e8f6f6d7da1038 Mon Sep 17 00:00:00 2001 From: Per Hermansson Date: Wed, 10 Jun 2026 16:09:57 +0200 Subject: [PATCH 2/3] fix strict callbackAddress --- .../dps/system/client/DspClient.java | 3 +- .../dps/system/client/http/HttpDspClient.java | 35 ++++++++++++------- .../system/client/local/LocalDspClient.java | 5 +-- .../ControlPlaneSignalingPipeline.java | 5 ++- 4 files changed, 30 insertions(+), 18 deletions(-) diff --git a/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/DspClient.java b/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/DspClient.java index 1fe1b16..d2d0469 100644 --- a/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/DspClient.java +++ b/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/DspClient.java @@ -24,8 +24,9 @@ public interface DspClient { void sendTransferTerminationMessage(String callbackAddress, String processId); - String sendTransferRequestMessage(String address, String agreementId, String transferType); + TransferRequestResult sendTransferRequestMessage(String address, String agreementId, String transferType); void sendTransferSuspensionMessage(String callbackAddress, String processId); + record TransferRequestResult(String processId, String address) {} } diff --git a/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/http/HttpDspClient.java b/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/http/HttpDspClient.java index dc8ba7d..e05e4dc 100644 --- a/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/http/HttpDspClient.java +++ b/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/http/HttpDspClient.java @@ -46,8 +46,10 @@ public HttpDspClient(String protocolUrl, Monitor monitor, ObjectMapper mapper) { @Override public String dspTransferState(String callbackAddress, String processId) { try { - var address = callbackAddress == null ? this.initialDspUrl : callbackAddress; - var url = address + "/transfers/" + processId; + if (callbackAddress == null) { + throw new RuntimeException("Cannot get transfer state: missing callback url"); + } + var url = callbackAddress + "/transfers/" + processId; var authentication = Map.of("clientId", "providerId"); var request = new Request.Builder() @@ -64,34 +66,42 @@ public String dspTransferState(String callbackAddress, String processId) { @Override public void sendTransferStartMessage(String callbackAddress, String processId) { - var address = callbackAddress == null ? this.initialDspUrl : callbackAddress; + if (callbackAddress == null) { + throw new RuntimeException("Cannot send transfer start: missing callback url"); + } var requestBody = message(processId, "TransferStartMessage"); - send(address + "/transfers/" + processId + "/start", requestBody, "providerId"); + send(callbackAddress + "/transfers/" + processId + "/start", requestBody, "providerId"); } @Override public void sendTransferCompletionMessage(String callbackAddress, String processId) { - var address = callbackAddress == null ? this.initialDspUrl : callbackAddress; + if (callbackAddress == null) { + throw new RuntimeException("Cannot send transfer completion: missing callback url"); + } var requestBody = message(processId, "TransferCompletionMessage"); - send(address + "/transfers/" + processId + "/completion", requestBody, "providerId"); + send(callbackAddress + "/transfers/" + processId + "/completion", requestBody, "providerId"); } @Override public void sendTransferTerminationMessage(String callbackAddress, String processId) { - var address = callbackAddress == null ? this.initialDspUrl : callbackAddress; + if (callbackAddress == null) { + throw new RuntimeException("Cannot send transfer termination: missing callback url"); + } var requestBody = message(processId, "TransferTerminationMessage"); - send(address + "/transfers/" + processId + "/termination", requestBody, "providerId"); + send(callbackAddress + "/transfers/" + processId + "/termination", requestBody, "providerId"); } @Override public void sendTransferSuspensionMessage(String callbackAddress, String processId) { - var address = callbackAddress == null ? this.initialDspUrl : callbackAddress; + if (callbackAddress == null) { + throw new RuntimeException("Cannot send transfer suspension: missing callback url"); + } var requestBody = message(processId, "TransferSuspensionMessage"); - send(address + "/transfers/" + processId + "/suspension", requestBody, "providerId"); + send(callbackAddress + "/transfers/" + processId + "/suspension", requestBody, "providerId"); } @Override - public String sendTransferRequestMessage(String address, String agreementId, String transferType) { + public TransferRequestResult sendTransferRequestMessage(String address, String agreementId, String transferType) { var requestBody = Map.of( "@context", "https://w3id.org/dspace/2025/1/context.jsonld", "@type", "TransferRequestMessage", @@ -101,7 +111,8 @@ public String sendTransferRequestMessage(String address, String agreementId, Str "format", transferType ); var response = send(initialDspUrl + "/transfers/request", requestBody, "providerId"); - return response.get("providerPid").toString(); + var providerPid = response.get("providerPid").toString(); + return new TransferRequestResult(providerPid, initialDspUrl); } private Map send(String url, Map requestBody, String senderId) { diff --git a/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/local/LocalDspClient.java b/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/local/LocalDspClient.java index b35f163..7fbf2c4 100644 --- a/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/local/LocalDspClient.java +++ b/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/local/LocalDspClient.java @@ -50,8 +50,9 @@ public void sendTransferTerminationMessage(String callbackAddress, String proces } @Override - public String sendTransferRequestMessage(String address, String agreementId, String transferType) { - return connector.receiveTransferRequestMessage(address, agreementId); + public TransferRequestResult sendTransferRequestMessage(String address, String agreementId, String transferType) { + var providerPid = connector.receiveTransferRequestMessage(address, agreementId); + return new TransferRequestResult(providerPid, null); } @Override diff --git a/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/pipeline/ControlPlaneSignalingPipeline.java b/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/pipeline/ControlPlaneSignalingPipeline.java index e079418..c914923 100644 --- a/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/pipeline/ControlPlaneSignalingPipeline.java +++ b/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/pipeline/ControlPlaneSignalingPipeline.java @@ -228,8 +228,8 @@ public ControlPlaneSignalingPipeline thenWaitForTransferToBeInState(String state public ControlPlaneSignalingPipeline sendTransferRequestMessage(String agreementId, String transferType) { stages.add(() -> { monitor.debug("Send DSP TransferRequestMessage"); - var id = dspClient.sendTransferRequestMessage(endpoint.getAddress(), agreementId, transferType); - lastCounterParty.set(new CounterParty(id, null)); + var requestResult = dspClient.sendTransferRequestMessage(endpoint.getAddress(), agreementId, transferType); + lastCounterParty.set(new CounterParty(requestResult.processId(), requestResult.address())); }); return this; } @@ -366,7 +366,6 @@ private void registerDspTransferStartHandler() { var message = mapper.readValue(body, Map.class); lastDspReceivedMessage.set(message); var providerProcessId = (String) message.get("providerPid"); - lastCounterParty.set(new CounterParty(providerProcessId, null)); monitor.debug("Received TransferStartMessage from control plane: %s. processId=%s".formatted(message, providerProcessId)); return new HandlerResponse(200, mapper.writeValueAsString(Map.of( "@context", "https://w3id.org/dspace/2025/1/context.jsonld", From 4840497424dcb2d376d859be274d32ad2a7bbc15 Mon Sep 17 00:00:00 2001 From: Per Hermansson Date: Thu, 11 Jun 2026 19:21:28 +0200 Subject: [PATCH 3/3] pr remarks --- .../dps/system/client/http/HttpDspClient.java | 17 +---------------- .../pipeline/ControlPlaneSignalingPipeline.java | 10 +++++----- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/http/HttpDspClient.java b/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/http/HttpDspClient.java index e05e4dc..a6accde 100644 --- a/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/http/HttpDspClient.java +++ b/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/client/http/HttpDspClient.java @@ -46,9 +46,6 @@ public HttpDspClient(String protocolUrl, Monitor monitor, ObjectMapper mapper) { @Override public String dspTransferState(String callbackAddress, String processId) { try { - if (callbackAddress == null) { - throw new RuntimeException("Cannot get transfer state: missing callback url"); - } var url = callbackAddress + "/transfers/" + processId; var authentication = Map.of("clientId", "providerId"); @@ -66,36 +63,24 @@ public String dspTransferState(String callbackAddress, String processId) { @Override public void sendTransferStartMessage(String callbackAddress, String processId) { - if (callbackAddress == null) { - throw new RuntimeException("Cannot send transfer start: missing callback url"); - } var requestBody = message(processId, "TransferStartMessage"); send(callbackAddress + "/transfers/" + processId + "/start", requestBody, "providerId"); } @Override public void sendTransferCompletionMessage(String callbackAddress, String processId) { - if (callbackAddress == null) { - throw new RuntimeException("Cannot send transfer completion: missing callback url"); - } var requestBody = message(processId, "TransferCompletionMessage"); send(callbackAddress + "/transfers/" + processId + "/completion", requestBody, "providerId"); } @Override public void sendTransferTerminationMessage(String callbackAddress, String processId) { - if (callbackAddress == null) { - throw new RuntimeException("Cannot send transfer termination: missing callback url"); - } var requestBody = message(processId, "TransferTerminationMessage"); send(callbackAddress + "/transfers/" + processId + "/termination", requestBody, "providerId"); } @Override public void sendTransferSuspensionMessage(String callbackAddress, String processId) { - if (callbackAddress == null) { - throw new RuntimeException("Cannot send transfer suspension: missing callback url"); - } var requestBody = message(processId, "TransferSuspensionMessage"); send(callbackAddress + "/transfers/" + processId + "/suspension", requestBody, "providerId"); } @@ -110,7 +95,7 @@ public TransferRequestResult sendTransferRequestMessage(String address, String a "agreementId", agreementId, "format", transferType ); - var response = send(initialDspUrl + "/transfers/request", requestBody, "providerId"); + var response = send(initialDspUrl + "/transfers/request", requestBody, "consumerId"); var providerPid = response.get("providerPid").toString(); return new TransferRequestResult(providerPid, initialDspUrl); } diff --git a/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/pipeline/ControlPlaneSignalingPipeline.java b/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/pipeline/ControlPlaneSignalingPipeline.java index c914923..3cde5a6 100644 --- a/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/pipeline/ControlPlaneSignalingPipeline.java +++ b/dps-tck/src/main/java/org/eclipse/dataspacetck/dps/system/pipeline/ControlPlaneSignalingPipeline.java @@ -217,7 +217,7 @@ public ControlPlaneSignalingPipeline thenWaitForTransferToBeInState(String state return thenWait("transfer to be in state " + state, () -> { var counterParty = lastCounterParty.get(); if (counterParty == null) { - throw new RuntimeException("Cannot signal completion: no actual process ID received from prepare message"); + throw new RuntimeException("Cannot wait for transfer state: no counter party data has been set"); } var actualState = dspClient.dspTransferState(counterParty.address(), counterParty.processId()); monitor.debug("TCK. DSP: expecting processId %s state to be %s. Actual state: %s".formatted(counterParty.processId(), state, actualState)); @@ -238,7 +238,7 @@ public ControlPlaneSignalingPipeline sendTransferStartMessage() { stages.add(() -> { var counterParty = lastCounterParty.get(); if (counterParty == null) { - throw new RuntimeException("Cannot signal start: no actual process ID received from prepare message"); + throw new RuntimeException("Cannot signal start: no counter party data has been set"); } monitor.debug("TCK. DSP: send TransferStartMessage for processId=" + counterParty.processId()); dspClient.sendTransferStartMessage(counterParty.address(), counterParty.processId()); @@ -250,7 +250,7 @@ public ControlPlaneSignalingPipeline sendTransferCompletionMessage() { stages.add(() -> { var counterParty = lastCounterParty.get(); if (counterParty == null) { - throw new RuntimeException("Cannot signal completion: no actual process ID received from prepare message"); + throw new RuntimeException("Cannot signal completion: no counter party data has been set"); } monitor.debug("TCK. DSP: send TransferCompletionMessage for processId=" + counterParty.processId()); dspClient.sendTransferCompletionMessage(counterParty.address(), counterParty.processId()); @@ -262,7 +262,7 @@ public ControlPlaneSignalingPipeline sendTransferTerminationMessage() { stages.add(() -> { var counterParty = lastCounterParty.get(); if (counterParty == null) { - throw new RuntimeException("Cannot signal termination: no actual process ID received from prepare message"); + throw new RuntimeException("Cannot signal termination: no counter party data has been set"); } monitor.debug("TCK. DSP: send TransferTerminationMessage for processId=" + counterParty.processId()); dspClient.sendTransferTerminationMessage(counterParty.address(), counterParty.processId()); @@ -274,7 +274,7 @@ public ControlPlaneSignalingPipeline sendTransferSuspensionMessage() { stages.add(() -> { var counterParty = lastCounterParty.get(); if (counterParty == null) { - throw new RuntimeException("Cannot signal suspension: no actual process ID received"); + throw new RuntimeException("Cannot signal suspension: no counter party data has been set"); } monitor.debug("TCK. DSP: send TransferSuspensionMessage for processId=" + counterParty.processId()); dspClient.sendTransferSuspensionMessage(counterParty.address(), counterParty.processId());