Skip to content

Commit 690e063

Browse files
committed
Add test to verify InterchangeData
1 parent 8061954 commit 690e063

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

src/test/java/com/adyen/webhooks/BalancePlatformWebhooksTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import com.adyen.model.reportwebhooks.ReportWebhooksHandler;
1919
import com.adyen.model.transactionwebhooks.TransactionNotificationRequestV4;
2020
import com.adyen.model.transactionwebhooks.TransactionWebhooksHandler;
21+
import com.adyen.model.transferwebhooks.InterchangeData;
2122
import com.adyen.model.transferwebhooks.PlatformPayment;
2223
import com.adyen.model.transferwebhooks.TransferNotificationRequest;
2324
import com.adyen.model.transferwebhooks.TransferWebhooksHandler;
@@ -425,6 +426,15 @@ public void testTransferNotificationRequest() {
425426

426427
assertNotNull(transferNotificationRequest.getData().getBalances());
427428
assertEquals(1, transferNotificationRequest.getData().getBalances().size());
429+
430+
// check events and eventsData
431+
assertNotNull(transferNotificationRequest.getData().getEvents());
432+
assertNotNull(transferNotificationRequest.getData().getEvents().get(0));
433+
assertNotNull(transferNotificationRequest.getData().getEvents().get(0).getEventsData());
434+
assertEquals(1, transferNotificationRequest.getData().getEvents().get(0).getEventsData().size());
435+
assertNotNull(transferNotificationRequest.getData().getEvents().get(0).getEventsData().get(0));
436+
assertInstanceOf(InterchangeData.class, transferNotificationRequest.getData().getEvents().get(0).getEventsData().get(0).getActualInstance());
437+
428438
}
429439

430440
@Test

src/test/resources/mocks/balancePlatform-webhooks/transfer-updated.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
2-
32
"data": {
4-
53
"balancePlatform": "YOUR_BALANCE_PLATFORM",
64
"creationDate": "2025-06-02T13:46:27+02:00",
75
"id": "01234",
@@ -44,6 +42,16 @@
4442
{
4543
"bookingDate": "2025-06-02T13:46:27+02:00",
4644
"id": "EV1234567890",
45+
"eventsData": [
46+
{
47+
"type": "interchangeData",
48+
"interchangeAmount": {
49+
"currency": "EUR",
50+
"value": 22700
51+
},
52+
"interchangeRateIndicator": "x"
53+
}
54+
],
4755
"mutations": [
4856
{
4957
"currency": "EUR",

0 commit comments

Comments
 (0)