From 5b3df1eff929e6119dd3f90dabe1fb8d1d6febf0 Mon Sep 17 00:00:00 2001 From: Federico De Martino Date: Wed, 2 Sep 2026 14:00:26 +0200 Subject: [PATCH] remove acknowledge endpoint --- .../PaymentNotificationDeleteQuery.java | 22 ------------------- .../services/PaymentNotificationService.java | 2 -- .../impl/PaymentNotificationServiceImpl.java | 14 ------------ .../PaymentNotificationServiceImplTest.java | 16 -------------- 4 files changed, 54 deletions(-) delete mode 100644 src/main/java/com/ibanity/apis/client/products/isabel_connect/models/delete/PaymentNotificationDeleteQuery.java diff --git a/src/main/java/com/ibanity/apis/client/products/isabel_connect/models/delete/PaymentNotificationDeleteQuery.java b/src/main/java/com/ibanity/apis/client/products/isabel_connect/models/delete/PaymentNotificationDeleteQuery.java deleted file mode 100644 index 032c4b57..00000000 --- a/src/main/java/com/ibanity/apis/client/products/isabel_connect/models/delete/PaymentNotificationDeleteQuery.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.ibanity.apis.client.products.isabel_connect.models.delete; - -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.ToString; - -import java.util.Map; - -import static java.util.Collections.emptyMap; - -@Getter -@Builder -@ToString -@EqualsAndHashCode -public class PaymentNotificationDeleteQuery { - private String accessToken; - private String paymentNotificationId; - - @Builder.Default - private Map additionalHeaders = emptyMap(); -} diff --git a/src/main/java/com/ibanity/apis/client/products/isabel_connect/services/PaymentNotificationService.java b/src/main/java/com/ibanity/apis/client/products/isabel_connect/services/PaymentNotificationService.java index a30fc66d..380f3bdf 100644 --- a/src/main/java/com/ibanity/apis/client/products/isabel_connect/services/PaymentNotificationService.java +++ b/src/main/java/com/ibanity/apis/client/products/isabel_connect/services/PaymentNotificationService.java @@ -2,10 +2,8 @@ import com.ibanity.apis.client.models.IsabelCollection; import com.ibanity.apis.client.products.isabel_connect.models.PaymentNotification; -import com.ibanity.apis.client.products.isabel_connect.models.delete.PaymentNotificationDeleteQuery; import com.ibanity.apis.client.products.isabel_connect.models.read.PaymentNotificationsReadQuery; public interface PaymentNotificationService { IsabelCollection list(PaymentNotificationsReadQuery query); - void delete(PaymentNotificationDeleteQuery query); } diff --git a/src/main/java/com/ibanity/apis/client/products/isabel_connect/services/impl/PaymentNotificationServiceImpl.java b/src/main/java/com/ibanity/apis/client/products/isabel_connect/services/impl/PaymentNotificationServiceImpl.java index 399e3a89..60e5f790 100644 --- a/src/main/java/com/ibanity/apis/client/products/isabel_connect/services/impl/PaymentNotificationServiceImpl.java +++ b/src/main/java/com/ibanity/apis/client/products/isabel_connect/services/impl/PaymentNotificationServiceImpl.java @@ -7,7 +7,6 @@ import com.ibanity.apis.client.models.IbanityProduct; import com.ibanity.apis.client.models.IsabelCollection; import com.ibanity.apis.client.products.isabel_connect.models.PaymentNotification; -import com.ibanity.apis.client.products.isabel_connect.models.delete.PaymentNotificationDeleteQuery; import com.ibanity.apis.client.products.isabel_connect.models.read.PaymentNotificationsReadQuery; import com.ibanity.apis.client.products.isabel_connect.services.PaymentNotificationService; import com.ibanity.apis.client.services.ApiUrlProvider; @@ -39,12 +38,6 @@ public IsabelCollection list(PaymentNotificationsReadQuery }); } - @Override - public void delete(PaymentNotificationDeleteQuery query) { - URI uri = buildUri(getNotificationUrl(query.getPaymentNotificationId())); - ibanityHttpClient.delete(uri, query.getAdditionalHeaders(), query.getAccessToken()); - } - private String extractPaymentId(DataApiModel data) { return Optional.ofNullable(data.getRelationships()) .map(relationships -> relationships.get("payment")) @@ -59,11 +52,4 @@ private String getNotificationsUrl() { .replace("{bulkPaymentInitiationRequestId}", "notifications"); return StringUtils.removeEnd(url, "/"); } - - private String getNotificationUrl(String paymentNotificationId) { - String url = apiUrlProvider - .find(IbanityProduct.IsabelConnect, "bulkPaymentInitiationRequests") - .replace("{bulkPaymentInitiationRequestId}", "notifications/" + paymentNotificationId); - return StringUtils.removeEnd(url, "/"); - } } diff --git a/src/test/java/com/ibanity/apis/client/products/isabel_connect/services/impl/PaymentNotificationServiceImplTest.java b/src/test/java/com/ibanity/apis/client/products/isabel_connect/services/impl/PaymentNotificationServiceImplTest.java index 991007c5..21f59db4 100644 --- a/src/test/java/com/ibanity/apis/client/products/isabel_connect/services/impl/PaymentNotificationServiceImplTest.java +++ b/src/test/java/com/ibanity/apis/client/products/isabel_connect/services/impl/PaymentNotificationServiceImplTest.java @@ -4,7 +4,6 @@ import com.ibanity.apis.client.models.IbanityProduct; import com.ibanity.apis.client.models.IsabelCollection; import com.ibanity.apis.client.products.isabel_connect.models.PaymentNotification; -import com.ibanity.apis.client.products.isabel_connect.models.delete.PaymentNotificationDeleteQuery; import com.ibanity.apis.client.products.isabel_connect.models.read.PaymentNotificationsReadQuery; import com.ibanity.apis.client.services.ApiUrlProvider; import org.junit.jupiter.api.BeforeEach; @@ -20,10 +19,8 @@ import java.time.Instant; import java.util.Collections; -import static com.ibanity.apis.client.helpers.IbanityTestHelper.createHttpResponse; import static com.ibanity.apis.client.helpers.IbanityTestHelper.loadHttpResponse; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; -import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) @@ -33,7 +30,6 @@ public class PaymentNotificationServiceImplTest { private static final String BPIR_ENDPOINT = "https://api.ibanity.localhost/isabel-connect/bulk-payment-initiation-requests/{bulkPaymentInitiationRequestId}"; private static final String LIST_ENDPOINT = "https://api.ibanity.localhost/isabel-connect/bulk-payment-initiation-requests/notifications?size=20"; private static final String NOTIFICATION_ID = "14e2bff5-e365-4bc7-bf48-76b7bcd464e9"; - private static final String DELETE_ENDPOINT = "https://api.ibanity.localhost/isabel-connect/bulk-payment-initiation-requests/notifications/" + NOTIFICATION_ID; @InjectMocks private PaymentNotificationServiceImpl service; @@ -70,16 +66,4 @@ public void list() throws Exception { assertThat(notification.getPaymentId()).isEqualTo("90000036388319"); } - @Test - public void delete() throws Exception { - when(ibanityHttpClient.delete(new URI(DELETE_ENDPOINT), Collections.emptyMap(), ACCESS_TOKEN)) - .thenReturn(createHttpResponse("")); - - service.delete(PaymentNotificationDeleteQuery.builder() - .accessToken(ACCESS_TOKEN) - .paymentNotificationId(NOTIFICATION_ID) - .build()); - - verify(ibanityHttpClient).delete(new URI(DELETE_ENDPOINT), Collections.emptyMap(), ACCESS_TOKEN); - } }