|
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.InterchangeData; |
@@ -256,6 +257,24 @@ public void testTransactionWebhookParsing() { |
256 | 257 | Assertions.assertEquals("EVJN42272224222B5JB8BRC84N686ZEUR", request.getData().getId()); |
257 | 258 | } |
258 | 259 |
|
| 260 | + @Test |
| 261 | + public void testTransactionWebhookBankCategoryDataParsing() { |
| 262 | + String json = |
| 263 | + getFileContents( |
| 264 | + "mocks/notification/balancePlatform-transaction-created-bank-category.json"); |
| 265 | + TransactionWebhooksHandler webhookHandler = new TransactionWebhooksHandler(json); |
| 266 | + Assertions.assertTrue(webhookHandler.getTransactionNotificationRequestV4().isPresent()); |
| 267 | + TransactionNotificationRequestV4 request = |
| 268 | + webhookHandler.getTransactionNotificationRequestV4().get(); |
| 269 | + Assertions.assertEquals("EVJN00000000000000000000000003EUR", request.getData().getId()); |
| 270 | + |
| 271 | + BankCategoryData bankCategoryData = |
| 272 | + request.getData().getTransfer().getCategoryData().getBankCategoryData(); |
| 273 | + Assertions.assertNotNull(bankCategoryData); |
| 274 | + Assertions.assertEquals(BankCategoryData.TypeEnum.BANK, bankCategoryData.getType()); |
| 275 | + Assertions.assertEquals(BankCategoryData.PriorityEnum.REGULAR, bankCategoryData.getPriority()); |
| 276 | + } |
| 277 | + |
259 | 278 | @Test |
260 | 279 | public void testNegativeBalanceCompensationWarning() { |
261 | 280 | String json = |
|
0 commit comments