|
16 | 16 | import com.adyen.model.negativebalancewarningwebhooks.NegativeBalanceWarningWebhooksHandler; |
17 | 17 | import com.adyen.model.reportwebhooks.ReportNotificationRequest; |
18 | 18 | import com.adyen.model.reportwebhooks.ReportWebhooksHandler; |
| 19 | +import com.adyen.model.transactionwebhooks.BankCategoryData; |
19 | 20 | import com.adyen.model.transactionwebhooks.TransactionNotificationRequestV4; |
20 | 21 | import com.adyen.model.transactionwebhooks.TransactionWebhooksHandler; |
21 | 22 | import com.adyen.model.transferwebhooks.BalanceMutation; |
@@ -259,6 +260,24 @@ public void testTransactionWebhookParsing() { |
259 | 260 | Assertions.assertEquals("EVJN42272224222B5JB8BRC84N686ZEUR", request.getData().getId()); |
260 | 261 | } |
261 | 262 |
|
| 263 | + @Test |
| 264 | + public void testTransactionWebhookBankCategoryDataParsing() { |
| 265 | + String json = |
| 266 | + getFileContents( |
| 267 | + "mocks/notification/balancePlatform-transaction-created-bank-category.json"); |
| 268 | + TransactionWebhooksHandler webhookHandler = new TransactionWebhooksHandler(json); |
| 269 | + Assertions.assertTrue(webhookHandler.getTransactionNotificationRequestV4().isPresent()); |
| 270 | + TransactionNotificationRequestV4 request = |
| 271 | + webhookHandler.getTransactionNotificationRequestV4().get(); |
| 272 | + Assertions.assertEquals("EVJN00000000000000000000000003EUR", request.getData().getId()); |
| 273 | + |
| 274 | + BankCategoryData bankCategoryData = |
| 275 | + request.getData().getTransfer().getCategoryData().getBankCategoryData(); |
| 276 | + Assertions.assertNotNull(bankCategoryData); |
| 277 | + Assertions.assertEquals(BankCategoryData.TypeEnum.BANK, bankCategoryData.getType()); |
| 278 | + Assertions.assertEquals(BankCategoryData.PriorityEnum.REGULAR, bankCategoryData.getPriority()); |
| 279 | + } |
| 280 | + |
262 | 281 | @Test |
263 | 282 | public void testNegativeBalanceCompensationWarning() { |
264 | 283 | String json = |
|
0 commit comments