From 1f042cce292f884b77e210af65ec703c4c189c16 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Tue, 14 May 2024 10:34:00 +0200 Subject: [PATCH 1/4] chore(exception):837 fix import. --- .../importpoc/validation/JsonFileValidator.java | 2 +- .../domain/importpoc/service/DtrService.java | 16 +++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/importpoc/validation/JsonFileValidator.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/importpoc/validation/JsonFileValidator.java index 36a3630c63..8c8465dc21 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/importpoc/validation/JsonFileValidator.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/application/importpoc/validation/JsonFileValidator.java @@ -90,7 +90,7 @@ public List isValid(MultipartFile file) { reader.close(); } catch (ProcessingException | IOException e) { - throw new JsonFileProcessingException(e); + return List.of("Json file is not processable." + e.getMessage()); } errors.addAll(validateAspectPayload(file)); return errors; diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/DtrService.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/DtrService.java index 85280e451c..4b043e6b44 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/DtrService.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/domain/importpoc/service/DtrService.java @@ -29,7 +29,6 @@ import org.eclipse.tractusx.irs.component.assetadministrationshell.SecurityAttribute; import org.eclipse.tractusx.irs.component.assetadministrationshell.SemanticId; import org.eclipse.tractusx.irs.component.assetadministrationshell.SubmodelDescriptor; -import org.eclipse.tractusx.irs.component.enums.BomLifecycle; import org.eclipse.tractusx.irs.registryclient.decentral.DigitalTwinRegistryCreateShellService; import org.eclipse.tractusx.irs.registryclient.decentral.exception.CreateDtrShellException; import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; @@ -145,18 +144,7 @@ private AssetAdministrationShellDescriptor aasFrom(AssetBase assetBase, List aasIdentifiersFromAsset(AssetBase assetBase) { - final String digitalTwinType = assetBase.getBomLifecycle().equals(BomLifecycle.AS_BUILT) ? "PartInstance" : "PartType"; - - return List.of( - IdentifierKeyValuePair.builder() - .name("digitalTwinType") - .value(digitalTwinType) - .externalSubjectId( - Reference.builder() - .type(EXTERNAL_REFERENCE) - .keys(getExternalSubjectIds()) - .build()) - .build(), + List identifierKeyValuePairs = List.of( IdentifierKeyValuePair.builder() .name("manufacturerId") .value(assetBase.getManufacturerId()) @@ -176,6 +164,8 @@ List aasIdentifiersFromAsset(AssetBase assetBase) { .build()) .build() ); + log.info("IdentifierKeyValuePair {}", identifierKeyValuePairs); + return identifierKeyValuePairs; } private List getExternalSubjectIds() { From bbc064e5756d8614ccd0332d60d6dde04dcfdde2 Mon Sep 17 00:00:00 2001 From: Lucas Capellino <137265091+ds-lcapellino@users.noreply.github.com> Date: Tue, 14 May 2024 10:50:05 +0200 Subject: [PATCH 2/4] Revert "chore-xxx: removed mock class" --- CHANGELOG.md | 4 - .../common/config/PolicyStartUpConfig.java | 8 +- .../FeignDiscoveryRepositoryImpl.java | 2 +- .../EdcNotificationMockServiceImpl.java | 41 ++ .../service/EdcNotificationServiceImpl.java | 2 + .../application-integration-spring-boot.yml | 4 +- .../common/config/RestitoConfig.java | 4 +- .../support/DiscoveryFinderSupport.java | 79 --- .../common/support/EdcSupport.java | 114 --- .../common/support/RestitoProvider.java | 9 - .../alert/PublisherAlertsControllerIT.java | 51 +- .../PublisherInvestigationsControllerIT.java | 49 +- ...scovery_finder_connector_response_200.json | 8 - .../discovery_finder_response_200.json | 11 - .../catalog_response_200.json | 653 ------------------ ...actagreement_negotiation_response_200.json | 2 +- .../contractnegotiation_response_200.json | 13 - ...ractnegotiationonlystate_response_200.json | 12 - ...contractnegotiationstate_response_200.json | 20 - .../transferprocesses_response_200.json | 13 - ...ansferprocessesonlystate_response_200.json | 12 - .../transferprocessesstate_response_200.json | 24 - 22 files changed, 77 insertions(+), 1058 deletions(-) create mode 100644 tx-backend/src/main/java/org/eclipse/tractusx/traceability/notification/domain/base/service/EdcNotificationMockServiceImpl.java delete mode 100644 tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/DiscoveryFinderSupport.java delete mode 100644 tx-backend/src/test/resources/stubs/discovery.post.data/discovery_finder_connector_response_200.json delete mode 100644 tx-backend/src/test/resources/stubs/discovery.post.data/discovery_finder_response_200.json delete mode 100644 tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/catalog_response_200.json delete mode 100644 tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/contractnegotiation_response_200.json delete mode 100644 tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/contractnegotiationonlystate_response_200.json delete mode 100644 tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/contractnegotiationstate_response_200.json delete mode 100644 tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/transferprocesses_response_200.json delete mode 100644 tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/transferprocessesonlystate_response_200.json delete mode 100644 tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/transferprocessesstate_response_200.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 5590644465..ac5e979dd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,10 +14,6 @@ _**For better traceability add the corresponding GitHub issue number in each cha - #778 return empty PageResult when no contract agreement Ids are found instead of http 404 in /contacts API - #XXX Fixed some sonar issues in frontend application -### Removed - -- XXX Removed EdcNotifiactionMockServiceImpl class and replaced with mocks - ## [11.0.0 - 08.05.2024] ### Added - #844 Validation for BPN to Notification API (Create / Edit), Fixed pagination diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/PolicyStartUpConfig.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/PolicyStartUpConfig.java index 9f26a39e6f..7e8471a767 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/PolicyStartUpConfig.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/common/config/PolicyStartUpConfig.java @@ -42,6 +42,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Lazy; +import org.springframework.context.annotation.Profile; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.web.servlet.config.annotation.EnableWebMvc; @@ -51,6 +52,8 @@ import java.util.List; import java.util.UUID; +import static org.eclipse.tractusx.traceability.common.config.ApplicationProfiles.NOT_INTEGRATION_TESTS; + @Configuration @ConfigurationPropertiesScan(basePackages = "org.eclipse.tractusx.traceability.*") @EnableWebMvc @@ -59,7 +62,7 @@ @Slf4j @EnableJpaRepositories(basePackages = "org.eclipse.tractusx.traceability.*") @RequiredArgsConstructor - +@Profile(NOT_INTEGRATION_TESTS) public class PolicyStartUpConfig { private final AcceptedPoliciesProvider.DefaultAcceptedPoliciesProvider defaultAcceptedPoliciesProvider; @@ -105,7 +108,8 @@ private List createIrsAcceptedPolicies() { private List createOwnAcceptedPolicies(OffsetDateTime offsetDateTime) { List andConstraintList = new ArrayList<>(); List orConstraintList = new ArrayList<>(); - orConstraintList.add(new Constraint(traceabilityProperties.getLeftOperand(), new Operator(OperatorType.fromValue(traceabilityProperties.getOperatorType())), traceabilityProperties.getRightOperand())); + andConstraintList.add(new Constraint(traceabilityProperties.getLeftOperand(), new Operator(OperatorType.fromValue(traceabilityProperties.getOperatorType())), traceabilityProperties.getRightOperand())); + andConstraintList.add(new Constraint(traceabilityProperties.getLeftOperand(), new Operator(OperatorType.fromValue(traceabilityProperties.getOperatorType())), traceabilityProperties.getRightOperand())); List permissions = List.of( new Permission( diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/discovery/infrastructure/repository/FeignDiscoveryRepositoryImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/discovery/infrastructure/repository/FeignDiscoveryRepositoryImpl.java index 689572c879..9adbff4a9a 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/discovery/infrastructure/repository/FeignDiscoveryRepositoryImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/discovery/infrastructure/repository/FeignDiscoveryRepositoryImpl.java @@ -45,7 +45,7 @@ public class FeignDiscoveryRepositoryImpl implements DiscoveryRepository { @Override public Optional retrieveDiscoveryByFinderAndEdcDiscoveryService(String bpn) { - DiscoveryFinderRequest request = new DiscoveryFinderRequest(List.of(bpn)); + DiscoveryFinderRequest request = new DiscoveryFinderRequest(List.of("bpn")); DiscoveryResponse discoveryEndpoints = discoveryFinderClient.findDiscoveryEndpoints(request); List discoveryResults = new ArrayList<>(); discoveryEndpoints.endpoints().forEach(discoveryEndpoint -> { diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/notification/domain/base/service/EdcNotificationMockServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/notification/domain/base/service/EdcNotificationMockServiceImpl.java new file mode 100644 index 0000000000..70929eeb64 --- /dev/null +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/notification/domain/base/service/EdcNotificationMockServiceImpl.java @@ -0,0 +1,41 @@ +/******************************************************************************** + * Copyright (c) 2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.traceability.notification.domain.base.service; + + +import lombok.extern.slf4j.Slf4j; +import org.eclipse.tractusx.traceability.notification.domain.base.model.NotificationMessage; +import org.springframework.context.annotation.Profile; +import org.springframework.stereotype.Service; + +import java.util.concurrent.CompletableFuture; + +import static org.eclipse.tractusx.traceability.common.config.ApplicationProfiles.INTEGRATION_SPRING_BOOT; + +@Slf4j +@Service +@Profile(INTEGRATION_SPRING_BOOT) +public class EdcNotificationMockServiceImpl implements EdcNotificationService { + @Override + public CompletableFuture asyncNotificationMessageExecutor(NotificationMessage message) { + log.info("EdcNotificationMockServiceImpl: {}", message); + return CompletableFuture.completedFuture(message); + } +} diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/notification/domain/base/service/EdcNotificationServiceImpl.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/notification/domain/base/service/EdcNotificationServiceImpl.java index 0354141d70..3dc8a9e8ee 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/notification/domain/base/service/EdcNotificationServiceImpl.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/notification/domain/base/service/EdcNotificationServiceImpl.java @@ -45,11 +45,13 @@ import java.util.concurrent.CompletableFuture; import static org.apache.commons.collections4.ListUtils.emptyIfNull; +import static org.eclipse.tractusx.traceability.common.config.ApplicationProfiles.NOT_INTEGRATION_TESTS; @Slf4j @RequiredArgsConstructor @Service @Transactional(dontRollbackOn = DiscoveryFinderException.class) +@Profile(NOT_INTEGRATION_TESTS) public class EdcNotificationServiceImpl implements EdcNotificationService { private final NotificationsEDCFacade edcFacade; diff --git a/tx-backend/src/main/resources/application-integration-spring-boot.yml b/tx-backend/src/main/resources/application-integration-spring-boot.yml index 9f720c62d8..003db57566 100644 --- a/tx-backend/src/main/resources/application-integration-spring-boot.yml +++ b/tx-backend/src/main/resources/application-integration-spring-boot.yml @@ -24,8 +24,8 @@ traceability: url: localhost:${server.port}/api leftOperand: "PURPOSE" operatorType: "eq" - rightOperand: "ID 3.0 Trace" - validUntil: "2050-07-04T16:01:05.309Z" + rightOperand: "ID Trace 3.1" + validUntil: "2023-07-04T16:01:05.309Z" adminApiKey: testAdminKey regularApiKey: testRegularKey irsBase: "http://127.0.0.1" diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/config/RestitoConfig.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/config/RestitoConfig.java index 53a14d1c3d..eb9b41cb34 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/config/RestitoConfig.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/config/RestitoConfig.java @@ -49,7 +49,6 @@ public static class Initializer implements ApplicationContextInitializer additionalProperties = new HashMap<>(); - additionalProperties.put("additionalProperty1", "value1"); - EndpointDataReference endpointDataReference = EndpointDataReference.Builder - .newInstance() - .id("id") - .endpoint("http://localhost:" + RestitoConfig.getStubServer().getPort() + "/endpointdatareference") - .authKey("X-Api-Key") - .authCode("integration-tests") - .properties(additionalProperties) - .build(); - - endpointDataReferenceStorage.put("NmYxMjk2ZmUtYmRlZS00ZTViLTk0NzktOWU0YmQyYWYyNGQ3:ZDBjZGUzYjktOWEwMS00N2QzLTgwNTgtOTU2MjgyOGY2ZDBm:YjYxMjcxM2MtNjdkNC00N2JlLWI0NjMtNDdjNjk4YTk1Mjky", endpointDataReference); - } public void edcWillCreateNotificationAsset() { whenHttp(restitoProvider.stubServer()).match( post("/management/v2/assets"), @@ -118,16 +83,6 @@ public void edcWillRemoveNotificationAsset() { ); } - public void edcWillReturnCatalog() { - whenHttp(restitoProvider.stubServer()).match( - post("/management/v2/catalog/request"), - EDC_API_KEY_HEADER - ).then( - status(HttpStatus.OK_200), - restitoProvider.jsonResponseFromFile("stubs/edc/post/data/contractagreements/catalog_response_200.json") - ); - } - public void edcWillReturnContractAgreements() { whenHttp(restitoProvider.stubServer()).match( post("/management/v2/contractagreements/request"), @@ -245,75 +200,6 @@ public void edcWillFailToCreateContractDefinition() { ); } - public void edcWillCreateContractNegotiation() { - whenHttp(restitoProvider.stubServer()).match( - post("/management/v2/contractnegotiations"), - EDC_API_KEY_HEADER - ).then( - status(HttpStatus.OK_200), - restitoProvider.jsonResponseFromFile("stubs/edc/post/data/contractagreements/contractnegotiation_response_200.json") - ); - } - - public void edcWillReturnContractNegotiationOnlyState() { - whenHttp(restitoProvider.stubServer()).match( - matchesUri(Pattern.compile("/management/v2/contractnegotiations/" + uuidRegex + "/state")), - EDC_API_KEY_HEADER - ).then( - status(HttpStatus.OK_200), - restitoProvider.jsonResponseFromFile("stubs/edc/post/data/contractagreements/contractnegotiationonlystate_response_200.json") - ); - } - - public void edcWillReturnContractNegotiationState() { - whenHttp(restitoProvider.stubServer()).match( - matchesUri(Pattern.compile("/management/v2/contractnegotiations/" + uuidRegex)), - EDC_API_KEY_HEADER - ).then( - status(HttpStatus.OK_200), - restitoProvider.jsonResponseFromFile("stubs/edc/post/data/contractagreements/contractnegotiationstate_response_200.json") - ); - } - - public void edcWillCreateTransferprocesses() { - whenHttp(restitoProvider.stubServer()).match( - post("/management/v2/transferprocesses"), - EDC_API_KEY_HEADER - ).then( - status(HttpStatus.OK_200), - restitoProvider.jsonResponseFromFile("stubs/edc/post/data/contractagreements/transferprocesses_response_200.json") - ); - } - - public void edcWillReturnTransferprocessesOnlyState() { - whenHttp(restitoProvider.stubServer()).match( - matchesUri(Pattern.compile("/management/v2/transferprocesses/" + uuidRegex + "/state")), - EDC_API_KEY_HEADER - ).then( - status(HttpStatus.OK_200), - restitoProvider.jsonResponseFromFile("stubs/edc/post/data/contractagreements/transferprocessesonlystate_response_200.json") - ); - } - - public void edcWillReturnTransferprocessesState() { - whenHttp(restitoProvider.stubServer()).match( - matchesUri(Pattern.compile("/management/v2/transferprocesses/" + uuidRegex)), - EDC_API_KEY_HEADER - - ).then( - status(HttpStatus.OK_200), - restitoProvider.jsonResponseFromFile("stubs/edc/post/data/contractagreements/transferprocessesstate_response_200.json") - ); - } - - public void edcWillSendRequest() { - whenHttp(restitoProvider.stubServer()).match( - post("/endpointdatareference"), - EDC_API_KEY_HEADER - ).then( - status(HttpStatus.OK_200) - ); - } public void verifyCreateNotificationAssetEndpointCalledTimes(int times) { verifyHttp(restitoProvider.stubServer()).times(times, post("/management/v2/assets") diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/RestitoProvider.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/RestitoProvider.java index c675182e3a..39b62bbef0 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/RestitoProvider.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/RestitoProvider.java @@ -23,10 +23,7 @@ import org.eclipse.tractusx.traceability.integration.common.config.RestitoConfig; import org.springframework.stereotype.Component; -import static com.xebialabs.restito.semantics.Action.composite; -import static com.xebialabs.restito.semantics.Action.contentType; import static com.xebialabs.restito.semantics.Action.resourceContent; -import static com.xebialabs.restito.semantics.Action.stringContent; @Component public class RestitoProvider { @@ -38,10 +35,4 @@ public StubServer stubServer() { public Action jsonResponseFromFile(String location) { return resourceContent(location); } - - public Action jsonResponseFromString(String mockResponse) { - return composite(contentType("application/json"), stringContent(mockResponse)); - } - - } diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/notification/alert/PublisherAlertsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/notification/alert/PublisherAlertsControllerIT.java index e8cfd52da9..73ebee8cb0 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/notification/alert/PublisherAlertsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/notification/alert/PublisherAlertsControllerIT.java @@ -19,16 +19,8 @@ package org.eclipse.tractusx.traceability.integration.notification.alert; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; import io.restassured.http.ContentType; import lombok.val; -import notification.request.CloseNotificationRequest; -import notification.request.NotificationSeverityRequest; -import notification.request.NotificationTypeRequest; -import notification.request.StartNotificationRequest; -import notification.request.UpdateNotificationStatusRequest; -import notification.request.UpdateNotificationStatusTransitionRequest; import org.apache.commons.lang3.RandomStringUtils; import org.eclipse.tractusx.traceability.assets.domain.asbuilt.repository.AssetAsBuiltRepository; import org.eclipse.tractusx.traceability.assets.domain.asplanned.repository.AssetAsPlannedRepository; @@ -41,11 +33,7 @@ import org.eclipse.tractusx.traceability.integration.common.support.AlertNotificationsSupport; import org.eclipse.tractusx.traceability.integration.common.support.AlertsSupport; import org.eclipse.tractusx.traceability.integration.common.support.AssetsSupport; -import org.eclipse.tractusx.traceability.integration.common.support.DiscoveryFinderSupport; -import org.eclipse.tractusx.traceability.integration.common.support.EdcSupport; -import org.eclipse.tractusx.traceability.integration.common.support.IrsApiSupport; import org.eclipse.tractusx.traceability.integration.common.support.NotificationApiSupport; -import org.eclipse.tractusx.traceability.integration.common.support.OAuth2ApiSupport; import org.eclipse.tractusx.traceability.notification.domain.base.model.NotificationAffectedPart; import org.eclipse.tractusx.traceability.notification.domain.base.model.NotificationMessage; import org.eclipse.tractusx.traceability.notification.domain.base.model.NotificationSeverity; @@ -60,6 +48,14 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; +import org.testcontainers.shaded.com.fasterxml.jackson.core.JsonProcessingException; +import org.testcontainers.shaded.com.fasterxml.jackson.databind.ObjectMapper; +import notification.request.CloseNotificationRequest; +import notification.request.NotificationSeverityRequest; +import notification.request.NotificationTypeRequest; +import notification.request.StartNotificationRequest; +import notification.request.UpdateNotificationStatusTransitionRequest; +import notification.request.UpdateNotificationStatusRequest; import java.time.Instant; import java.util.Collections; @@ -87,18 +83,6 @@ class PublisherAlertsControllerIT extends IntegrationTestSpecification { @Autowired NotificationApiSupport notificationApiSupport; - @Autowired - EdcSupport edcSupport; - - @Autowired - DiscoveryFinderSupport discoveryFinderSupport; - - @Autowired - OAuth2ApiSupport oauth2ApiSupport; - - @Autowired - IrsApiSupport irsApiSupport; - @BeforeEach void setUp() { objectMapper = new ObjectMapper(); @@ -297,7 +281,7 @@ void givenWrongStatus_whenUpdateAlert_thenBadRequest() throws JsonProcessingExce } @Test - void shouldCancelAlert() throws JoseException, JsonProcessingException { + void shouldCancelAlert() throws JsonProcessingException, JoseException, com.fasterxml.jackson.core.JsonProcessingException { // given String filterString = "channel,EQUAL,SENDER,AND"; assetsSupport.defaultAssetsStored(); @@ -348,13 +332,8 @@ void shouldCancelAlert() throws JoseException, JsonProcessingException { } @Test - void shouldApproveAlertStatus() throws JoseException, JsonProcessingException { + void shouldApproveAlertStatus() throws JsonProcessingException, JoseException, com.fasterxml.jackson.core.JsonProcessingException { // given - irsApiSupport.irsApiReturnsPolicies(); - discoveryFinderSupport.discoveryFinderWillReturnEndpointAddress(); - discoveryFinderSupport.discoveryFinderWillReturnConnectorEndpoints(); - oauth2ApiSupport.oauth2ApiReturnsDtrToken(); - edcSupport.performSupportActionsForAsyncNotificationMessageExecutor(); String filterString = "channel,EQUAL,SENDER,AND"; List partIds = List.of( "urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978", // BPN: BPNL00000003AYRE @@ -403,14 +382,8 @@ void shouldApproveAlertStatus() throws JoseException, JsonProcessingException { } @Test - void shouldCloseAlertStatus() throws JoseException, JsonProcessingException { + void shouldCloseAlertStatus() throws JsonProcessingException, JoseException, com.fasterxml.jackson.core.JsonProcessingException { // given - irsApiSupport.irsApiReturnsPolicies(); - discoveryFinderSupport.discoveryFinderWillReturnEndpointAddress(); - discoveryFinderSupport.discoveryFinderWillReturnConnectorEndpoints(); - oauth2ApiSupport.oauth2ApiReturnsDtrToken(); - edcSupport.performSupportActionsForAsyncNotificationMessageExecutor(); - String filterString = "channel,EQUAL,SENDER,AND"; List partIds = List.of( "urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978" // BPN: BPNL00000003AYRE @@ -514,7 +487,7 @@ void givenNoAuthorization_whenCancel_thenReturn401() { } @Test - void shouldBeCreatedBySender() throws JoseException, JsonProcessingException { + void shouldBeCreatedBySender() throws JsonProcessingException, JoseException, com.fasterxml.jackson.core.JsonProcessingException { // given String filterString = "channel,EQUAL,SENDER,AND"; List partIds = List.of( diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/notification/investigation/PublisherInvestigationsControllerIT.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/notification/investigation/PublisherInvestigationsControllerIT.java index 7dbad99cbb..3632471db1 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/notification/investigation/PublisherInvestigationsControllerIT.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/notification/investigation/PublisherInvestigationsControllerIT.java @@ -19,9 +19,6 @@ package org.eclipse.tractusx.traceability.integration.notification.investigation; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; import io.restassured.http.ContentType; import lombok.val; import notification.request.CloseNotificationRequest; @@ -39,13 +36,9 @@ import org.eclipse.tractusx.traceability.common.security.JwtRole; import org.eclipse.tractusx.traceability.integration.IntegrationTestSpecification; import org.eclipse.tractusx.traceability.integration.common.support.AssetsSupport; -import org.eclipse.tractusx.traceability.integration.common.support.DiscoveryFinderSupport; -import org.eclipse.tractusx.traceability.integration.common.support.EdcSupport; -import org.eclipse.tractusx.traceability.integration.common.support.IrsApiSupport; import org.eclipse.tractusx.traceability.integration.common.support.NotificationApiSupport; import org.eclipse.tractusx.traceability.integration.common.support.NotificationMessageSupport; import org.eclipse.tractusx.traceability.integration.common.support.NotificationSupport; -import org.eclipse.tractusx.traceability.integration.common.support.OAuth2ApiSupport; import org.eclipse.tractusx.traceability.notification.domain.base.model.NotificationAffectedPart; import org.eclipse.tractusx.traceability.notification.domain.base.model.NotificationMessage; import org.eclipse.tractusx.traceability.notification.domain.base.model.NotificationSeverity; @@ -60,6 +53,8 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; +import org.testcontainers.shaded.com.fasterxml.jackson.core.JsonProcessingException; +import org.testcontainers.shaded.com.fasterxml.jackson.databind.ObjectMapper; import java.time.Instant; import java.util.Collections; @@ -84,17 +79,6 @@ class PublisherInvestigationsControllerIT extends IntegrationTestSpecification { AssetAsBuiltRepository assetAsBuiltRepository; @Autowired NotificationApiSupport notificationApiSupport; - @Autowired - EdcSupport edcSupport; - - @Autowired - DiscoveryFinderSupport discoveryFinderSupport; - - @Autowired - OAuth2ApiSupport oauth2ApiSupport; - - @Autowired - IrsApiSupport irsApiSupport; ObjectMapper objectMapper; @@ -136,7 +120,7 @@ void shouldReceiveNotification() { } @Test - void shouldStartInvestigation() throws JoseException, JsonProcessingException { + void shouldStartInvestigation() throws JoseException, com.fasterxml.jackson.core.JsonProcessingException { // given @@ -178,7 +162,7 @@ void shouldStartInvestigation() throws JoseException, JsonProcessingException { } @Test - void givenMissingPartIds_whenStartInvestigation_thenBadRequest() throws JoseException, JsonProcessingException { + void givenMissingPartIds_whenStartInvestigation_thenBadRequest() throws JoseException, com.fasterxml.jackson.core.JsonProcessingException { // given @@ -199,7 +183,7 @@ void givenMissingPartIds_whenStartInvestigation_thenBadRequest() throws JoseExce } @Test - void givenMissingBPN_whenStartInvestigation_thenBadRequest() throws JoseException, JsonProcessingException { + void givenMissingBPN_whenStartInvestigation_thenBadRequest() throws JoseException, com.fasterxml.jackson.core.JsonProcessingException { // given @@ -226,7 +210,7 @@ void givenMissingBPN_whenStartInvestigation_thenBadRequest() throws JoseExceptio } @Test - void givenMissingSeverity_whenStartInvestigation_thenBadRequest() throws JoseException, JsonProcessingException { + void givenMissingSeverity_whenStartInvestigation_thenBadRequest() throws JsonProcessingException, JoseException { // given List partIds = List.of( "urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978", // BPN: BPNL00000003AYRE @@ -251,7 +235,7 @@ void givenMissingSeverity_whenStartInvestigation_thenBadRequest() throws JoseExc } @Test - void givenDescriptionExceedsMaxLength_whenStartInvestigation_thenBadRequest() throws JoseException, JsonProcessingException { + void givenDescriptionExceedsMaxLength_whenStartInvestigation_thenBadRequest() throws JsonProcessingException, JoseException { // given List partIds = List.of( "urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978", // BPN: BPNL00000003AYRE @@ -329,7 +313,7 @@ void givenWrongStatus_whenUpdateInvestigation_thenBadRequest() throws JsonProces } @Test - void shouldCancelInvestigation() throws JoseException, JsonProcessingException { + void shouldCancelInvestigation() throws JsonProcessingException, JoseException, com.fasterxml.jackson.core.JsonProcessingException { // given assetsSupport.defaultAssetsStored(); val startInvestigationRequest = StartNotificationRequest.builder() @@ -376,13 +360,8 @@ void shouldCancelInvestigation() throws JoseException, JsonProcessingException { } @Test - void shouldApproveInvestigationStatus() throws JoseException, JsonProcessingException { + void shouldApproveInvestigationStatus() throws JsonProcessingException, JoseException, com.fasterxml.jackson.core.JsonProcessingException { // given - irsApiSupport.irsApiReturnsPolicies(); - discoveryFinderSupport.discoveryFinderWillReturnEndpointAddress(); - discoveryFinderSupport.discoveryFinderWillReturnConnectorEndpoints(); - oauth2ApiSupport.oauth2ApiReturnsDtrToken(); - edcSupport.performSupportActionsForAsyncNotificationMessageExecutor(); List partIds = List.of( "urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978", // BPN: BPNL00000003AYRE "urn:uuid:0ce83951-bc18-4e8f-892d-48bad4eb67ef" // BPN: BPNL00000003AXS3 @@ -431,14 +410,8 @@ void shouldApproveInvestigationStatus() throws JoseException, JsonProcessingExce } @Test - void shouldCloseInvestigationStatus() throws JoseException, JsonProcessingException { + void shouldCloseInvestigationStatus() throws JsonProcessingException, JoseException, com.fasterxml.jackson.core.JsonProcessingException { // given - irsApiSupport.irsApiReturnsPolicies(); - discoveryFinderSupport.discoveryFinderWillReturnEndpointAddress(); - discoveryFinderSupport.discoveryFinderWillReturnConnectorEndpoints(); - oauth2ApiSupport.oauth2ApiReturnsDtrToken(); - edcSupport.performSupportActionsForAsyncNotificationMessageExecutor(); - List partIds = List.of( "urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978" // BPN: BPNL00000003AYRE ); @@ -539,7 +512,7 @@ void givenNoAuthorization_whenCancel_thenReturn401() { } @Test - void shouldBeCreatedBySender() throws JoseException, JsonProcessingException { + void shouldBeCreatedBySender() throws JsonProcessingException, JoseException, com.fasterxml.jackson.core.JsonProcessingException { // given List partIds = List.of( "urn:uuid:fe99da3d-b0de-4e80-81da-882aebcca978", // BPN: BPNL00000003AYRE diff --git a/tx-backend/src/test/resources/stubs/discovery.post.data/discovery_finder_connector_response_200.json b/tx-backend/src/test/resources/stubs/discovery.post.data/discovery_finder_connector_response_200.json deleted file mode 100644 index f0aae5f8b8..0000000000 --- a/tx-backend/src/test/resources/stubs/discovery.post.data/discovery_finder_connector_response_200.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "bpn": "BPNL00000003CNKC", - "connectorEndpoint": [ - "${Placeholder}" - ] - } -] diff --git a/tx-backend/src/test/resources/stubs/discovery.post.data/discovery_finder_response_200.json b/tx-backend/src/test/resources/stubs/discovery.post.data/discovery_finder_response_200.json deleted file mode 100644 index dc21f297cf..0000000000 --- a/tx-backend/src/test/resources/stubs/discovery.post.data/discovery_finder_response_200.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "endpoints": [ - { - "type": "bpn", - "description": "Service to discover EDC to a particular BPN", - "endpointAddress": "${Placeholder}", - "documentation": "http://.../swagger/index.html", - "resourceId": "316417cd-0fb5-4daf-8dfa-8f68125923f1" - } - ] -} diff --git a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/catalog_response_200.json b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/catalog_response_200.json deleted file mode 100644 index 2ca33b3357..0000000000 --- a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/catalog_response_200.json +++ /dev/null @@ -1,653 +0,0 @@ -{ - "@id": "1c4edfcd-d772-4a95-9d24-c549ee8f69cc", - "@type": "dcat:Catalog", - "dcat:dataset": [ - { - "@id": "d0cde3b9-9a01-47d3-8058-9562828f6d0f", - "@type": "dcat:Dataset", - "odrl:hasPolicy": { - "@id": "NmYxMjk2ZmUtYmRlZS00ZTViLTk0NzktOWU0YmQyYWYyNGQ3:ZDBjZGUzYjktOWEwMS00N2QzLTgwNTgtOTU2MjgyOGY2ZDBm:MTJjNjRlNmQtMzdlYi00NWQ4LTg1YTItYjAyM2ZjOTRiMmJj", - "@type": "odrl:Set", - "odrl:permission": { - "odrl:target": "d0cde3b9-9a01-47d3-8058-9562828f6d0f", - "odrl:action": { - "odrl:type": "USE" - }, - "odrl:constraint": { - "odrl:or": [ - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "ID 3.0 Trace" - }, - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "ID 3.1 Trace" - }, - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "R2_Traceability" - }, - { - "odrl:leftOperand": "FrameworkAgreement.traceability", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "active" - }, - { - "odrl:leftOperand": "Membership", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "active" - } - ] - } - }, - "odrl:prohibition": [], - "odrl:obligation": [], - "odrl:target": "d0cde3b9-9a01-47d3-8058-9562828f6d0f" - }, - "dcat:distribution": [ - { - "@type": "dcat:Distribution", - "dct:format": { - "@id": "HttpProxy" - }, - "dcat:accessService": "b57e72e4-e7a0-4c5f-b447-41921a61aa92" - }, - { - "@type": "dcat:Distribution", - "dct:format": { - "@id": "AmazonS3" - }, - "dcat:accessService": "b57e72e4-e7a0-4c5f-b447-41921a61aa92" - } - ], - "edc:type": "qualityalert", - "edc:notificationtype": "qualityalert", - "edc:policy-id": "use-eu", - "edc:description": "QUALITY_ALERT RECEIVE", - "edc:id": "d0cde3b9-9a01-47d3-8058-9562828f6d0f", - "edc:contenttype": "application/json", - "edc:notificationmethod": "receive" - }, - { - "@id": "1d24ae52-be16-4a68-88c4-d5691bd66a67", - "@type": "dcat:Dataset", - "odrl:hasPolicy": { - "@id": "NDEyM2U4MTMtN2Q3ZC00NTg4LWI5YTUtY2ZmNDE5YzE1NjU3:MWQyNGFlNTItYmUxNi00YTY4LTg4YzQtZDU2OTFiZDY2YTY3:ZjgyMmExZjgtMWI0Ny00NmJlLWEzYzQtYzY5MDg4ZjBhNzk0", - "@type": "odrl:Set", - "odrl:permission": { - "odrl:target": "1d24ae52-be16-4a68-88c4-d5691bd66a67", - "odrl:action": { - "odrl:type": "USE" - }, - "odrl:constraint": { - "odrl:or": [ - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "ID 3.0 Trace" - }, - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "ID 3.1 Trace" - }, - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "R2_Traceability" - }, - { - "odrl:leftOperand": "FrameworkAgreement.traceability", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "active" - }, - { - "odrl:leftOperand": "Membership", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "active" - } - ] - } - }, - "odrl:prohibition": [], - "odrl:obligation": [], - "odrl:target": "1d24ae52-be16-4a68-88c4-d5691bd66a67" - }, - "dcat:distribution": [ - { - "@type": "dcat:Distribution", - "dct:format": { - "@id": "HttpProxy" - }, - "dcat:accessService": "b57e72e4-e7a0-4c5f-b447-41921a61aa92" - }, - { - "@type": "dcat:Distribution", - "dct:format": { - "@id": "AmazonS3" - }, - "dcat:accessService": "b57e72e4-e7a0-4c5f-b447-41921a61aa92" - } - ], - "edc:type": "qualityalert", - "edc:notificationtype": "qualityalert", - "edc:policy-id": "use-eu", - "edc:description": "QUALITY_ALERT RECEIVE", - "edc:id": "1d24ae52-be16-4a68-88c4-d5691bd66a67", - "edc:contenttype": "application/json", - "edc:notificationmethod": "receive" - }, - { - "@id": "81c2c9c8-8df4-4dd8-aec8-e3d1ab3ab48d", - "@type": "dcat:Dataset", - "odrl:hasPolicy": { - "@id": "OGFlNDY0NDUtOTlhZC00ZWVlLWFjMjItM2Y4MjEwNjI2NzEy:ODFjMmM5YzgtOGRmNC00ZGQ4LWFlYzgtZTNkMWFiM2FiNDhk:MGVkZmZjNjUtNDI0Yi00NTE1LWExOTUtZjVhMGE2Y2UzOTg3", - "@type": "odrl:Set", - "odrl:permission": { - "odrl:target": "81c2c9c8-8df4-4dd8-aec8-e3d1ab3ab48d", - "odrl:action": { - "odrl:type": "USE" - }, - "odrl:constraint": { - "odrl:or": [ - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "ID 3.0 Trace" - }, - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "ID 3.1 Trace" - }, - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "R2_Traceability" - }, - { - "odrl:leftOperand": "FrameworkAgreement.traceability", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "active" - }, - { - "odrl:leftOperand": "Membership", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "active" - } - ] - } - }, - "odrl:prohibition": [], - "odrl:obligation": [], - "odrl:target": "81c2c9c8-8df4-4dd8-aec8-e3d1ab3ab48d" - }, - "dcat:distribution": [ - { - "@type": "dcat:Distribution", - "dct:format": { - "@id": "HttpProxy" - }, - "dcat:accessService": "b57e72e4-e7a0-4c5f-b447-41921a61aa92" - }, - { - "@type": "dcat:Distribution", - "dct:format": { - "@id": "AmazonS3" - }, - "dcat:accessService": "b57e72e4-e7a0-4c5f-b447-41921a61aa92" - } - ], - "edc:notificationtype": "qualityalert", - "edc:type": "qualityalert", - "edc:policy-id": "use-eu", - "edc:description": "QUALITY_ALERT RECEIVE", - "edc:id": "81c2c9c8-8df4-4dd8-aec8-e3d1ab3ab48d", - "edc:contenttype": "application/json", - "edc:notificationmethod": "receive" - }, - { - "@id": "3bb053ef-5490-4bfd-994a-1ce3f023c0ae", - "@type": "dcat:Dataset", - "odrl:hasPolicy": { - "@id": "NTFkZmQ2ZDktZGQ0OS00Y2FkLWJhN2EtZDkwODI0YmMyYzlk:M2JiMDUzZWYtNTQ5MC00YmZkLTk5NGEtMWNlM2YwMjNjMGFl:ZWE0NzgyMWMtNzFiOC00Yjc3LThlM2YtNDU4ZWI2NGYwNzhk", - "@type": "odrl:Set", - "odrl:permission": { - "odrl:target": "3bb053ef-5490-4bfd-994a-1ce3f023c0ae", - "odrl:action": { - "odrl:type": "USE" - }, - "odrl:constraint": { - "odrl:or": [ - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "ID 3.0 Trace" - }, - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "ID 3.1 Trace" - }, - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "R2_Traceability" - }, - { - "odrl:leftOperand": "FrameworkAgreement.traceability", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "active" - }, - { - "odrl:leftOperand": "Membership", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "active" - } - ] - } - }, - "odrl:prohibition": [], - "odrl:obligation": [], - "odrl:target": "3bb053ef-5490-4bfd-994a-1ce3f023c0ae" - }, - "dcat:distribution": [ - { - "@type": "dcat:Distribution", - "dct:format": { - "@id": "HttpProxy" - }, - "dcat:accessService": "b57e72e4-e7a0-4c5f-b447-41921a61aa92" - }, - { - "@type": "dcat:Distribution", - "dct:format": { - "@id": "AmazonS3" - }, - "dcat:accessService": "b57e72e4-e7a0-4c5f-b447-41921a61aa92" - } - ], - "edc:type": "qualityalert", - "edc:notificationtype": "qualityalert", - "edc:policy-id": "use-eu", - "edc:description": "QUALITY_ALERT RECEIVE", - "edc:id": "3bb053ef-5490-4bfd-994a-1ce3f023c0ae", - "edc:contenttype": "application/json", - "edc:notificationmethod": "receive" - }, - { - "@id": "1c6fcdd0-8a7d-479f-bf64-96461f5a3573", - "@type": "dcat:Dataset", - "odrl:hasPolicy": { - "@id": "ODM4MDc5NjMtYmNjYy00NDA1LWE4ZWItZGEzYjJmYzZlOTA0:MWM2ZmNkZDAtOGE3ZC00NzlmLWJmNjQtOTY0NjFmNWEzNTcz:MzA1MDFiNDctYjQzYy00NDE5LWIzNGYtY2VlNTdiY2JkMzVj", - "@type": "odrl:Set", - "odrl:permission": { - "odrl:target": "1c6fcdd0-8a7d-479f-bf64-96461f5a3573", - "odrl:action": { - "odrl:type": "USE" - }, - "odrl:constraint": { - "odrl:or": [ - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "ID 3.0 Trace" - }, - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "ID 3.1 Trace" - }, - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "R2_Traceability" - }, - { - "odrl:leftOperand": "FrameworkAgreement.traceability", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "active" - }, - { - "odrl:leftOperand": "Membership", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "active" - } - ] - } - }, - "odrl:prohibition": [], - "odrl:obligation": [], - "odrl:target": "1c6fcdd0-8a7d-479f-bf64-96461f5a3573" - }, - "dcat:distribution": [ - { - "@type": "dcat:Distribution", - "dct:format": { - "@id": "HttpProxy" - }, - "dcat:accessService": "b57e72e4-e7a0-4c5f-b447-41921a61aa92" - }, - { - "@type": "dcat:Distribution", - "dct:format": { - "@id": "AmazonS3" - }, - "dcat:accessService": "b57e72e4-e7a0-4c5f-b447-41921a61aa92" - } - ], - "edc:notificationtype": "qualityalert", - "edc:type": "qualityalert", - "edc:policy-id": "use-eu", - "edc:description": "QUALITY_ALERT RECEIVE", - "edc:id": "1c6fcdd0-8a7d-479f-bf64-96461f5a3573", - "edc:contenttype": "application/json", - "edc:notificationmethod": "receive" - }, - { - "@id": "d28abf01-ac5a-4f2f-907e-ddd27c09e5cb", - "@type": "dcat:Dataset", - "odrl:hasPolicy": { - "@id": "ZmViM2UzNjktYzNkOS00NWE5LWJlNjQtNmJmYTk2ZjU4ODI0:ZDI4YWJmMDEtYWM1YS00ZjJmLTkwN2UtZGRkMjdjMDllNWNi:YzM0ZWZhNGMtMWVkYS00ZDk3LWFlOGUtZmUwNmU5MmViMWJi", - "@type": "odrl:Set", - "odrl:permission": { - "odrl:target": "d28abf01-ac5a-4f2f-907e-ddd27c09e5cb", - "odrl:action": { - "odrl:type": "USE" - }, - "odrl:constraint": { - "odrl:or": [ - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "ID 3.0 Trace" - }, - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "ID 3.1 Trace" - }, - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "R2_Traceability" - }, - { - "odrl:leftOperand": "FrameworkAgreement.traceability", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "active" - }, - { - "odrl:leftOperand": "Membership", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "active" - } - ] - } - }, - "odrl:prohibition": [], - "odrl:obligation": [], - "odrl:target": "d28abf01-ac5a-4f2f-907e-ddd27c09e5cb" - }, - "dcat:distribution": [ - { - "@type": "dcat:Distribution", - "dct:format": { - "@id": "HttpProxy" - }, - "dcat:accessService": "b57e72e4-e7a0-4c5f-b447-41921a61aa92" - }, - { - "@type": "dcat:Distribution", - "dct:format": { - "@id": "AmazonS3" - }, - "dcat:accessService": "b57e72e4-e7a0-4c5f-b447-41921a61aa92" - } - ], - "edc:notificationtype": "qualityalert", - "edc:type": "qualityalert", - "edc:policy-id": "use-eu", - "edc:description": "QUALITY_ALERT RECEIVE", - "edc:id": "d28abf01-ac5a-4f2f-907e-ddd27c09e5cb", - "edc:contenttype": "application/json", - "edc:notificationmethod": "receive" - }, - { - "@id": "0dbb1c29-63ac-458a-89fb-27935abd61e0", - "@type": "dcat:Dataset", - "odrl:hasPolicy": { - "@id": "M2IxMmEwYWYtZjc5ZS00NjVlLWIxY2YtZWRhMjMyODRjMDNh:MGRiYjFjMjktNjNhYy00NThhLTg5ZmItMjc5MzVhYmQ2MWUw:NGJjYzZjYTMtNmQ1ZS00NDNjLTk5MGQtNDM5OWQyZDk4ZTgw", - "@type": "odrl:Set", - "odrl:permission": { - "odrl:target": "0dbb1c29-63ac-458a-89fb-27935abd61e0", - "odrl:action": { - "odrl:type": "USE" - }, - "odrl:constraint": { - "odrl:or": [ - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "ID 3.0 Trace" - }, - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "ID 3.1 Trace" - }, - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "R2_Traceability" - }, - { - "odrl:leftOperand": "FrameworkAgreement.traceability", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "active" - }, - { - "odrl:leftOperand": "Membership", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "active" - } - ] - } - }, - "odrl:prohibition": [], - "odrl:obligation": [], - "odrl:target": "0dbb1c29-63ac-458a-89fb-27935abd61e0" - }, - "dcat:distribution": [ - { - "@type": "dcat:Distribution", - "dct:format": { - "@id": "HttpProxy" - }, - "dcat:accessService": "b57e72e4-e7a0-4c5f-b447-41921a61aa92" - }, - { - "@type": "dcat:Distribution", - "dct:format": { - "@id": "AmazonS3" - }, - "dcat:accessService": "b57e72e4-e7a0-4c5f-b447-41921a61aa92" - } - ], - "edc:type": "qualityalert", - "edc:notificationtype": "qualityalert", - "edc:policy-id": "use-eu", - "edc:description": "QUALITY_ALERT RECEIVE", - "edc:id": "0dbb1c29-63ac-458a-89fb-27935abd61e0", - "edc:contenttype": "application/json", - "edc:notificationmethod": "receive" - }, - { - "@id": "62403fc0-6af0-488e-b0a8-ccb74425a4d0", - "@type": "dcat:Dataset", - "odrl:hasPolicy": { - "@id": "NzU3MTk2ZDItMDgzYS00NGFkLTg4MjItNGY3ZDE0ZTNkMzQ1:NjI0MDNmYzAtNmFmMC00ODhlLWIwYTgtY2NiNzQ0MjVhNGQw:MDEwZWNmYjMtNzA5MC00Mzg0LTllODktMDlhZGU5MzY3OWVj", - "@type": "odrl:Set", - "odrl:permission": { - "odrl:target": "62403fc0-6af0-488e-b0a8-ccb74425a4d0", - "odrl:action": { - "odrl:type": "USE" - }, - "odrl:constraint": { - "odrl:or": [ - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "ID 3.0 Trace" - }, - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "ID 3.1 Trace" - }, - { - "odrl:leftOperand": "PURPOSE", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "R2_Traceability" - }, - { - "odrl:leftOperand": "FrameworkAgreement.traceability", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "active" - }, - { - "odrl:leftOperand": "Membership", - "odrl:operator": { - "@id": "odrl:eq" - }, - "odrl:rightOperand": "active" - } - ] - } - }, - "odrl:prohibition": [], - "odrl:obligation": [], - "odrl:target": "62403fc0-6af0-488e-b0a8-ccb74425a4d0" - }, - "dcat:distribution": [ - { - "@type": "dcat:Distribution", - "dct:format": { - "@id": "HttpProxy" - }, - "dcat:accessService": "b57e72e4-e7a0-4c5f-b447-41921a61aa92" - }, - { - "@type": "dcat:Distribution", - "dct:format": { - "@id": "AmazonS3" - }, - "dcat:accessService": "b57e72e4-e7a0-4c5f-b447-41921a61aa92" - } - ], - "edc:type": "qualityalert", - "edc:notificationtype": "qualityalert", - "edc:policy-id": "use-eu", - "edc:description": "QUALITY_ALERT RECEIVE", - "edc:id": "62403fc0-6af0-488e-b0a8-ccb74425a4d0", - "edc:contenttype": "application/json", - "edc:notificationmethod": "receive" - } - ], - "dcat:service": { - "@id": "b57e72e4-e7a0-4c5f-b447-41921a61aa92", - "@type": "dcat:DataService", - "dct:terms": "connector", - "dct:endpointUrl" : "https://test.net/api/v1/dsp" - }, - "edc:participantId": "BPNL00000003CNKC", - "@context": { - "dct": "https://purl.org/dc/terms/", - "tx": "https://w3id.org/tractusx/v0.0.1/ns/", - "edc": "https://w3id.org/edc/v0.0.1/ns/", - "dcat": "https://www.w3.org/ns/dcat/", - "odrl": "http://www.w3.org/ns/odrl/2/", - "dspace": "https://w3id.org/dspace/v0.8/" - } -} diff --git a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/contractagreement_negotiation_response_200.json b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/contractagreement_negotiation_response_200.json index 346b3dd555..e99e592351 100644 --- a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/contractagreement_negotiation_response_200.json +++ b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/contractagreement_negotiation_response_200.json @@ -5,7 +5,7 @@ "edc:protocol" : "dataspace-protocol-http", "edc:state" : "FINALIZED", "edc:counterPartyId" : "BPNL00000003CML1", - "edc:counterPartyAddress" : "https://test.net/api/v1/dsp", + "edc:counterPartyAddress" : "https://trace-x-edc-e2e-a.dev.demo.catena-x.net/api/v1/dsp", "edc:callbackAddresses" : [], "edc:createdAt" : 1708590580001, "edc:contractAgreementId" : "ODA3MmUyNTQtOGNlZi00YzQ2LTljNGYtNGYzNjE2YjQ5NTZl:cmVnaXN0cnktYXNzZXQ=:MDljNDMzY2EtODI5OS00OGE3LWI0MjYtNzZmZjJmODE1ZWE2", diff --git a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/contractnegotiation_response_200.json b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/contractnegotiation_response_200.json deleted file mode 100644 index cc4104ce95..0000000000 --- a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/contractnegotiation_response_200.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "@type": "edc:IdResponse", - "@id": "cfc7f1e9-fb04-499b-a444-f5f5d41dd789", - "edc:createdAt": 1712912218683, - "@context": { - "dct": "https://purl.org/dc/terms/", - "tx": "https://w3id.org/tractusx/v0.0.1/ns/", - "edc": "https://w3id.org/edc/v0.0.1/ns/", - "dcat": "https://www.w3.org/ns/dcat/", - "odrl": "http://www.w3.org/ns/odrl/2/", - "dspace": "https://w3id.org/dspace/v0.8/" - } -} diff --git a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/contractnegotiationonlystate_response_200.json b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/contractnegotiationonlystate_response_200.json deleted file mode 100644 index fc0f2d397e..0000000000 --- a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/contractnegotiationonlystate_response_200.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "@type": "edc:NegotiationState", - "edc:state": "FINALIZED", - "@context": { - "dct": "https://purl.org/dc/terms/", - "tx": "https://w3id.org/tractusx/v0.0.1/ns/", - "edc": "https://w3id.org/edc/v0.0.1/ns/", - "dcat": "https://www.w3.org/ns/dcat/", - "odrl": "http://www.w3.org/ns/odrl/2/", - "dspace": "https://w3id.org/dspace/v0.8/" - } -} diff --git a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/contractnegotiationstate_response_200.json b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/contractnegotiationstate_response_200.json deleted file mode 100644 index f57fc65aba..0000000000 --- a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/contractnegotiationstate_response_200.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "@type": "edc:ContractNegotiation", - "@id": "cfc7f1e9-fb04-499b-a444-f5f5d41dd789", - "edc:type": "CONSUMER", - "edc:protocol": "dataspace-protocol-http", - "edc:state": "FINALIZED", - "edc:counterPartyId": "BPNL00000003CNKC", - "edc:counterPartyAddress": "https://test.de/api/v1/dsp", - "edc:callbackAddresses": [], - "edc:createdAt": 1712912218683, - "edc:contractAgreementId": "NmYxMjk2ZmUtYmRlZS00ZTViLTk0NzktOWU0YmQyYWYyNGQ3:ZDBjZGUzYjktOWEwMS00N2QzLTgwNTgtOTU2MjgyOGY2ZDBm:YjYxMjcxM2MtNjdkNC00N2JlLWI0NjMtNDdjNjk4YTk1Mjky", - "@context": { - "dct": "https://purl.org/dc/terms/", - "tx": "https://w3id.org/tractusx/v0.0.1/ns/", - "edc": "https://w3id.org/edc/v0.0.1/ns/", - "dcat": "https://www.w3.org/ns/dcat/", - "odrl": "http://www.w3.org/ns/odrl/2/", - "dspace": "https://w3id.org/dspace/v0.8/" - } -} diff --git a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/transferprocesses_response_200.json b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/transferprocesses_response_200.json deleted file mode 100644 index 8cd2a15de9..0000000000 --- a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/transferprocesses_response_200.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "@type": "edc:IdResponse", - "@id": "8a157c93-2dfb-440b-9218-ee456ce5ba10", - "edc:createdAt": 1712913671249, - "@context": { - "dct": "https://purl.org/dc/terms/", - "tx": "https://w3id.org/tractusx/v0.0.1/ns/", - "edc": "https://w3id.org/edc/v0.0.1/ns/", - "dcat": "https://www.w3.org/ns/dcat/", - "odrl": "http://www.w3.org/ns/odrl/2/", - "dspace": "https://w3id.org/dspace/v0.8/" - } -} diff --git a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/transferprocessesonlystate_response_200.json b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/transferprocessesonlystate_response_200.json deleted file mode 100644 index e0f27ce301..0000000000 --- a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/transferprocessesonlystate_response_200.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "@type": "edc:TransferState", - "edc:state": "STARTED", - "@context": { - "dct": "https://purl.org/dc/terms/", - "tx": "https://w3id.org/tractusx/v0.0.1/ns/", - "edc": "https://w3id.org/edc/v0.0.1/ns/", - "dcat": "https://www.w3.org/ns/dcat/", - "odrl": "http://www.w3.org/ns/odrl/2/", - "dspace": "https://w3id.org/dspace/v0.8/" - } -} diff --git a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/transferprocessesstate_response_200.json b/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/transferprocessesstate_response_200.json deleted file mode 100644 index 482b884cdc..0000000000 --- a/tx-backend/src/test/resources/stubs/edc/post/data/contractagreements/transferprocessesstate_response_200.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "@id": "8a157c93-2dfb-440b-9218-ee456ce5ba10", - "@type": "edc:TransferProcess", - "edc:correlationId": "8a157c93-2dfb-440b-9218-ee456ce5ba10", - "edc:state": "STARTED", - "edc:stateTimestamp": 1712913672760, - "edc:type": "CONSUMER", - "edc:assetId": "d0cde3b9-9a01-47d3-8058-9562828f6d0f", - "edc:contractId": "NmYxMjk2ZmUtYmRlZS00ZTViLTk0NzktOWU0YmQyYWYyNGQ3:ZDBjZGUzYjktOWEwMS00N2QzLTgwNTgtOTU2MjgyOGY2ZDBm:YjYxMjcxM2MtNjdkNC00N2JlLWI0NjMtNDdjNjk4YTk1Mjky", - "edc:callbackAddresses": [], - "edc:dataDestination": { - "@type": "edc:DataAddress", - "edc:type": "HttpProxy" - }, - "edc:connectorId": "BPNL00000003CNKC", - "@context": { - "dct": "https://purl.org/dc/terms/", - "tx": "https://w3id.org/tractusx/v0.0.1/ns/", - "edc": "https://w3id.org/edc/v0.0.1/ns/", - "dcat": "https://www.w3.org/ns/dcat/", - "odrl": "http://www.w3.org/ns/odrl/2/", - "dspace": "https://w3id.org/dspace/v0.8/" - } -} From dddf7ef6eebd14f3108d81cc085fc024a9e6c12a Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Tue, 14 May 2024 11:03:10 +0200 Subject: [PATCH 3/4] chore(exception):837 fix base image. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2dbee03339..ef68455762 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,7 @@ COPY tx-backend tx-backend RUN --mount=type=cache,target=/root/.m2 mvn -B clean package -pl :$BUILD_TARGET -am -DskipTests # Copy the jar and build image -FROM eclipse-temurin:21-jre-alpine@sha256:fb4150a30569aadae9d693d949684a00653411528e62498b9900940c9b5b8a66 AS traceability-app +FROM eclipse-temurin:21-jre-alpine@sha256:23467b3e42617ca197f43f58bc5fb03ca4cb059d68acd49c67128bfded132d67 AS traceability-app ARG UID=10000 ARG GID=1000 From 5ca5add6b05253f7d71e0832a4507a006aa72bc7 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Tue, 14 May 2024 11:12:27 +0200 Subject: [PATCH 4/4] chore(exception):837 fix base image. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5590644465..5738272dfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha ### Changed - #778 return empty PageResult when no contract agreement Ids are found instead of http 404 in /contacts API - #XXX Fixed some sonar issues in frontend application +- #XXX Switched eclipse-temurin:21-jre-alpine@sha256:fb4150a30569aadae9d693d949684a00653411528e62498b9900940c9b5b8a66 to 23467b3e42617ca197f43f58bc5fb03ca4cb059d68acd49c67128bfded132d67 ### Removed