Skip to content

Commit 6ba6ecd

Browse files
committed
feat: introduce multi protocol dsp path4
1 parent d9083ce commit 6ba6ecd

File tree

16 files changed

+262
-101
lines changed

16 files changed

+262
-101
lines changed

data-protocols/dsp/dsp-catalog/dsp-catalog-http-dispatcher/src/main/java/org/eclipse/edc/protocol/dsp/catalog/http/dispatcher/DspCatalogHttpDispatcherExtension.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
import org.eclipse.edc.protocol.dsp.http.dispatcher.GetDspHttpRequestFactory;
2020
import org.eclipse.edc.protocol.dsp.http.dispatcher.PostDspHttpRequestFactory;
2121
import org.eclipse.edc.protocol.dsp.http.serialization.ByteArrayBodyExtractor;
22-
import org.eclipse.edc.protocol.dsp.http.spi.DspProtocolParser;
2322
import org.eclipse.edc.protocol.dsp.http.spi.dispatcher.DspHttpRemoteMessageDispatcher;
23+
import org.eclipse.edc.protocol.dsp.http.spi.dispatcher.DspRequestBasePathProvider;
2424
import org.eclipse.edc.protocol.dsp.http.spi.serialization.JsonLdRemoteMessageSerializer;
2525
import org.eclipse.edc.runtime.metamodel.annotation.Extension;
2626
import org.eclipse.edc.runtime.metamodel.annotation.Inject;
@@ -45,7 +45,7 @@ public class DspCatalogHttpDispatcherExtension implements ServiceExtension {
4545
@Inject
4646
private JsonLdRemoteMessageSerializer remoteMessageSerializer;
4747
@Inject
48-
private DspProtocolParser dspProtocolParser;
48+
private DspRequestBasePathProvider dspRequestBasePathProvider;
4949

5050
@Override
5151
public String name() {
@@ -58,12 +58,12 @@ public void initialize(ServiceExtensionContext context) {
5858

5959
messageDispatcher.registerMessage(
6060
CatalogRequestMessage.class,
61-
new PostDspHttpRequestFactory<>(remoteMessageSerializer, dspProtocolParser, m -> BASE_PATH + CATALOG_REQUEST),
61+
new PostDspHttpRequestFactory<>(remoteMessageSerializer, dspRequestBasePathProvider, m -> BASE_PATH + CATALOG_REQUEST),
6262
byteArrayBodyExtractor
6363
);
6464
messageDispatcher.registerMessage(
6565
DatasetRequestMessage.class,
66-
new GetDspHttpRequestFactory<>(dspProtocolParser, m -> BASE_PATH + DATASET_REQUEST + "/" + m.getDatasetId()),
66+
new GetDspHttpRequestFactory<>(dspRequestBasePathProvider, m -> BASE_PATH + DATASET_REQUEST + "/" + m.getDatasetId()),
6767
byteArrayBodyExtractor
6868
);
6969
}

data-protocols/dsp/dsp-http-api-configuration/src/main/java/org/eclipse/edc/protocol/dsp/http/api/configuration/DspApiConfigurationExtension.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
import static org.eclipse.edc.protocol.dsp.spi.type.DspConstants.DSP_SCOPE_V_2024_1;
7070
import static org.eclipse.edc.protocol.dsp.spi.type.DspConstants.DSP_TRANSFORMER_CONTEXT_V_08;
7171
import static org.eclipse.edc.protocol.dsp.spi.type.DspConstants.DSP_TRANSFORMER_CONTEXT_V_2024_1;
72+
import static org.eclipse.edc.protocol.dsp.spi.version.DspVersions.V_2024_1_PATH;
7273
import static org.eclipse.edc.spi.constants.CoreConstants.EDC_NAMESPACE;
7374
import static org.eclipse.edc.spi.constants.CoreConstants.EDC_PREFIX;
7475
import static org.eclipse.edc.spi.constants.CoreConstants.JSON_LD;
@@ -84,6 +85,11 @@ public class DspApiConfigurationExtension implements ServiceExtension {
8485
static final String DEFAULT_PROTOCOL_PATH = "/api/protocol";
8586
static final int DEFAULT_PROTOCOL_PORT = 8282;
8687

88+
private static final boolean DEFAULT_WELL_KNOWN_PATH = false;
89+
90+
@Setting(description = "If set enable the well known path resolution scheme will be used", key = "edc.dsp.wellKnownPath.enabled", required = false, defaultValue = DEFAULT_WELL_KNOWN_PATH + "")
91+
private boolean wellKnownPathEnabled;
92+
8793
@Setting(description = "Configures endpoint for reaching the Protocol API in the form \"<hostname:protocol.port/protocol.path>\"", key = "edc.dsp.callback.address", required = false)
8894
private String callbackAddress;
8995
@Configuration
@@ -119,8 +125,11 @@ public void initialize(ServiceExtensionContext context) {
119125

120126
var dspWebhookAddress = ofNullable(callbackAddress).orElseGet(() -> format("http://%s:%s%s", hostname.get(), portMapping.port(), portMapping.path()));
121127

128+
129+
var v2024Path = dspWebhookAddress + (wellKnownPathEnabled ? "" : V_2024_1_PATH);
130+
122131
protocolWebhookRegistry.registerWebhook(DATASPACE_PROTOCOL_HTTP, () -> dspWebhookAddress);
123-
protocolWebhookRegistry.registerWebhook(DATASPACE_PROTOCOL_HTTP_V_2024_1, () -> dspWebhookAddress);
132+
protocolWebhookRegistry.registerWebhook(DATASPACE_PROTOCOL_HTTP_V_2024_1, () -> v2024Path);
124133

125134
// registers ns for DSP scope
126135
registerNamespaces(DSP_SCOPE_V_08, DSP_NAMESPACE_V_08);
@@ -135,6 +144,7 @@ public void initialize(ServiceExtensionContext context) {
135144
registerTransformers(DSP_TRANSFORMER_CONTEXT_V_2024_1, DSP_NAMESPACE_V_2024_1);
136145
}
137146

147+
138148
@Override
139149
public void prepare() {
140150
var mapper = typeManager.getMapper(JSON_LD);

data-protocols/dsp/dsp-http-api-configuration/src/test/java/org/eclipse/edc/protocol/dsp/http/api/configuration/DspApiConfigurationExtensionTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import static org.eclipse.edc.protocol.dsp.http.spi.types.HttpMessageProtocol.DATASPACE_PROTOCOL_HTTP_V_2024_1;
5050
import static org.eclipse.edc.protocol.dsp.spi.type.DspConstants.DSP_SCOPE_V_08;
5151
import static org.eclipse.edc.protocol.dsp.spi.type.DspConstants.DSP_SCOPE_V_2024_1;
52+
import static org.eclipse.edc.protocol.dsp.spi.version.DspVersions.V_2024_1_PATH;
5253
import static org.eclipse.edc.spi.constants.CoreConstants.EDC_NAMESPACE;
5354
import static org.eclipse.edc.spi.constants.CoreConstants.EDC_PREFIX;
5455
import static org.mockito.ArgumentMatchers.any;
@@ -93,7 +94,7 @@ void shouldComposeProtocolWebhook_whenNotConfigured(DspApiConfigurationExtension
9394

9495
var url = "http://hostname:%s%s".formatted(DEFAULT_PROTOCOL_PORT, DEFAULT_PROTOCOL_PATH);
9596
verify(protocolWebhookRegistry).registerWebhook(eq(DATASPACE_PROTOCOL_HTTP), argThat(webhook -> webhook.url().equals(url)));
96-
verify(protocolWebhookRegistry).registerWebhook(eq(DATASPACE_PROTOCOL_HTTP_V_2024_1), argThat(webhook -> webhook.url().equals(url)));
97+
verify(protocolWebhookRegistry).registerWebhook(eq(DATASPACE_PROTOCOL_HTTP_V_2024_1), argThat(webhook -> webhook.url().equals(url + V_2024_1_PATH)));
9798
}
9899

99100
@Test
@@ -102,7 +103,8 @@ void shouldUseConfiguredProtocolWebhook(ServiceExtensionContext context, ObjectF
102103
when(context.getConfig()).thenReturn(ConfigFactory.fromMap(Map.of(
103104
"web.http.protocol.port", String.valueOf(1234),
104105
"web.http.protocol.path", "/path",
105-
"edc.dsp.callback.address", webhookAddress))
106+
"edc.dsp.callback.address", webhookAddress,
107+
"edc.dsp.wellKnownPath.enabled", "true"))
106108
);
107109
var extension = factory.constructInstance(DspApiConfigurationExtension.class);
108110

@@ -115,6 +117,7 @@ void shouldUseConfiguredProtocolWebhook(ServiceExtensionContext context, ObjectF
115117

116118
}
117119

120+
118121
@Test
119122
void initialize_shouldRegisterWebServiceProviders(DspApiConfigurationExtension extension, ServiceExtensionContext context) {
120123
extension.initialize(context);

data-protocols/dsp/dsp-http-core/src/main/java/org/eclipse/edc/protocol/dsp/http/DspHttpCoreExtension.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,21 @@
3838
import org.eclipse.edc.policy.context.request.spi.RequestVersionPolicyContext;
3939
import org.eclipse.edc.policy.engine.spi.PolicyEngine;
4040
import org.eclipse.edc.protocol.dsp.http.dispatcher.DspHttpRemoteMessageDispatcherImpl;
41+
import org.eclipse.edc.protocol.dsp.http.dispatcher.DspRequestBasePathProviderImpl;
4142
import org.eclipse.edc.protocol.dsp.http.message.DspRequestHandlerImpl;
4243
import org.eclipse.edc.protocol.dsp.http.protocol.DspProtocolParserImpl;
4344
import org.eclipse.edc.protocol.dsp.http.serialization.JsonLdRemoteMessageSerializerImpl;
4445
import org.eclipse.edc.protocol.dsp.http.spi.DspProtocolParser;
4546
import org.eclipse.edc.protocol.dsp.http.spi.dispatcher.DspHttpRemoteMessageDispatcher;
47+
import org.eclipse.edc.protocol.dsp.http.spi.dispatcher.DspRequestBasePathProvider;
4648
import org.eclipse.edc.protocol.dsp.http.spi.message.DspRequestHandler;
4749
import org.eclipse.edc.protocol.dsp.http.spi.serialization.JsonLdRemoteMessageSerializer;
4850
import org.eclipse.edc.protocol.dsp.http.transform.DspProtocolTypeTransformerRegistryImpl;
4951
import org.eclipse.edc.protocol.dsp.spi.transform.DspProtocolTypeTransformerRegistry;
5052
import org.eclipse.edc.runtime.metamodel.annotation.Extension;
5153
import org.eclipse.edc.runtime.metamodel.annotation.Inject;
5254
import org.eclipse.edc.runtime.metamodel.annotation.Provider;
55+
import org.eclipse.edc.runtime.metamodel.annotation.Setting;
5356
import org.eclipse.edc.spi.iam.AudienceResolver;
5457
import org.eclipse.edc.spi.iam.IdentityService;
5558
import org.eclipse.edc.spi.message.RemoteMessageDispatcherRegistry;
@@ -81,6 +84,11 @@ public class DspHttpCoreExtension implements ServiceExtension {
8184

8285
public static final String NAME = "Dataspace Protocol Core Extension";
8386

87+
private static final boolean DEFAULT_WELL_KNOWN_PATH = false;
88+
89+
@Setting(description = "If set enable the well known path resolution scheme will be used", key = "edc.dsp.wellKnownPath.enabled", required = false, defaultValue = DEFAULT_WELL_KNOWN_PATH + "")
90+
private boolean wellKnownPathEnabled;
91+
8492
@Inject
8593
private RemoteMessageDispatcherRegistry dispatcherRegistry;
8694
@Inject
@@ -169,6 +177,10 @@ public DspProtocolParser dspProtocolParser() {
169177
return dspProtocolParser;
170178
}
171179

180+
@Provider
181+
public DspRequestBasePathProvider dspRequestBasePathProvider() {
182+
return new DspRequestBasePathProviderImpl(dspProtocolParser(), wellKnownPathEnabled);
183+
}
172184

173185
private void registerNegotiationPolicyScopes(DspHttpRemoteMessageDispatcher dispatcher) {
174186
dispatcher.registerPolicyScope(ContractAgreementMessage.class, ContractRemoteMessage::getPolicy, RequestContractNegotiationPolicyContext::new);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright (c) 2025 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
3+
*
4+
* This program and the accompanying materials are made available under the
5+
* terms of the Apache License, Version 2.0 which is available at
6+
* https://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* SPDX-License-Identifier: Apache-2.0
9+
*
10+
* Contributors:
11+
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
12+
*
13+
*/
14+
15+
package org.eclipse.edc.protocol.dsp.http.dispatcher;
16+
17+
import org.eclipse.edc.connector.controlplane.services.spi.protocol.ProtocolVersion;
18+
import org.eclipse.edc.protocol.dsp.http.spi.DspProtocolParser;
19+
import org.eclipse.edc.protocol.dsp.http.spi.dispatcher.DspRequestBasePathProvider;
20+
import org.eclipse.edc.spi.EdcException;
21+
import org.eclipse.edc.spi.types.domain.message.RemoteMessage;
22+
23+
public class DspRequestBasePathProviderImpl implements DspRequestBasePathProvider {
24+
25+
private final DspProtocolParser protocolParser;
26+
private final boolean wellKnownPath;
27+
28+
public DspRequestBasePathProviderImpl(DspProtocolParser protocolParser, boolean wellKnownPath) {
29+
this.protocolParser = protocolParser;
30+
this.wellKnownPath = wellKnownPath;
31+
}
32+
33+
@Override
34+
public String provideBasePath(RemoteMessage message) {
35+
var protocolPath = "";
36+
if (wellKnownPath) {
37+
protocolPath = protocolParser.parse(message.getProtocol())
38+
.map(ProtocolVersion::path)
39+
.map(this::removeTrailingSlash)
40+
.orElseThrow(failure -> new EdcException(failure.getFailureDetail()));
41+
}
42+
return message.getCounterPartyAddress() + protocolPath;
43+
}
44+
45+
private String removeTrailingSlash(String path) {
46+
if (path.endsWith("/")) {
47+
return path.substring(0, path.length() - 1);
48+
}
49+
return path;
50+
}
51+
}

data-protocols/dsp/dsp-http-core/src/main/java/org/eclipse/edc/protocol/dsp/http/dispatcher/GetDspHttpRequestFactory.java

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616

1717
import okhttp3.HttpUrl;
1818
import okhttp3.Request;
19-
import org.eclipse.edc.connector.controlplane.services.spi.protocol.ProtocolVersion;
20-
import org.eclipse.edc.protocol.dsp.http.spi.DspProtocolParser;
2119
import org.eclipse.edc.protocol.dsp.http.spi.dispatcher.DspHttpRequestFactory;
20+
import org.eclipse.edc.protocol.dsp.http.spi.dispatcher.DspRequestBasePathProvider;
2221
import org.eclipse.edc.protocol.dsp.http.spi.dispatcher.RequestPathProvider;
23-
import org.eclipse.edc.spi.EdcException;
2422
import org.eclipse.edc.spi.types.domain.message.RemoteMessage;
2523

2624
/**
@@ -30,23 +28,17 @@
3028
*/
3129
public class GetDspHttpRequestFactory<M extends RemoteMessage> implements DspHttpRequestFactory<M> {
3230
private final RequestPathProvider<M> pathProvider;
31+
private final DspRequestBasePathProvider dspBasePathProvider;
3332

34-
private final DspProtocolParser protocolParser;
35-
36-
public GetDspHttpRequestFactory(DspProtocolParser protocolParser, RequestPathProvider<M> pathProvider) {
37-
this.protocolParser = protocolParser;
33+
public GetDspHttpRequestFactory(DspRequestBasePathProvider dspBasePathProvider, RequestPathProvider<M> pathProvider) {
34+
this.dspBasePathProvider = dspBasePathProvider;
3835
this.pathProvider = pathProvider;
3936
}
4037

4138
@Override
4239
public Request createRequest(M message) {
4340

44-
var protocolPath = protocolParser.parse(message.getProtocol())
45-
.map(ProtocolVersion::path)
46-
.map(this::removeTrailingSlash)
47-
.orElseThrow(failure -> new EdcException(failure.getFailureDetail()));
48-
49-
var url = HttpUrl.get(message.getCounterPartyAddress() + protocolPath + pathProvider.providePath(message));
41+
var url = HttpUrl.get(dspBasePathProvider.provideBasePath(message) + pathProvider.providePath(message));
5042

5143
return new Request.Builder()
5244
.url(url)

data-protocols/dsp/dsp-http-core/src/main/java/org/eclipse/edc/protocol/dsp/http/dispatcher/PostDspHttpRequestFactory.java

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@
1818
import okhttp3.MediaType;
1919
import okhttp3.Request;
2020
import okhttp3.RequestBody;
21-
import org.eclipse.edc.connector.controlplane.services.spi.protocol.ProtocolVersion;
22-
import org.eclipse.edc.protocol.dsp.http.spi.DspProtocolParser;
2321
import org.eclipse.edc.protocol.dsp.http.spi.dispatcher.DspHttpRequestFactory;
22+
import org.eclipse.edc.protocol.dsp.http.spi.dispatcher.DspRequestBasePathProvider;
2423
import org.eclipse.edc.protocol.dsp.http.spi.dispatcher.RequestPathProvider;
2524
import org.eclipse.edc.protocol.dsp.http.spi.serialization.JsonLdRemoteMessageSerializer;
26-
import org.eclipse.edc.spi.EdcException;
2725
import org.eclipse.edc.spi.types.domain.message.RemoteMessage;
2826

2927
/**
@@ -36,12 +34,11 @@ public class PostDspHttpRequestFactory<M extends RemoteMessage> implements DspHt
3634
public static final String APPLICATION_JSON = "application/json";
3735
private final RequestPathProvider<M> pathProvider;
3836
private final JsonLdRemoteMessageSerializer serializer;
39-
private final DspProtocolParser protocolParser;
37+
private final DspRequestBasePathProvider dspBasePathProvider;
4038

41-
42-
public PostDspHttpRequestFactory(JsonLdRemoteMessageSerializer serializer, DspProtocolParser protocolParser, RequestPathProvider<M> pathProvider) {
39+
public PostDspHttpRequestFactory(JsonLdRemoteMessageSerializer serializer, DspRequestBasePathProvider dspBasePathProvider, RequestPathProvider<M> pathProvider) {
4340
this.serializer = serializer;
44-
this.protocolParser = protocolParser;
41+
this.dspBasePathProvider = dspBasePathProvider;
4542
this.pathProvider = pathProvider;
4643
}
4744

@@ -50,12 +47,7 @@ public Request createRequest(M message) {
5047
var body = serializer.serialize(message);
5148
var requestBody = RequestBody.create(body, MediaType.get(APPLICATION_JSON));
5249

53-
var protocolPath = protocolParser.parse(message.getProtocol())
54-
.map(ProtocolVersion::path)
55-
.map(this::removeTrailingSlash)
56-
.orElseThrow(failure -> new EdcException(failure.getFailureDetail()));
57-
58-
var url = HttpUrl.get(message.getCounterPartyAddress() + protocolPath + pathProvider.providePath(message));
50+
var url = HttpUrl.get(dspBasePathProvider.provideBasePath(message) + pathProvider.providePath(message));
5951

6052
return new Request.Builder()
6153
.url(url)

data-protocols/dsp/dsp-http-core/src/test/java/org/eclipse/edc/protocol/dsp/http/dispatcher/GetDspHttpRequestFactoryTest.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515
package org.eclipse.edc.protocol.dsp.http.dispatcher;
1616

1717
import org.eclipse.edc.protocol.dsp.http.TestMessage;
18-
import org.eclipse.edc.protocol.dsp.http.spi.DspProtocolParser;
18+
import org.eclipse.edc.protocol.dsp.http.spi.dispatcher.DspRequestBasePathProvider;
1919
import org.eclipse.edc.protocol.dsp.http.spi.dispatcher.RequestPathProvider;
20-
import org.eclipse.edc.protocol.dsp.spi.version.DspVersions;
21-
import org.eclipse.edc.spi.result.Result;
2220
import org.junit.jupiter.api.Test;
2321

2422
import static org.assertj.core.api.Assertions.assertThat;
@@ -29,19 +27,19 @@
2927
class GetDspHttpRequestFactoryTest {
3028

3129
private final RequestPathProvider<TestMessage> pathProvider = mock();
32-
private final DspProtocolParser dspProtocolParser = mock();
33-
private final GetDspHttpRequestFactory<TestMessage> factory = new GetDspHttpRequestFactory<>(dspProtocolParser, pathProvider);
30+
private final DspRequestBasePathProvider dspRequestBasePathProvider = mock();
31+
private final GetDspHttpRequestFactory<TestMessage> factory = new GetDspHttpRequestFactory<>(dspRequestBasePathProvider, pathProvider);
3432

3533
@Test
3634
void shouldCreateProperHttpRequest() {
3735
when(pathProvider.providePath(any())).thenReturn("/message/request/path");
38-
when(dspProtocolParser.parse("protocol")).thenReturn(Result.success(DspVersions.V_08));
36+
when(dspRequestBasePathProvider.provideBasePath(any())).thenReturn("http://counter-party");
3937

4038
var message = new TestMessage("protocol", "http://counter-party", "counterPartyId");
4139
var request = factory.createRequest(message);
4240

4341
assertThat(request.url().url().toString()).isEqualTo("http://counter-party/message/request/path");
4442
assertThat(request.method()).isEqualTo("GET");
4543
}
46-
44+
4745
}

data-protocols/dsp/dsp-http-core/src/test/java/org/eclipse/edc/protocol/dsp/http/dispatcher/PostDspHttpRequestFactoryTest.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@
1717
import okhttp3.MediaType;
1818
import okio.Buffer;
1919
import org.eclipse.edc.protocol.dsp.http.TestMessage;
20-
import org.eclipse.edc.protocol.dsp.http.spi.DspProtocolParser;
20+
import org.eclipse.edc.protocol.dsp.http.spi.dispatcher.DspRequestBasePathProvider;
2121
import org.eclipse.edc.protocol.dsp.http.spi.dispatcher.RequestPathProvider;
2222
import org.eclipse.edc.protocol.dsp.http.spi.serialization.JsonLdRemoteMessageSerializer;
23-
import org.eclipse.edc.protocol.dsp.spi.version.DspVersions;
24-
import org.eclipse.edc.spi.result.Result;
2523
import org.junit.jupiter.api.Test;
2624

2725
import static org.assertj.core.api.Assertions.assertThat;
@@ -33,13 +31,13 @@ class PostDspHttpRequestFactoryTest {
3331

3432
private final RequestPathProvider<TestMessage> pathProvider = mock();
3533
private final JsonLdRemoteMessageSerializer serializer = mock();
36-
private final DspProtocolParser dspProtocolParser = mock();
37-
private final PostDspHttpRequestFactory<TestMessage> factory = new PostDspHttpRequestFactory<>(serializer, dspProtocolParser, pathProvider);
34+
private final DspRequestBasePathProvider dspRequestBasePathProvider = mock();
35+
private final PostDspHttpRequestFactory<TestMessage> factory = new PostDspHttpRequestFactory<>(serializer, dspRequestBasePathProvider, pathProvider);
3836

3937
@Test
4038
void shouldCreateProperHttpRequest() {
4139
when(serializer.serialize(any())).thenReturn("serializedMessage");
42-
when(dspProtocolParser.parse("protocol")).thenReturn(Result.success(DspVersions.V_08));
40+
when(dspRequestBasePathProvider.provideBasePath(any())).thenReturn("http://counter-party");
4341
when(pathProvider.providePath(any())).thenReturn("/message/request/path");
4442

4543
var message = new TestMessage("protocol", "http://counter-party", "counterPartyId");

data-protocols/dsp/dsp-http-spi/src/main/java/org/eclipse/edc/protocol/dsp/http/spi/dispatcher/DspHttpRequestFactory.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@
2525
@FunctionalInterface
2626
public interface DspHttpRequestFactory<M extends RemoteMessage> {
2727

28-
default String removeTrailingSlash(String path) {
29-
if (path.endsWith("/")) {
30-
return path.substring(0, path.length() - 1);
31-
}
32-
return path;
33-
}
34-
3528
/**
3629
* Create the request given the message and a {@link RequestPathProvider}
3730
*

0 commit comments

Comments
 (0)