From 1a37d68fbbeeb1c7007f9b12edc1b33facdee632 Mon Sep 17 00:00:00 2001 From: ieuna Date: Thu, 13 Jun 2024 17:07:18 +0300 Subject: [PATCH] Removed unused code --- .github/workflows/verify-backend-service.yaml | 1 + .../tractusx/mxd/backendservice/entity/Content.java | 7 ------- .../tractusx/mxd/backendservice/entity/Transfer.java | 6 ++++++ .../mxd/backendservice/service/HttpConnectionService.java | 1 - .../mxd/backendservice/store/TransferStoreService.java | 1 - 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/verify-backend-service.yaml b/.github/workflows/verify-backend-service.yaml index e7568bff..ab4449c0 100644 --- a/.github/workflows/verify-backend-service.yaml +++ b/.github/workflows/verify-backend-service.yaml @@ -17,6 +17,7 @@ on: push: branches: - main + - feat/backend-service pull_request: branches: diff --git a/mxd/backend-service/src/main/java/org/eclipse/tractusx/mxd/backendservice/entity/Content.java b/mxd/backend-service/src/main/java/org/eclipse/tractusx/mxd/backendservice/entity/Content.java index 81ee44bd..633847d9 100644 --- a/mxd/backend-service/src/main/java/org/eclipse/tractusx/mxd/backendservice/entity/Content.java +++ b/mxd/backend-service/src/main/java/org/eclipse/tractusx/mxd/backendservice/entity/Content.java @@ -60,12 +60,5 @@ public Builder data(String data) { public Builder self() { return this; } - - @Override - public Content build() { - super.build(); - - return entity; - } } } diff --git a/mxd/backend-service/src/main/java/org/eclipse/tractusx/mxd/backendservice/entity/Transfer.java b/mxd/backend-service/src/main/java/org/eclipse/tractusx/mxd/backendservice/entity/Transfer.java index d36aa01c..1e251fff 100644 --- a/mxd/backend-service/src/main/java/org/eclipse/tractusx/mxd/backendservice/entity/Transfer.java +++ b/mxd/backend-service/src/main/java/org/eclipse/tractusx/mxd/backendservice/entity/Transfer.java @@ -21,6 +21,8 @@ import java.util.Map; +import static java.util.Objects.requireNonNull; + @JsonDeserialize(builder = Transfer.Builder.class) public class Transfer extends Entity { @@ -98,6 +100,10 @@ public Builder self() { @Override public Transfer build() { super.build(); + requireNonNull(entity.id); + requireNonNull(entity.endpoint); + requireNonNull(entity.authKey); + requireNonNull(entity.authCode); return entity; } } diff --git a/mxd/backend-service/src/main/java/org/eclipse/tractusx/mxd/backendservice/service/HttpConnectionService.java b/mxd/backend-service/src/main/java/org/eclipse/tractusx/mxd/backendservice/service/HttpConnectionService.java index 4f83d60b..34ba0ca3 100644 --- a/mxd/backend-service/src/main/java/org/eclipse/tractusx/mxd/backendservice/service/HttpConnectionService.java +++ b/mxd/backend-service/src/main/java/org/eclipse/tractusx/mxd/backendservice/service/HttpConnectionService.java @@ -14,7 +14,6 @@ package org.eclipse.tractusx.mxd.backendservice.service; -import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; import org.eclipse.edc.spi.http.EdcHttpClient; diff --git a/mxd/backend-service/src/main/java/org/eclipse/tractusx/mxd/backendservice/store/TransferStoreService.java b/mxd/backend-service/src/main/java/org/eclipse/tractusx/mxd/backendservice/store/TransferStoreService.java index 0049a16e..588d5021 100644 --- a/mxd/backend-service/src/main/java/org/eclipse/tractusx/mxd/backendservice/store/TransferStoreService.java +++ b/mxd/backend-service/src/main/java/org/eclipse/tractusx/mxd/backendservice/store/TransferStoreService.java @@ -27,7 +27,6 @@ @ExtensionPoint public interface TransferStoreService { - String CONTRACT_EXISTS = "Transfer with ID %s already exists"; String CONTRACT_NOT_FOUND = "Transfer with ID %s not found"; /**