Skip to content

Commit d23a6e9

Browse files
committed
Add test of new event
1 parent e38a883 commit d23a6e9

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.adyen.model.acswebhooks.RelayedAuthenticationRequest;
99
import com.adyen.model.balancewebhooks.BalanceAccountBalanceNotificationRequest;
1010
import com.adyen.model.balancewebhooks.BalanceWebhooksHandler;
11+
import com.adyen.model.balancewebhooks.ReleasedBlockedBalanceNotificationRequest;
1112
import com.adyen.model.configurationwebhooks.*;
1213
import com.adyen.model.disputewebhooks.DisputeNotificationRequest;
1314
import com.adyen.model.disputewebhooks.DisputeWebhooksHandler;
@@ -328,6 +329,34 @@ public void testBalanceAccountBalanceNotificationRequest() {
328329
assertFalse(balanceAccountBalanceNotificationRequest.getData().getSettingIds().isEmpty());
329330
}
330331

332+
@Test
333+
public void testBalanceAccountBalanceBlockReleasedNotificationRequest() {
334+
String json =
335+
getFileContents(
336+
"mocks/balancePlatform-webhooks/balancePlatform-balanceAccount-balance-block-released.json");
337+
338+
Optional<ReleasedBlockedBalanceNotificationRequest>
339+
releasedBlockedBalanceNotificationRequestOptional =
340+
new BalanceWebhooksHandler(json).getReleasedBlockedBalanceNotificationRequest();
341+
assertTrue(releasedBlockedBalanceNotificationRequestOptional.isPresent());
342+
343+
ReleasedBlockedBalanceNotificationRequest releasedBlockedBalanceNotificationRequest =
344+
releasedBlockedBalanceNotificationRequestOptional.get();
345+
assertNotNull(releasedBlockedBalanceNotificationRequest.getData());
346+
347+
assertEquals(
348+
ReleasedBlockedBalanceNotificationRequest.TypeEnum
349+
.BALANCEPLATFORM_BALANCEACCOUNT_BALANCE_BLOCK_RELEASED,
350+
releasedBlockedBalanceNotificationRequest.getType());
351+
assertEquals(
352+
"BATCH_REF_20250925",
353+
releasedBlockedBalanceNotificationRequest.getData().getBatchReference());
354+
assertNotNull(releasedBlockedBalanceNotificationRequest.getData().getBalanceAccount());
355+
assertEquals(
356+
"BA00000000000000000001",
357+
releasedBlockedBalanceNotificationRequest.getData().getBalanceAccount().getId());
358+
}
359+
331360
@Test
332361
public void testNetworkTokenCreatedNotificationRequest() {
333362
String json =
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"data": {
3+
"accountHolder": {
4+
"description": "Account holder for retail operations",
5+
"id": "AH00000000000000000001",
6+
"reference": "Store_001"
7+
},
8+
"amount": {
9+
"currency": "EUR",
10+
"value": 25000
11+
},
12+
"balanceAccount": {
13+
"description": "Main operating account",
14+
"id": "BA00000000000000000001",
15+
"reference": "OP_ACCT_MAIN"
16+
},
17+
"balancePlatform": "YOUR_BALANCE_PLATFORM",
18+
"batchReference": "BATCH_REF_20250925",
19+
"blockedBalanceAfter": {
20+
"currency": "EUR",
21+
"value": -75000
22+
},
23+
"blockedBalanceBefore": {
24+
"currency": "EUR",
25+
"value": -100000
26+
},
27+
"creationDate": "2025-09-25T14:30:00Z",
28+
"valueDate": "2025-09-25T14:35:00Z"
29+
},
30+
"environment": "test",
31+
"timestamp": "2025-09-25T14:35:00Z",
32+
"type": "balancePlatform.balanceAccount.balance.block.released"
33+
}

0 commit comments

Comments
 (0)