From aa594ae588b211f342a4f13403683c2ee6da8a01 Mon Sep 17 00:00:00 2001 From: Padma Jadav <147383171+Jadavpadma@users.noreply.github.com> Date: Wed, 9 Oct 2024 19:57:16 +0530 Subject: [PATCH] Updated testcase for generateTransfer deposit switch url --- .../client/api/ConnectApiTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/src/test/java/com/mastercard/openbanking/client/api/ConnectApiTest.java b/tests/src/test/java/com/mastercard/openbanking/client/api/ConnectApiTest.java index 70390e3..fbcf5c0 100644 --- a/tests/src/test/java/com/mastercard/openbanking/client/api/ConnectApiTest.java +++ b/tests/src/test/java/com/mastercard/openbanking/client/api/ConnectApiTest.java @@ -206,6 +206,24 @@ void verifyMicroDepositEntryTest() { fail(e); } } + + @Test + void generateConnectTransferDepositUrlTest() { + try { + var params = new TransferDepositSwitchParameters() + .customerId(CUSTOMER_ID) + .partnerId(PARTNER_ID) + .addAccountsItem(ModelFactory.newDepositSwitchAccount("7526894126", "110000000", "checking")); + var connectUrl = api.generateTransferDepositSwitchUrl(params); + var link = connectUrl.getLink(); + assertTrue(link.contains("type=transferDepositSwitch")); + assertTrue(link.contains("customerId=" + CUSTOMER_ID)); + assertTrue(link.contains("partnerId=" + PARTNER_ID)); + } catch (ApiException e) { + fail(e); + } + } + private static String createTestCustomer() throws ApiException { var customer = customersApi.addTestingCustomer(ModelFactory.newCustomer()); var customerId = customer.getId(); @@ -213,3 +231,4 @@ private static String createTestCustomer() throws ApiException { return customerId; } } +