diff --git a/data-protocols/dsp/dsp-catalog/dsp-catalog-http-dispatcher/src/main/java/org/eclipse/edc/protocol/dsp/catalog/dispatcher/delegate/CatalogRequestHttpRawDelegate.java b/data-protocols/dsp/dsp-catalog/dsp-catalog-http-dispatcher/src/main/java/org/eclipse/edc/protocol/dsp/catalog/dispatcher/delegate/CatalogRequestHttpRawDelegate.java
index ab216918957..3931365485b 100644
--- a/data-protocols/dsp/dsp-catalog/dsp-catalog-http-dispatcher/src/main/java/org/eclipse/edc/protocol/dsp/catalog/dispatcher/delegate/CatalogRequestHttpRawDelegate.java
+++ b/data-protocols/dsp/dsp-catalog/dsp-catalog-http-dispatcher/src/main/java/org/eclipse/edc/protocol/dsp/catalog/dispatcher/delegate/CatalogRequestHttpRawDelegate.java
@@ -16,7 +16,6 @@
import jakarta.json.JsonObject;
import okhttp3.Response;
-import org.eclipse.edc.catalog.spi.CatalogRequestMessage;
import org.eclipse.edc.protocol.dsp.spi.dispatcher.DspHttpDispatcherDelegate;
import org.eclipse.edc.spi.EdcException;
@@ -27,7 +26,7 @@
* Delegate for dispatching catalog requests as defined in the
* dataspace protocol specification
*/
-public class CatalogRequestHttpRawDelegate extends DspHttpDispatcherDelegate {
+public class CatalogRequestHttpRawDelegate extends DspHttpDispatcherDelegate {
public CatalogRequestHttpRawDelegate() {
super();
@@ -43,8 +42,8 @@ public CatalogRequestHttpRawDelegate() {
public Function parseResponse() {
return response -> {
try {
+ //noinspection DataFlowIssue
return response.body().bytes();
-
} catch (NullPointerException e) {
throw new EdcException("Failed to read response body, as body was null.", e);
} catch (IOException e) {
diff --git a/data-protocols/dsp/dsp-catalog/dsp-catalog-http-dispatcher/src/main/java/org/eclipse/edc/protocol/dsp/catalog/dispatcher/delegate/DatasetRequestHttpRawDelegate.java b/data-protocols/dsp/dsp-catalog/dsp-catalog-http-dispatcher/src/main/java/org/eclipse/edc/protocol/dsp/catalog/dispatcher/delegate/DatasetRequestHttpRawDelegate.java
index 4da7c169964..15854e611ea 100644
--- a/data-protocols/dsp/dsp-catalog/dsp-catalog-http-dispatcher/src/main/java/org/eclipse/edc/protocol/dsp/catalog/dispatcher/delegate/DatasetRequestHttpRawDelegate.java
+++ b/data-protocols/dsp/dsp-catalog/dsp-catalog-http-dispatcher/src/main/java/org/eclipse/edc/protocol/dsp/catalog/dispatcher/delegate/DatasetRequestHttpRawDelegate.java
@@ -16,7 +16,6 @@
import jakarta.json.JsonObject;
import okhttp3.Response;
-import org.eclipse.edc.catalog.spi.DatasetRequestMessage;
import org.eclipse.edc.protocol.dsp.spi.dispatcher.DspHttpDispatcherDelegate;
import org.eclipse.edc.spi.EdcException;
@@ -27,7 +26,7 @@
* Delegate for dispatching catalog requests as defined in the
* dataspace protocol specification
*/
-public class DatasetRequestHttpRawDelegate extends DspHttpDispatcherDelegate {
+public class DatasetRequestHttpRawDelegate extends DspHttpDispatcherDelegate {
public DatasetRequestHttpRawDelegate() {
super();
@@ -43,6 +42,7 @@ public DatasetRequestHttpRawDelegate() {
public Function parseResponse() {
return response -> {
try {
+ //noinspection DataFlowIssue
return response.body().bytes();
} catch (NullPointerException e) {
diff --git a/data-protocols/dsp/dsp-catalog/dsp-catalog-http-dispatcher/src/test/java/org/eclipse/edc/protocol/dsp/catalog/dispatcher/delegate/CatalogRequestHttpRawDelegateTest.java b/data-protocols/dsp/dsp-catalog/dsp-catalog-http-dispatcher/src/test/java/org/eclipse/edc/protocol/dsp/catalog/dispatcher/delegate/CatalogRequestHttpRawDelegateTest.java
index f3fdfdf3522..afbd5d30539 100644
--- a/data-protocols/dsp/dsp-catalog/dsp-catalog-http-dispatcher/src/test/java/org/eclipse/edc/protocol/dsp/catalog/dispatcher/delegate/CatalogRequestHttpRawDelegateTest.java
+++ b/data-protocols/dsp/dsp-catalog/dsp-catalog-http-dispatcher/src/test/java/org/eclipse/edc/protocol/dsp/catalog/dispatcher/delegate/CatalogRequestHttpRawDelegateTest.java
@@ -57,7 +57,7 @@ void parseResponse_responseBodyNull_throwException() {
}
@Override
- protected DspHttpDispatcherDelegate delegate() {
+ protected DspHttpDispatcherDelegate> delegate() {
return delegate;
}
diff --git a/data-protocols/dsp/dsp-catalog/dsp-catalog-http-dispatcher/src/test/java/org/eclipse/edc/protocol/dsp/catalog/dispatcher/delegate/DatasetRequestHttpRawDelegateTest.java b/data-protocols/dsp/dsp-catalog/dsp-catalog-http-dispatcher/src/test/java/org/eclipse/edc/protocol/dsp/catalog/dispatcher/delegate/DatasetRequestHttpRawDelegateTest.java
index dee5da6bff4..169dcac818d 100644
--- a/data-protocols/dsp/dsp-catalog/dsp-catalog-http-dispatcher/src/test/java/org/eclipse/edc/protocol/dsp/catalog/dispatcher/delegate/DatasetRequestHttpRawDelegateTest.java
+++ b/data-protocols/dsp/dsp-catalog/dsp-catalog-http-dispatcher/src/test/java/org/eclipse/edc/protocol/dsp/catalog/dispatcher/delegate/DatasetRequestHttpRawDelegateTest.java
@@ -57,15 +57,8 @@ void parseResponse_responseBodyNull_throwException() {
}
@Override
- protected DspHttpDispatcherDelegate delegate() {
+ protected DspHttpDispatcherDelegate> delegate() {
return delegate;
}
- private DatasetRequestMessage message() {
- return DatasetRequestMessage.Builder.newInstance()
- .datasetId("dataset-id")
- .counterPartyAddress("http://connector")
- .protocol("protocol")
- .build();
- }
}
diff --git a/data-protocols/dsp/dsp-http-core/src/main/java/org/eclipse/edc/protocol/dsp/dispatcher/DspHttpRemoteMessageDispatcherImpl.java b/data-protocols/dsp/dsp-http-core/src/main/java/org/eclipse/edc/protocol/dsp/dispatcher/DspHttpRemoteMessageDispatcherImpl.java
index 8308d1c6273..4e732d88969 100644
--- a/data-protocols/dsp/dsp-http-core/src/main/java/org/eclipse/edc/protocol/dsp/dispatcher/DspHttpRemoteMessageDispatcherImpl.java
+++ b/data-protocols/dsp/dsp-http-core/src/main/java/org/eclipse/edc/protocol/dsp/dispatcher/DspHttpRemoteMessageDispatcherImpl.java
@@ -108,11 +108,11 @@ public void registerPolicyScope(Class messageClass,
}
@Override
- public void registerMessage(Class clazz, DspHttpRequestFactory requestFactory, DspHttpDispatcherDelegate delegate) {
+ public void registerMessage(Class clazz, DspHttpRequestFactory requestFactory, DspHttpDispatcherDelegate delegate) {
handlers.put(clazz, new Handlers<>(requestFactory, delegate));
}
- private record Handlers(DspHttpRequestFactory requestFactory, DspHttpDispatcherDelegate delegate) { }
+ private record Handlers(DspHttpRequestFactory requestFactory, DspHttpDispatcherDelegate delegate) { }
private record PolicyScope(Class messageClass, String scope, Function policyProvider) {}
diff --git a/data-protocols/dsp/dsp-http-core/src/test/java/org/eclipse/edc/protocol/dsp/dispatcher/DspHttpRemoteMessageDispatcherImplTest.java b/data-protocols/dsp/dsp-http-core/src/test/java/org/eclipse/edc/protocol/dsp/dispatcher/DspHttpRemoteMessageDispatcherImplTest.java
index 0873b7e025e..eac73a9c152 100644
--- a/data-protocols/dsp/dsp-http-core/src/test/java/org/eclipse/edc/protocol/dsp/dispatcher/DspHttpRemoteMessageDispatcherImplTest.java
+++ b/data-protocols/dsp/dsp-http-core/src/test/java/org/eclipse/edc/protocol/dsp/dispatcher/DspHttpRemoteMessageDispatcherImplTest.java
@@ -60,7 +60,7 @@ class DspHttpRemoteMessageDispatcherImplTest {
private final PolicyEngine policyEngine = mock();
private final TokenDecorator tokenDecorator = mock();
private final DspHttpRequestFactory requestFactory = mock();
- private final DspHttpDispatcherDelegate delegate = mock();
+ private final DspHttpDispatcherDelegate delegate = mock();
private final Duration timeout = Duration.of(5, SECONDS);
private DspHttpRemoteMessageDispatcher dispatcher;
diff --git a/data-protocols/dsp/dsp-http-spi/src/main/java/org/eclipse/edc/protocol/dsp/spi/dispatcher/DspHttpDispatcherDelegate.java b/data-protocols/dsp/dsp-http-spi/src/main/java/org/eclipse/edc/protocol/dsp/spi/dispatcher/DspHttpDispatcherDelegate.java
index 6f64c407ba0..4309efcd980 100644
--- a/data-protocols/dsp/dsp-http-spi/src/main/java/org/eclipse/edc/protocol/dsp/spi/dispatcher/DspHttpDispatcherDelegate.java
+++ b/data-protocols/dsp/dsp-http-spi/src/main/java/org/eclipse/edc/protocol/dsp/spi/dispatcher/DspHttpDispatcherDelegate.java
@@ -29,10 +29,9 @@
/**
* Delegate for sending a specific type of {@link RemoteMessage} using the dataspace protocol.
*
- * @param the type of message
* @param the response type
*/
-public abstract class DspHttpDispatcherDelegate {
+public abstract class DspHttpDispatcherDelegate {
protected DspHttpDispatcherDelegate() {
}
diff --git a/data-protocols/dsp/dsp-http-spi/src/main/java/org/eclipse/edc/protocol/dsp/spi/dispatcher/DspHttpRemoteMessageDispatcher.java b/data-protocols/dsp/dsp-http-spi/src/main/java/org/eclipse/edc/protocol/dsp/spi/dispatcher/DspHttpRemoteMessageDispatcher.java
index 3f6e97040c8..ce2f1f5aa25 100644
--- a/data-protocols/dsp/dsp-http-spi/src/main/java/org/eclipse/edc/protocol/dsp/spi/dispatcher/DspHttpRemoteMessageDispatcher.java
+++ b/data-protocols/dsp/dsp-http-spi/src/main/java/org/eclipse/edc/protocol/dsp/spi/dispatcher/DspHttpRemoteMessageDispatcher.java
@@ -34,7 +34,7 @@ public interface DspHttpRemoteMessageDispatcher extends RemoteMessageDispatcher
* @param the type of message
* @param the response type
*/
- void registerMessage(Class clazz, DspHttpRequestFactory requestFactory, DspHttpDispatcherDelegate delegate);
+ void registerMessage(Class clazz, DspHttpRequestFactory requestFactory, DspHttpDispatcherDelegate delegate);
/**
* Registers a {@link Policy} scope to be evaluated for certain types of messages
diff --git a/data-protocols/dsp/dsp-http-spi/src/main/java/org/eclipse/edc/protocol/dsp/spi/error/DspErrorResponse.java b/data-protocols/dsp/dsp-http-spi/src/main/java/org/eclipse/edc/protocol/dsp/spi/error/DspErrorResponse.java
index 461d86d6267..c47fcbd7004 100644
--- a/data-protocols/dsp/dsp-http-spi/src/main/java/org/eclipse/edc/protocol/dsp/spi/error/DspErrorResponse.java
+++ b/data-protocols/dsp/dsp-http-spi/src/main/java/org/eclipse/edc/protocol/dsp/spi/error/DspErrorResponse.java
@@ -47,10 +47,6 @@ public Response from(ServiceFailure failure) {
return internalBuild(code, failure.getMessages());
}
- public Response unauthorized() {
- return internalBuild(Response.Status.UNAUTHORIZED, List.of("Token validation failed."));
- }
-
public Response badRequest() {
return internalBuild(Response.Status.BAD_REQUEST, List.of("Bad request."));
}
diff --git a/data-protocols/dsp/dsp-http-spi/src/test/java/org/eclipse/edc/protocol/dsp/spi/dispatcher/DspHttpDispatcherDelegateTest.java b/data-protocols/dsp/dsp-http-spi/src/test/java/org/eclipse/edc/protocol/dsp/spi/dispatcher/DspHttpDispatcherDelegateTest.java
index 48d9847596d..63f7378a674 100644
--- a/data-protocols/dsp/dsp-http-spi/src/test/java/org/eclipse/edc/protocol/dsp/spi/dispatcher/DspHttpDispatcherDelegateTest.java
+++ b/data-protocols/dsp/dsp-http-spi/src/test/java/org/eclipse/edc/protocol/dsp/spi/dispatcher/DspHttpDispatcherDelegateTest.java
@@ -21,7 +21,6 @@
import okhttp3.ResponseBody;
import org.eclipse.edc.protocol.dsp.spi.serialization.JsonLdRemoteMessageSerializer;
import org.eclipse.edc.spi.response.ResponseFailure;
-import org.eclipse.edc.spi.types.domain.message.RemoteMessage;
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.Test;
@@ -88,7 +87,7 @@ void handleResponse_shouldReturnRetryError_whenResponseIsServerError() {
verifyNoInteractions(parser);
}
- private class TestDspHttpDispatcherDelegate extends DspHttpDispatcherDelegate {
+ private class TestDspHttpDispatcherDelegate extends DspHttpDispatcherDelegate