From ba24b99504faef04b7619e95f73664051d58a169 Mon Sep 17 00:00:00 2001 From: Jeanderson Barros Candido <2225536+jeandersonbc@users.noreply.github.com> Date: Tue, 20 Jan 2026 15:12:52 +0100 Subject: [PATCH 1/2] FIX moved deprecated-Capital related resources --- src/test/java/com/adyen/TransfersTest.java | 4 ++-- .../mocks/{capital => transfers}/get-capital-account.json | 0 .../resources/mocks/{capital => transfers}/request-grant.json | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename src/test/resources/mocks/{capital => transfers}/get-capital-account.json (100%) rename src/test/resources/mocks/{capital => transfers}/request-grant.json (100%) diff --git a/src/test/java/com/adyen/TransfersTest.java b/src/test/java/com/adyen/TransfersTest.java index 34adb8b5a..b60c3f13a 100644 --- a/src/test/java/com/adyen/TransfersTest.java +++ b/src/test/java/com/adyen/TransfersTest.java @@ -49,7 +49,7 @@ public void TransactionsRetrieveTest() throws Exception { @Test public void TestGetCapitalAccounts() throws Exception { - Client client = createMockClientFromFile("mocks/capital/get-capital-account.json"); + Client client = createMockClientFromFile("mocks/transfers/get-capital-account.json"); CapitalApi capital = new CapitalApi(client); CapitalGrants response = capital.getCapitalAccount(); assertEquals(response.getGrants().get(0).getGrantOfferId(), "string"); @@ -66,7 +66,7 @@ public void TestGetCapitalAccounts() throws Exception { @Test public void TestRequestGrant() throws Exception { - Client client = createMockClientFromFile("mocks/capital/request-grant.json"); + Client client = createMockClientFromFile("mocks/transfers/request-grant.json"); CapitalApi capital = new CapitalApi(client); CapitalGrant response = capital.requestGrantPayout(new CapitalGrantInfo()); assertEquals(response.getGrantAccountId(), "CG00000000000000000000001"); diff --git a/src/test/resources/mocks/capital/get-capital-account.json b/src/test/resources/mocks/transfers/get-capital-account.json similarity index 100% rename from src/test/resources/mocks/capital/get-capital-account.json rename to src/test/resources/mocks/transfers/get-capital-account.json diff --git a/src/test/resources/mocks/capital/request-grant.json b/src/test/resources/mocks/transfers/request-grant.json similarity index 100% rename from src/test/resources/mocks/capital/request-grant.json rename to src/test/resources/mocks/transfers/request-grant.json From c011b101d313ce21fde6658810d96c9afd02492a Mon Sep 17 00:00:00 2001 From: Jeanderson Barros Candido <2225536+jeandersonbc@users.noreply.github.com> Date: Tue, 20 Jan 2026 15:13:48 +0100 Subject: [PATCH 2/2] DEV added test coverage for newer version of Capital API --- .../service/capital/GrantAccountsApiTest.java | 65 +++++ .../service/capital/GrantOffersApiTest.java | 108 +++++++++ .../adyen/service/capital/GrantsApiTest.java | 225 ++++++++++++++++++ .../capital/get-grant-account-success.json | 21 ++ .../get-grant-disbursement-success.json | 27 +++ .../get-grant-disbursements-success.json | 31 +++ .../capital/get-grant-offer-success.json | 32 +++ .../mocks/capital/get-grant-success.json | 23 ++ .../mocks/capital/grant-accounts-success.json | 12 + .../mocks/capital/grant-offers-success.json | 19 ++ .../mocks/capital/grants-success.json | 26 ++ .../mocks/capital/request-grant.json | 33 +++ .../update-grant-disbursement-success.json | 27 +++ 13 files changed, 649 insertions(+) create mode 100644 src/test/java/com/adyen/service/capital/GrantAccountsApiTest.java create mode 100644 src/test/java/com/adyen/service/capital/GrantOffersApiTest.java create mode 100644 src/test/java/com/adyen/service/capital/GrantsApiTest.java create mode 100644 src/test/resources/mocks/capital/get-grant-account-success.json create mode 100644 src/test/resources/mocks/capital/get-grant-disbursement-success.json create mode 100644 src/test/resources/mocks/capital/get-grant-disbursements-success.json create mode 100644 src/test/resources/mocks/capital/get-grant-offer-success.json create mode 100644 src/test/resources/mocks/capital/get-grant-success.json create mode 100644 src/test/resources/mocks/capital/grant-accounts-success.json create mode 100644 src/test/resources/mocks/capital/grant-offers-success.json create mode 100644 src/test/resources/mocks/capital/grants-success.json create mode 100644 src/test/resources/mocks/capital/request-grant.json create mode 100644 src/test/resources/mocks/capital/update-grant-disbursement-success.json diff --git a/src/test/java/com/adyen/service/capital/GrantAccountsApiTest.java b/src/test/java/com/adyen/service/capital/GrantAccountsApiTest.java new file mode 100644 index 000000000..82008bda3 --- /dev/null +++ b/src/test/java/com/adyen/service/capital/GrantAccountsApiTest.java @@ -0,0 +1,65 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2026 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ +package com.adyen.service.capital; + +import static org.mockito.Mockito.verify; + +import com.adyen.BaseTest; +import com.adyen.Client; +import com.adyen.constants.ApiConstants; +import com.adyen.model.capital.GrantAccount; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public class GrantAccountsApiTest extends BaseTest { + + @Test + void testGetGrantAccount() throws Exception { + Client client = createMockClientFromFile("mocks/capital/get-grant-account-success.json"); + GrantAccountsApi grantAccountsApi = new GrantAccountsApi(client); + GrantAccount response = + grantAccountsApi.getGrantAccountInformation("CG00000000000000000000001"); + + Assertions.assertNotNull(response); + Assertions.assertEquals("CG00000000000000000000001", response.getId()); + Assertions.assertEquals("BA00000000000000000000001", response.getFundingBalanceAccountId()); + Assertions.assertEquals(1, response.getLimits().size()); + Assertions.assertEquals(1, response.getBalances().size()); + + verify(client.getHttpClient()) + .request( + "https://balanceplatform-api-test.adyen.com/capital/v1/grantAccounts/CG00000000000000000000001", + null, + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.GET, + null); + } + + @Test + void testGetGrantAccountRequiredParams() { + Client client = createMockClientFromFile("mocks/capital/get-grant-account-success.json"); + GrantAccountsApi grantAccountsApi = new GrantAccountsApi(client); + Assertions.assertThrows( + IllegalArgumentException.class, () -> grantAccountsApi.getGrantAccountInformation(null)); + } +} diff --git a/src/test/java/com/adyen/service/capital/GrantOffersApiTest.java b/src/test/java/com/adyen/service/capital/GrantOffersApiTest.java new file mode 100644 index 000000000..a43cac3a3 --- /dev/null +++ b/src/test/java/com/adyen/service/capital/GrantOffersApiTest.java @@ -0,0 +1,108 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2026 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ +package com.adyen.service.capital; + +import static org.mockito.Mockito.verify; + +import com.adyen.BaseTest; +import com.adyen.Client; +import com.adyen.constants.ApiConstants; +import com.adyen.model.capital.Amount; +import com.adyen.model.capital.GrantOffer; +import com.adyen.model.capital.GrantOffers; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public class GrantOffersApiTest extends BaseTest { + + @Test + void testGetAllGrantOffersWithQueryParam() throws Exception { + Client client = createMockClientFromFile("mocks/capital/grant-offers-success.json"); + GrantOffersApi grantOffersApi = new GrantOffersApi(client); + GrantOffers response = grantOffersApi.getAllGrantOffers("AH00000000000000000000001", null); + + Assertions.assertNotNull(response); + Assertions.assertEquals(1, response.getGrantOffers().size()); + Assertions.assertEquals("GO00000000000000000000001", response.getGrantOffers().get(0).getId()); + + verify(client.getHttpClient()) + .request( + "https://balanceplatform-api-test.adyen.com/capital/v1/grantOffers", + null, + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.GET, + Map.of("accountHolderId", "AH00000000000000000000001")); + } + + @Test + void testGetAllGrantOffers() throws Exception { + Client client = createMockClientFromFile("mocks/capital/grant-offers-success.json"); + GrantOffersApi grantOffersApi = new GrantOffersApi(client); + GrantOffers response = grantOffersApi.getAllGrantOffers(); + + Assertions.assertNotNull(response); + Assertions.assertEquals(1, response.getGrantOffers().size()); + Assertions.assertEquals("GO00000000000000000000001", response.getGrantOffers().get(0).getId()); + + verify(client.getHttpClient()) + .request( + "https://balanceplatform-api-test.adyen.com/capital/v1/grantOffers", + null, + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.GET, + Map.of()); + } + + @Test + void testGetGrantOffer() throws Exception { + Client client = createMockClientFromFile("mocks/capital/get-grant-offer-success.json"); + GrantOffersApi grantOffersApi = new GrantOffersApi(client); + GrantOffer response = grantOffersApi.getGrantOffer("GO00000000000000000000001"); + + Assertions.assertNotNull(response); + Assertions.assertEquals("GO00000000000000000000001", response.getId()); + Assertions.assertEquals("AH00000000000000000000001", response.getAccountHolderId()); + Assertions.assertEquals(new Amount().currency("EUR").value(10000L), response.getAmount()); + + verify(client.getHttpClient()) + .request( + "https://balanceplatform-api-test.adyen.com/capital/v1/grantOffers/GO00000000000000000000001", + null, + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.GET, + null); + } + + @Test + void testGetGrantOfferParams() { + Client client = createMockClientFromFile("mocks/capital/get-grant-offer-success.json"); + GrantOffersApi grantOffersApi = new GrantOffersApi(client); + Assertions.assertThrows( + IllegalArgumentException.class, () -> grantOffersApi.getGrantOffer(null)); + } +} diff --git a/src/test/java/com/adyen/service/capital/GrantsApiTest.java b/src/test/java/com/adyen/service/capital/GrantsApiTest.java new file mode 100644 index 000000000..c0c8d476e --- /dev/null +++ b/src/test/java/com/adyen/service/capital/GrantsApiTest.java @@ -0,0 +1,225 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2026 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ +package com.adyen.service.capital; + +import static org.mockito.Mockito.verify; + +import com.adyen.BaseTest; +import com.adyen.Client; +import com.adyen.constants.ApiConstants; +import com.adyen.model.capital.*; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public class GrantsApiTest extends BaseTest { + + @Test + void testGetGrant() throws Exception { + Client client = createMockClientFromFile("mocks/capital/get-grant-success.json"); + GrantsApi grantsApi = new GrantsApi(client); + Grant response = grantsApi.getGrant("GR00000000000000000000001"); + + Assertions.assertNotNull(response); + Assertions.assertEquals("GR00000000000000000000001", response.getId()); + Assertions.assertEquals("CG00000000000000000000001", response.getGrantAccountId()); + Assertions.assertEquals("GO00000000000000000000001", response.getGrantOfferId()); + Assertions.assertEquals(new Amount().currency("EUR").value(10000L), response.getAmount()); + Assertions.assertEquals(new Status().code(Status.CodeEnum.ACTIVE), response.getStatus()); + Assertions.assertEquals( + new Balance().currency("EUR").principal(10000L).fee(1000L).total(11000L), + response.getBalances()); + Assertions.assertEquals( + new Counterparty() + .accountHolderId("AH00000000000000000000001") + .balanceAccountId("BA00000000000000000000001"), + response.getCounterparty()); + + verify(client.getHttpClient()) + .request( + "https://balanceplatform-api-test.adyen.com/capital/v1/grants/GR00000000000000000000001", + null, + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.GET, + null); + } + + @Test + void testGetAllGrants() throws Exception { + Client client = createMockClientFromFile("mocks/capital/grants-success.json"); + GrantsApi grantsApi = new GrantsApi(client); + Grants grants = grantsApi.getAllGrants("GR00000000000000000000001"); + Assertions.assertNotNull(grants); + Assertions.assertEquals(1, grants.getGrants().size()); + verify(client.getHttpClient()) + .request( + "https://balanceplatform-api-test.adyen.com/capital/v1/grants", + null, + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.GET, + Map.of("counterpartyAccountHolderId", "GR00000000000000000000001")); + } + + @Disabled("Because we are not currently validating against required query parameters") + @Test + void testGetAllGrantsParams() { + Client client = createMockClientFromFile("mocks/capital/grants-success.json"); + GrantsApi grantsApi = new GrantsApi(client); + Assertions.assertThrows(IllegalArgumentException.class, () -> grantsApi.getAllGrants(null)); + } + + @Test + void testRequestGrant() throws Exception { + + Client client = createMockClientFromFile("mocks/capital/request-grant.json"); + GrantsApi grantsApi = new GrantsApi(client); + GrantInfo grantInfo = new GrantInfo().grantAccountId("GR00000000000000000000001"); + Grant response = grantsApi.requestGrant(grantInfo); + + Assertions.assertNotNull(response); + Assertions.assertEquals("GR00000000000000000000001", response.getId()); + Assertions.assertEquals("CG00000000000000000000001", response.getGrantAccountId()); + Assertions.assertEquals("0000000000000001", response.getGrantOfferId()); + Assertions.assertEquals(new Amount().currency("EUR").value(1000000L), response.getAmount()); + Assertions.assertEquals(new Status().code(Status.CodeEnum.PENDING), response.getStatus()); + Assertions.assertEquals( + new Balance().currency("EUR").principal(1000000L).fee(120000L).total(1120000L), + response.getBalances()); + Assertions.assertEquals( + new Counterparty() + .accountHolderId("AH00000000000000000000001") + .balanceAccountId("BA00000000000000000000001"), + response.getCounterparty()); + verify(client.getHttpClient()) + .request( + "https://balanceplatform-api-test.adyen.com/capital/v1/grants", + "{\"grantAccountId\":\"GR00000000000000000000001\"}", + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.POST, + null); + } + + @Test + void testGetGrantDisbursement() throws Exception { + Client client = createMockClientFromFile("mocks/capital/get-grant-disbursement-success.json"); + GrantsApi grantsApi = new GrantsApi(client); + Disbursement response = + grantsApi.getGrantDisbursement("GR00000000000000000000001", "DI00000000000000000000001"); + Assertions.assertNotNull(response); + Assertions.assertEquals("DI00000000000000000000001", response.getId()); + Assertions.assertEquals("GR00000000000000000000001", response.getGrantId()); + Assertions.assertEquals("AH00000000000000000000001", response.getAccountHolderId()); + Assertions.assertEquals("BA00000000000000000000001", response.getBalanceAccountId()); + Assertions.assertEquals(new Amount().currency("EUR").value(10000L), response.getAmount()); + Assertions.assertEquals( + new Balance().currency("EUR").principal(10000L).fee(1000L).total(11000L), + response.getBalances()); + verify(client.getHttpClient()) + .request( + "https://balanceplatform-api-test.adyen.com/capital/v1/grants/GR00000000000000000000001/disbursements/DI00000000000000000000001", + null, + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.GET, + null); + } + + @Test + void testGetAllGrantDisbursements() throws Exception { + Client client = createMockClientFromFile("mocks/capital/get-grant-disbursements-success.json"); + GrantsApi grantsApi = new GrantsApi(client); + Disbursements response = grantsApi.getAllGrantDisbursements("GR00000000000000000000001"); + Assertions.assertNotNull(response); + Assertions.assertEquals(1, response.getDisbursements().size()); + Assertions.assertEquals( + "DI00000000000000000000001", response.getDisbursements().get(0).getId()); + verify(client.getHttpClient()) + .request( + "https://balanceplatform-api-test.adyen.com/capital/v1/grants/GR00000000000000000000001/disbursements", + null, + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.GET, + null); + } + + @Test + void testGetAllGrantDisbursementsParams() { + Client client = createMockClientFromFile("mocks/capital/get-grant-disbursements-success.json"); + GrantsApi grantsApi = new GrantsApi(client); + Assertions.assertThrows( + IllegalArgumentException.class, () -> grantsApi.getAllGrantDisbursements(null)); + } + + @Test + void testUpdateGrantDisbursement() throws Exception { + Client client = + createMockClientFromFile("mocks/capital/update-grant-disbursement-success.json"); + GrantsApi grantsApi = new GrantsApi(client); + DisbursementInfoUpdate disbursementInfoUpdate = new DisbursementInfoUpdate(); + Disbursement response = + grantsApi.updateGrantDisbursement( + "GR00000000000000000000001", "DI00000000000000000000001", disbursementInfoUpdate); + Assertions.assertNotNull(response); + Assertions.assertEquals("DI00000000000000000000001", response.getId()); + Assertions.assertEquals("GR00000000000000000000001", response.getGrantId()); + Assertions.assertEquals("AH00000000000000000000001", response.getAccountHolderId()); + Assertions.assertEquals("BA00000000000000000000001", response.getBalanceAccountId()); + Assertions.assertEquals(new Amount().currency("EUR").value(10000L), response.getAmount()); + Assertions.assertEquals( + new Balance().currency("EUR").principal(10000L).fee(1000L).total(11000L), + response.getBalances()); + verify(client.getHttpClient()) + .request( + "https://balanceplatform-api-test.adyen.com/capital/v1/grants/GR00000000000000000000001/disbursements/DI00000000000000000000001", + "{}", + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.PATCH, + null); + } + + @Test + void testUpdateGrantDisbursementParams() throws Exception { + Client client = + createMockClientFromFile("mocks/capital/update-grant-disbursement-success.json"); + GrantsApi grantsApi = new GrantsApi(client); + DisbursementInfoUpdate disbursementInfoUpdate = new DisbursementInfoUpdate(); + Assertions.assertThrows( + IllegalArgumentException.class, + () -> + grantsApi.updateGrantDisbursement( + null, "DI00000000000000000000001", disbursementInfoUpdate)); + Assertions.assertThrows( + IllegalArgumentException.class, + () -> grantsApi.updateGrantDisbursement("something", null, disbursementInfoUpdate)); + } +} diff --git a/src/test/resources/mocks/capital/get-grant-account-success.json b/src/test/resources/mocks/capital/get-grant-account-success.json new file mode 100644 index 000000000..c301b36de --- /dev/null +++ b/src/test/resources/mocks/capital/get-grant-account-success.json @@ -0,0 +1,21 @@ + +{ + "id": "CG00000000000000000000001", + "fundingBalanceAccountId": "BA00000000000000000000001", + "limits": [ + { + "amount": { + "currency": "EUR", + "value": 100000 + } + } + ], + "balances": [ + { + "currency": "EUR", + "principal": 10000, + "fee": 1000, + "total": 11000 + } + ] +} diff --git a/src/test/resources/mocks/capital/get-grant-disbursement-success.json b/src/test/resources/mocks/capital/get-grant-disbursement-success.json new file mode 100644 index 000000000..bce3c043f --- /dev/null +++ b/src/test/resources/mocks/capital/get-grant-disbursement-success.json @@ -0,0 +1,27 @@ + +{ + "id": "DI00000000000000000000001", + "grantId": "GR00000000000000000000001", + "accountHolderId": "AH00000000000000000000001", + "balanceAccountId": "BA00000000000000000000001", + "amount": { + "currency": "EUR", + "value": 10000 + }, + "fee": { + "amount": { + "currency": "EUR", + "value": 1000 + } + }, + "balances": { + "currency": "EUR", + "principal": 10000, + "fee": 1000, + "total": 11000 + }, + "repayment": { + "basisPoints": 1000, + "updateDescription": "string" + } +} diff --git a/src/test/resources/mocks/capital/get-grant-disbursements-success.json b/src/test/resources/mocks/capital/get-grant-disbursements-success.json new file mode 100644 index 000000000..8389bd8a8 --- /dev/null +++ b/src/test/resources/mocks/capital/get-grant-disbursements-success.json @@ -0,0 +1,31 @@ + +{ + "disbursements": [ + { + "id": "DI00000000000000000000001", + "grantId": "GR00000000000000000000001", + "accountHolderId": "AH00000000000000000000001", + "balanceAccountId": "BA00000000000000000000001", + "amount": { + "currency": "EUR", + "value": 10000 + }, + "fee": { + "amount": { + "currency": "EUR", + "value": 1000 + } + }, + "balances": { + "currency": "EUR", + "principal": 10000, + "fee": 1000, + "total": 11000 + }, + "repayment": { + "basisPoints": 1000, + "updateDescription": "string" + } + } + ] +} diff --git a/src/test/resources/mocks/capital/get-grant-offer-success.json b/src/test/resources/mocks/capital/get-grant-offer-success.json new file mode 100644 index 000000000..0add7fdd5 --- /dev/null +++ b/src/test/resources/mocks/capital/get-grant-offer-success.json @@ -0,0 +1,32 @@ + +{ + "id": "GO00000000000000000000001", + "accountHolderId": "AH00000000000000000000001", + "contractType": "cashAdvance", + "amount": { + "currency": "EUR", + "value": 10000 + }, + "fee": { + "amount": { + "currency": "EUR", + "value": 1000 + }, + "aprBasisPoints": 1200 + }, + "repayment": { + "basisPoints": 1000, + "term": { + "estimatedDays": 180, + "maximumDays": 365 + }, + "threshold": { + "amount": { + "currency": "EUR", + "value": 1000 + } + } + }, + "startsAt": "2024-01-01T00:00:00Z", + "expiresAt": "2024-01-31T23:59:59Z" +} diff --git a/src/test/resources/mocks/capital/get-grant-success.json b/src/test/resources/mocks/capital/get-grant-success.json new file mode 100644 index 000000000..6e0c82936 --- /dev/null +++ b/src/test/resources/mocks/capital/get-grant-success.json @@ -0,0 +1,23 @@ + +{ + "id": "GR00000000000000000000001", + "grantAccountId": "CG00000000000000000000001", + "grantOfferId": "GO00000000000000000000001", + "counterparty": { + "accountHolderId": "AH00000000000000000000001", + "balanceAccountId": "BA00000000000000000000001" + }, + "amount": { + "currency": "EUR", + "value": 10000 + }, + "balances": { + "currency": "EUR", + "principal": 10000, + "fee": 1000, + "total": 11000 + }, + "status": { + "code": "Active" + } +} diff --git a/src/test/resources/mocks/capital/grant-accounts-success.json b/src/test/resources/mocks/capital/grant-accounts-success.json new file mode 100644 index 000000000..c2c20e204 --- /dev/null +++ b/src/test/resources/mocks/capital/grant-accounts-success.json @@ -0,0 +1,12 @@ +{ + "grantAccounts": [ + { + "id": "GA00000000000000000000001", + "grantorAccountId": "CG00000000000000000000001", + "fundingSource": { + "type": "adyen", + "adyenAccountId": "BA00000000000000000000001" + } + } + ] +} diff --git a/src/test/resources/mocks/capital/grant-offers-success.json b/src/test/resources/mocks/capital/grant-offers-success.json new file mode 100644 index 000000000..d28bf6a08 --- /dev/null +++ b/src/test/resources/mocks/capital/grant-offers-success.json @@ -0,0 +1,19 @@ +{ + "grantOffers": [ + { + "id": "GO00000000000000000000001", + "amount": { + "currency": "EUR", + "value": 10000 + }, + "fee": { + "currency": "EUR", + "value": 100 + }, + "repayment": { + "currency": "EUR", + "value": 10100 + } + } + ] +} diff --git a/src/test/resources/mocks/capital/grants-success.json b/src/test/resources/mocks/capital/grants-success.json new file mode 100644 index 000000000..414c9ca38 --- /dev/null +++ b/src/test/resources/mocks/capital/grants-success.json @@ -0,0 +1,26 @@ +{ + "grants": [ + { + "id": "GR00000000000000000000001", + "grantAccountId": "CG00000000000000000000001", + "grantOfferId": "GO00000000000000000000001", + "counterparty": { + "accountHolderId": "AH00000000000000000000001", + "balanceAccountId": "BA00000000000000000000001" + }, + "amount": { + "currency": "EUR", + "value": 10000 + }, + "balances": { + "currency": "EUR", + "principal": 10000, + "fee": 1000, + "total": 11000 + }, + "status": { + "code": "Active" + } + } + ] +} \ No newline at end of file diff --git a/src/test/resources/mocks/capital/request-grant.json b/src/test/resources/mocks/capital/request-grant.json new file mode 100644 index 000000000..7a4b72724 --- /dev/null +++ b/src/test/resources/mocks/capital/request-grant.json @@ -0,0 +1,33 @@ +{ + "id": "GR00000000000000000000001", + "grantAccountId": "CG00000000000000000000001", + "grantOfferId": "0000000000000001", + "counterparty": { + "accountHolderId": "AH00000000000000000000001", + "balanceAccountId": "BA00000000000000000000001" + }, + "amount": { + "currency": "EUR", + "value": 1000000 + }, + "fee": { + "amount": { + "value": 120000, + "currency": "EUR" + } + }, + "balances": + { + "currency": "EUR", + "fee": 120000, + "principal": 1000000, + "total": 1120000 + } + , + "repayment": { + "basisPoints": 1400 + }, + "status": { + "code": "Pending" + } +} \ No newline at end of file diff --git a/src/test/resources/mocks/capital/update-grant-disbursement-success.json b/src/test/resources/mocks/capital/update-grant-disbursement-success.json new file mode 100644 index 000000000..7aeaeada2 --- /dev/null +++ b/src/test/resources/mocks/capital/update-grant-disbursement-success.json @@ -0,0 +1,27 @@ + +{ + "id": "DI00000000000000000000001", + "grantId": "GR00000000000000000000001", + "accountHolderId": "AH00000000000000000000001", + "balanceAccountId": "BA00000000000000000000001", + "amount": { + "currency": "EUR", + "value": 10000 + }, + "fee": { + "amount": { + "currency": "EUR", + "value": 1000 + } + }, + "balances": { + "currency": "EUR", + "principal": 10000, + "fee": 1000, + "total": 11000 + }, + "repayment": { + "basisPoints": 1500, + "updateDescription": "string" + } +}