From 81d839a91a346f74c9ff9056193dc8ed07d560e8 Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Tue, 18 Jun 2024 11:28:13 +0200 Subject: [PATCH] feature: #639 remove PolicyCheckerService.isValid() check --- .../domain/base/service/NotificationsEDCFacade.java | 8 -------- .../edc/blackbox/NotificationsEDCFacadeTest.java | 2 -- 2 files changed, 10 deletions(-) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/notification/domain/base/service/NotificationsEDCFacade.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/notification/domain/base/service/NotificationsEDCFacade.java index a06fa3278c..0795523948 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/notification/domain/base/service/NotificationsEDCFacade.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/notification/domain/base/service/NotificationsEDCFacade.java @@ -154,14 +154,6 @@ private CatalogItem getCatalogItem(final NotificationMessage notification, final .build()) .build() ).stream() - .filter(catalogItem -> { - log.info("-- catalog item check --"); - log.info("Item {}: {}", catalogItem.getItemId(), catalogItem); - boolean isValid = policyCheckerService.isValid(catalogItem.getPolicy(), notification.getSendTo() - ); - log.info("IsValid : {}", isValid); - return isValid; - }) .findFirst() .orElseThrow(); } catch (Exception e) { diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/blackbox/NotificationsEDCFacadeTest.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/blackbox/NotificationsEDCFacadeTest.java index ce1a91d3e8..a1b10b2206 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/blackbox/NotificationsEDCFacadeTest.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/infrastructure/edc/blackbox/NotificationsEDCFacadeTest.java @@ -82,7 +82,6 @@ void givenCorrectInvestigationMessageButSendRequestThrowsException_whenStartEdcT final String idsPath = "/api/v1/dsp"; when(edcProperties.getIdsPath()).thenReturn(idsPath); when(edcCatalogFacade.fetchCatalogItems(any())).thenReturn(List.of(catalogItem)); - when(policyCheckerService.isValid(null, null)).thenReturn(true); when(contractNegotiationService.negotiate(receiverEdcUrl + idsPath, catalogItem, null, null)) .thenReturn(NegotiationResponse.builder().contractAgreementId(agreementId).build()); when(endpointDataReference.getEndpoint()).thenReturn("endpoint"); @@ -111,7 +110,6 @@ void givenCorrectInvestigationMessageButNegotiateContractAgreementHasNoCatalogIt final String idsPath = "/api/v1/dsp"; when(edcProperties.getIdsPath()).thenReturn(idsPath); when(edcCatalogFacade.fetchCatalogItems(any())).thenReturn(List.of(catalogItem)); - when(policyCheckerService.isValid(null, null)).thenReturn(true); when(contractNegotiationService.negotiate(receiverEdcUrl + idsPath, catalogItem, null, null)) .thenReturn(null);