diff --git a/build.gradle b/build.gradle index e5d36a3c..2f40fdf2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ group 'com.bunq.sdk' -version '1.28.0.5' +version '1.28.0.6' apply plugin: 'java' apply plugin: 'maven-publish' @@ -48,7 +48,7 @@ publishing { from components.java groupId = 'com.bunq.sdk' artifactId = 'sdk_java' - version = '1.28.0.5' + version = '1.28.0.6' } } } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountApiObject.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountApiObject.java index bc2db886..79267e2d 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountApiObject.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountApiObject.java @@ -63,11 +63,11 @@ public class MonetaryAccountApiObject extends BunqModel { private AmountObject balanceConverted; /** - * The profiles of the account. + * The profile of the account. */ @Expose @SerializedName("monetary_account_profile") - private List monetaryAccountProfile; + private MonetaryAccountProfileApiObject monetaryAccountProfile; /** * The settings of the MonetaryAccount. @@ -291,13 +291,13 @@ public void setBalanceConverted(AmountObject balanceConverted) { } /** - * The profiles of the account. + * The profile of the account. */ - public List getMonetaryAccountProfile() { + public MonetaryAccountProfileApiObject getMonetaryAccountProfile() { return this.monetaryAccountProfile; } - public void setMonetaryAccountProfile(List monetaryAccountProfile) { + public void setMonetaryAccountProfile(MonetaryAccountProfileApiObject monetaryAccountProfile) { this.monetaryAccountProfile = monetaryAccountProfile; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountBankApiObject.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountBankApiObject.java index d01333a5..3d40a063 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountBankApiObject.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountBankApiObject.java @@ -192,11 +192,11 @@ public class MonetaryAccountBankApiObject extends BunqModel { private Long userId; /** - * The profiles of the account. + * The profile of the account. */ @Expose @SerializedName("monetary_account_profile") - private List monetaryAccountProfile; + private MonetaryAccountProfileApiObject monetaryAccountProfile; /** * The legal name of the user / company using this monetary account. @@ -851,13 +851,13 @@ public void setUserId(Long userId) { } /** - * The profiles of the account. + * The profile of the account. */ - public List getMonetaryAccountProfile() { + public MonetaryAccountProfileApiObject getMonetaryAccountProfile() { return this.monetaryAccountProfile; } - public void setMonetaryAccountProfile(List monetaryAccountProfile) { + public void setMonetaryAccountProfile(MonetaryAccountProfileApiObject monetaryAccountProfile) { this.monetaryAccountProfile = monetaryAccountProfile; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountCardApiObject.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountCardApiObject.java index 6c01a33c..577dffbf 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountCardApiObject.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountCardApiObject.java @@ -144,11 +144,11 @@ public class MonetaryAccountCardApiObject extends BunqModel { private AmountObject balanceConverted; /** - * The profiles of the account. + * The profile of the account. */ @Expose @SerializedName("monetary_account_profile") - private List monetaryAccountProfile; + private MonetaryAccountProfileApiObject monetaryAccountProfile; /** * The settings of the MonetaryAccount. @@ -465,13 +465,13 @@ public void setBalanceConverted(AmountObject balanceConverted) { } /** - * The profiles of the account. + * The profile of the account. */ - public List getMonetaryAccountProfile() { + public MonetaryAccountProfileApiObject getMonetaryAccountProfile() { return this.monetaryAccountProfile; } - public void setMonetaryAccountProfile(List monetaryAccountProfile) { + public void setMonetaryAccountProfile(MonetaryAccountProfileApiObject monetaryAccountProfile) { this.monetaryAccountProfile = monetaryAccountProfile; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountExternalApiObject.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountExternalApiObject.java index 4bcd2722..691d5c9d 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountExternalApiObject.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountExternalApiObject.java @@ -188,11 +188,11 @@ public class MonetaryAccountExternalApiObject extends BunqModel { private Long userId; /** - * The profiles of the account. + * The profile of the account. */ @Expose @SerializedName("monetary_account_profile") - private List monetaryAccountProfile; + private MonetaryAccountProfileApiObject monetaryAccountProfile; /** * The legal name of the user / company using this monetary account. @@ -853,13 +853,13 @@ public void setUserId(Long userId) { } /** - * The profiles of the account. + * The profile of the account. */ - public List getMonetaryAccountProfile() { + public MonetaryAccountProfileApiObject getMonetaryAccountProfile() { return this.monetaryAccountProfile; } - public void setMonetaryAccountProfile(List monetaryAccountProfile) { + public void setMonetaryAccountProfile(MonetaryAccountProfileApiObject monetaryAccountProfile) { this.monetaryAccountProfile = monetaryAccountProfile; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountExternalSavingsApiObject.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountExternalSavingsApiObject.java index 405c83f5..bae0cbed 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountExternalSavingsApiObject.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountExternalSavingsApiObject.java @@ -182,11 +182,11 @@ public class MonetaryAccountExternalSavingsApiObject extends BunqModel { private Long userId; /** - * The profiles of the account. + * The profile of the account. */ @Expose @SerializedName("monetary_account_profile") - private List monetaryAccountProfile; + private MonetaryAccountProfileApiObject monetaryAccountProfile; /** * The legal name of the user / company using this monetary account. @@ -878,13 +878,13 @@ public void setUserId(Long userId) { } /** - * The profiles of the account. + * The profile of the account. */ - public List getMonetaryAccountProfile() { + public MonetaryAccountProfileApiObject getMonetaryAccountProfile() { return this.monetaryAccountProfile; } - public void setMonetaryAccountProfile(List monetaryAccountProfile) { + public void setMonetaryAccountProfile(MonetaryAccountProfileApiObject monetaryAccountProfile) { this.monetaryAccountProfile = monetaryAccountProfile; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountInvestmentApiObject.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountInvestmentApiObject.java index 128bd97a..521c7e0a 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountInvestmentApiObject.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountInvestmentApiObject.java @@ -166,11 +166,11 @@ public class MonetaryAccountInvestmentApiObject extends BunqModel { private Long userId; /** - * The profiles of the account. + * The profile of the account. */ @Expose @SerializedName("monetary_account_profile") - private List monetaryAccountProfile; + private MonetaryAccountProfileApiObject monetaryAccountProfile; /** * The legal name of the user / company using this monetary account. @@ -626,13 +626,13 @@ public void setUserId(Long userId) { } /** - * The profiles of the account. + * The profile of the account. */ - public List getMonetaryAccountProfile() { + public MonetaryAccountProfileApiObject getMonetaryAccountProfile() { return this.monetaryAccountProfile; } - public void setMonetaryAccountProfile(List monetaryAccountProfile) { + public void setMonetaryAccountProfile(MonetaryAccountProfileApiObject monetaryAccountProfile) { this.monetaryAccountProfile = monetaryAccountProfile; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountJointApiObject.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountJointApiObject.java index 208bf313..c97751b2 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountJointApiObject.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountJointApiObject.java @@ -195,11 +195,11 @@ public class MonetaryAccountJointApiObject extends BunqModel { private Long userId; /** - * The profiles of the account. + * The profile of the account. */ @Expose @SerializedName("monetary_account_profile") - private List monetaryAccountProfile; + private MonetaryAccountProfileApiObject monetaryAccountProfile; /** * The settings of the MonetaryAccount. @@ -862,13 +862,13 @@ public void setUserId(Long userId) { } /** - * The profiles of the account. + * The profile of the account. */ - public List getMonetaryAccountProfile() { + public MonetaryAccountProfileApiObject getMonetaryAccountProfile() { return this.monetaryAccountProfile; } - public void setMonetaryAccountProfile(List monetaryAccountProfile) { + public void setMonetaryAccountProfile(MonetaryAccountProfileApiObject monetaryAccountProfile) { this.monetaryAccountProfile = monetaryAccountProfile; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountLightApiObject.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountLightApiObject.java index a385f4ec..f3f08b79 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountLightApiObject.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountLightApiObject.java @@ -234,11 +234,11 @@ public class MonetaryAccountLightApiObject extends BunqModel { private AmountObject balanceConverted; /** - * The profiles of the account. + * The profile of the account. */ @Expose @SerializedName("monetary_account_profile") - private List monetaryAccountProfile; + private MonetaryAccountProfileApiObject monetaryAccountProfile; /** * The budgets of the MonetaryAccount. @@ -714,13 +714,13 @@ public void setBalanceConverted(AmountObject balanceConverted) { } /** - * The profiles of the account. + * The profile of the account. */ - public List getMonetaryAccountProfile() { + public MonetaryAccountProfileApiObject getMonetaryAccountProfile() { return this.monetaryAccountProfile; } - public void setMonetaryAccountProfile(List monetaryAccountProfile) { + public void setMonetaryAccountProfile(MonetaryAccountProfileApiObject monetaryAccountProfile) { this.monetaryAccountProfile = monetaryAccountProfile; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountSavingsApiObject.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountSavingsApiObject.java index 12be818a..15a73420 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountSavingsApiObject.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountSavingsApiObject.java @@ -188,11 +188,11 @@ public class MonetaryAccountSavingsApiObject extends BunqModel { private Long userId; /** - * The profiles of the account. + * The profile of the account. */ @Expose @SerializedName("monetary_account_profile") - private List monetaryAccountProfile; + private MonetaryAccountProfileApiObject monetaryAccountProfile; /** * The settings of the MonetaryAccount. @@ -855,13 +855,13 @@ public void setUserId(Long userId) { } /** - * The profiles of the account. + * The profile of the account. */ - public List getMonetaryAccountProfile() { + public MonetaryAccountProfileApiObject getMonetaryAccountProfile() { return this.monetaryAccountProfile; } - public void setMonetaryAccountProfile(List monetaryAccountProfile) { + public void setMonetaryAccountProfile(MonetaryAccountProfileApiObject monetaryAccountProfile) { this.monetaryAccountProfile = monetaryAccountProfile; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountSwitchServiceApiObject.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountSwitchServiceApiObject.java index fbe0e298..16203bfb 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountSwitchServiceApiObject.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountSwitchServiceApiObject.java @@ -79,11 +79,11 @@ public class MonetaryAccountSwitchServiceApiObject extends BunqModel { private AmountObject balanceConverted; /** - * The profiles of the account. + * The profile of the account. */ @Expose @SerializedName("monetary_account_profile") - private List monetaryAccountProfile; + private MonetaryAccountProfileApiObject monetaryAccountProfile; /** * The settings of the MonetaryAccount. @@ -268,13 +268,13 @@ public void setBalanceConverted(AmountObject balanceConverted) { } /** - * The profiles of the account. + * The profile of the account. */ - public List getMonetaryAccountProfile() { + public MonetaryAccountProfileApiObject getMonetaryAccountProfile() { return this.monetaryAccountProfile; } - public void setMonetaryAccountProfile(List monetaryAccountProfile) { + public void setMonetaryAccountProfile(MonetaryAccountProfileApiObject monetaryAccountProfile) { this.monetaryAccountProfile = monetaryAccountProfile; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/PaymentBatchEntryApiObject.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/PaymentBatchEntryApiObject.java new file mode 100644 index 00000000..c90ffa10 --- /dev/null +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/PaymentBatchEntryApiObject.java @@ -0,0 +1,308 @@ +package com.bunq.sdk.model.generated.endpoint; + +import com.bunq.sdk.context.ApiContext; +import com.bunq.sdk.http.ApiClient; +import com.bunq.sdk.http.BunqResponse; +import com.bunq.sdk.http.BunqResponseRaw; +import com.bunq.sdk.model.core.BunqModel; +import com.bunq.sdk.model.core.MonetaryAccountReference; +import com.bunq.sdk.model.generated.object.AmountObject; +import com.bunq.sdk.model.generated.object.ErrorObject; +import com.bunq.sdk.model.generated.object.PointerObject; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.lang.model.type.NullType; + +/** + * Manage entries inside of a payment batch. + */ +public class PaymentBatchEntryApiObject extends BunqModel { + + /** + * Endpoint constants. + */ + protected static final String ENDPOINT_URL_READ = "user/%s/monetary-account/%s/payment-batch/%s/entry/%s"; + protected static final String ENDPOINT_URL_UPDATE = "user/%s/monetary-account/%s/payment-batch/%s/entry/%s"; + + /** + * Field constants. + */ + public static final String FIELD_STATUS = "status"; + + /** + * Object type. + */ + protected static final String OBJECT_TYPE_GET = "PaymentBatchEntry"; + + /** + * The ID of the monetary account from which the payment was made. + */ + @Expose + @SerializedName("monetary_account_id") + private Long monetaryAccountId; + + /** + * The ID of the Payment Batch Entry. + */ + @Expose + @SerializedName("payment_batch_id") + private Long paymentBatchId; + + /** + * The status of the Payment. + */ + @Expose + @SerializedName("status") + private String status; + + /** + * The amount. + */ + @Expose + @SerializedName("amount") + private AmountObject amount; + + /** + * The pointer to the party where the payment should be made to. + */ + @Expose + @SerializedName("counter_pointer") + private PointerObject counterPointer; + + /** + * The description for the Payment. + */ + @Expose + @SerializedName("description") + private String description; + + /** + * The payment, if it was made. + */ + @Expose + @SerializedName("payment") + private PaymentApiObject payment; + + /** + * The errors encountered while executing the payment. + */ + @Expose + @SerializedName("errors") + private List errors; + + /** + * The status of the payment batch, used to retry. + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + public PaymentBatchEntryApiObject() { + this(null); + } + + public PaymentBatchEntryApiObject(String status) { + this.statusFieldForRequest = status; + } /** + */ + public static BunqResponse get(Long paymentBatchId, Long paymentBatchEntryId, Long monetaryAccountId, Map params, Map customHeaders) { + ApiClient apiClient = new ApiClient(getApiContext()); + BunqResponseRaw responseRaw = apiClient.get(String.format(ENDPOINT_URL_READ, determineUserId(), determineMonetaryAccountId(monetaryAccountId), paymentBatchId, paymentBatchEntryId), params, customHeaders); + + return fromJson(PaymentBatchEntryApiObject.class, responseRaw, OBJECT_TYPE_GET); + } + + public static BunqResponse get() { + return get(null, null, null, null, null); + } + + public static BunqResponse get(Long paymentBatchId) { + return get(paymentBatchId, null, null, null, null); + } + + public static BunqResponse get(Long paymentBatchId, Long paymentBatchEntryId) { + return get(paymentBatchId, paymentBatchEntryId, null, null, null); + } + + public static BunqResponse get(Long paymentBatchId, Long paymentBatchEntryId, Long monetaryAccountId) { + return get(paymentBatchId, paymentBatchEntryId, monetaryAccountId, null, null); + } + + public static BunqResponse get(Long paymentBatchId, Long paymentBatchEntryId, Long monetaryAccountId, Map params) { + return get(paymentBatchId, paymentBatchEntryId, monetaryAccountId, params, null); + } + + /** + * @param status The status of the payment batch, used to retry. + */ + public static BunqResponse update(Long paymentBatchId, Long paymentBatchEntryId, Long monetaryAccountId, String status, Map customHeaders) { + ApiClient apiClient = new ApiClient(getApiContext()); + + if (customHeaders == null) { + customHeaders = new HashMap<>(); + } + + HashMap requestMap = new HashMap<>(); +requestMap.put(FIELD_STATUS, status); + + byte[] requestBytes = determineAllRequestByte(requestMap); + BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), paymentBatchId, paymentBatchEntryId), requestBytes, customHeaders); + + return processForId(responseRaw); + } + + public static BunqResponse update(Long paymentBatchId) { + return update(paymentBatchId, null, null, null, null); + } + + public static BunqResponse update(Long paymentBatchId, Long paymentBatchEntryId) { + return update(paymentBatchId, paymentBatchEntryId, null, null, null); + } + + public static BunqResponse update(Long paymentBatchId, Long paymentBatchEntryId, Long monetaryAccountId) { + return update(paymentBatchId, paymentBatchEntryId, monetaryAccountId, null, null); + } + + public static BunqResponse update(Long paymentBatchId, Long paymentBatchEntryId, Long monetaryAccountId, String status) { + return update(paymentBatchId, paymentBatchEntryId, monetaryAccountId, status, null); + } + + /** + * The ID of the monetary account from which the payment was made. + */ + public Long getMonetaryAccountId() { + return this.monetaryAccountId; + } + + public void setMonetaryAccountId(Long monetaryAccountId) { + this.monetaryAccountId = monetaryAccountId; + } + + /** + * The ID of the Payment Batch Entry. + */ + public Long getPaymentBatchId() { + return this.paymentBatchId; + } + + public void setPaymentBatchId(Long paymentBatchId) { + this.paymentBatchId = paymentBatchId; + } + + /** + * The status of the Payment. + */ + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } + + /** + * The amount. + */ + public AmountObject getAmount() { + return this.amount; + } + + public void setAmount(AmountObject amount) { + this.amount = amount; + } + + /** + * The pointer to the party where the payment should be made to. + */ + public PointerObject getCounterPointer() { + return this.counterPointer; + } + + public void setCounterPointer(PointerObject counterPointer) { + this.counterPointer = counterPointer; + } + + /** + * The description for the Payment. + */ + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + /** + * The payment, if it was made. + */ + public PaymentApiObject getPayment() { + return this.payment; + } + + public void setPayment(PaymentApiObject payment) { + this.payment = payment; + } + + /** + * The errors encountered while executing the payment. + */ + public List getErrors() { + return this.errors; + } + + public void setErrors(List errors) { + this.errors = errors; + } + + /** + */ + public boolean isAllFieldNull() { + if (this.monetaryAccountId != null) { + return false; + } + + if (this.paymentBatchId != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.amount != null) { + return false; + } + + if (this.counterPointer != null) { + return false; + } + + if (this.description != null) { + return false; + } + + if (this.payment != null) { + return false; + } + + if (this.errors != null) { + return false; + } + + return true; + } + + /** + */ + public static PaymentBatchEntryApiObject fromJsonReader(JsonReader reader) { + return fromJsonReader(PaymentBatchEntryApiObject.class, reader); + } + +} diff --git a/src/test/java/com/bunq/sdk/http/ErrorResponseIdTest.java b/src/test/java/com/bunq/sdk/http/ErrorResponseIdTest.java index 62672cdb..bf125409 100644 --- a/src/test/java/com/bunq/sdk/http/ErrorResponseIdTest.java +++ b/src/test/java/com/bunq/sdk/http/ErrorResponseIdTest.java @@ -12,7 +12,7 @@ public class ErrorResponseIdTest extends BunqSdkTestBase { /** * Invalid user id to trigger BadRequestException */ - private static final int INVALID_MONETARY_ACCOUNT_ID = 0; + private static final long INVALID_MONETARY_ACCOUNT_ID = 0; @Test public void badRequestWitResponseIdTest() { diff --git a/src/test/java/com/bunq/sdk/http/PaginationScenarioTest.java b/src/test/java/com/bunq/sdk/http/PaginationScenarioTest.java index 43e0e344..415852b4 100644 --- a/src/test/java/com/bunq/sdk/http/PaginationScenarioTest.java +++ b/src/test/java/com/bunq/sdk/http/PaginationScenarioTest.java @@ -22,9 +22,9 @@ public class PaginationScenarioTest extends BunqSdkTestBase { /** * Constants for scenario testing. */ - private final static int PAYMENT_LISTING_PAGE_SIZE = 2; - private final static int PAYMENT_REQUIRED_COUNT_MINIMUM = PAYMENT_LISTING_PAGE_SIZE * 2; - private final static int NUMBER_ZERO = 0; + private final static long PAYMENT_LISTING_PAGE_SIZE = 2; + private final static long PAYMENT_REQUIRED_COUNT_MINIMUM = PAYMENT_LISTING_PAGE_SIZE * 2; + private final static long NUMBER_ZERO = 0; /** * Constants for payment creation. @@ -39,17 +39,17 @@ public class PaginationScenarioTest extends BunqSdkTestBase { private static final Gson gson = BunqGsonBuilder.buildDefault().create(); private static void EnsureEnoughPayments() { - int missingPaymentCount = GetPaymentsMissingCount(); + long missingPaymentCount = GetPaymentsMissingCount(); List allPayment = new ArrayList<>(); - for (int i = NUMBER_ZERO; i < missingPaymentCount; ++i) { + for (long i = NUMBER_ZERO; i < missingPaymentCount; ++i) { allPayment.add(createPayment()); } PaymentBatchApiObject.create(allPayment); } - private static int GetPaymentsMissingCount() { + private static long GetPaymentsMissingCount() { return PAYMENT_REQUIRED_COUNT_MINIMUM - GetPaymentsRequired().size(); } diff --git a/src/test/java/com/bunq/sdk/http/PaginationTest.java b/src/test/java/com/bunq/sdk/http/PaginationTest.java index def314aa..8a121553 100644 --- a/src/test/java/com/bunq/sdk/http/PaginationTest.java +++ b/src/test/java/com/bunq/sdk/http/PaginationTest.java @@ -16,10 +16,10 @@ public class PaginationTest { /** * Values of pagination properties for testing. */ - private static final int PAGINATION_OLDER_ID_CUSTOM = 1; - private static final int PAGINATION_NEWER_ID_CUSTOM = 2; - private static final int PAGINATION_FUTURE_ID_CUSTOM = 3; - private static final int PAGINATION_COUNT_CUSTOM = 5; + private static final long PAGINATION_OLDER_ID_CUSTOM = 1; + private static final long PAGINATION_NEWER_ID_CUSTOM = 2; + private static final long PAGINATION_FUTURE_ID_CUSTOM = 3; + private static final long PAGINATION_COUNT_CUSTOM = 5; private static Pagination createPaginationWithAllPropertiesSet() { Pagination pagination = new Pagination(); @@ -36,7 +36,7 @@ public void getUrlParamsCountOnlyTest() { Pagination pagination = createPaginationWithAllPropertiesSet(); Map urlParamsCountOnlyExpected = new HashMap<>(); urlParamsCountOnlyExpected.put(Pagination.PARAM_COUNT, - Integer.toString(PAGINATION_COUNT_CUSTOM)); + Long.toString(PAGINATION_COUNT_CUSTOM)); Assert.assertEquals(urlParamsCountOnlyExpected, pagination.getUrlParamsCountOnly()); } @@ -46,9 +46,9 @@ public void getUrlParamsPreviousPageTest() { Pagination pagination = createPaginationWithAllPropertiesSet(); Map urlParamsPreviousPageExpected = new HashMap<>(); urlParamsPreviousPageExpected.put(Pagination.PARAM_COUNT, - Integer.toString(PAGINATION_COUNT_CUSTOM)); + Long.toString(PAGINATION_COUNT_CUSTOM)); urlParamsPreviousPageExpected.put(Pagination.PARAM_OLDER_ID, - Integer.toString(PAGINATION_OLDER_ID_CUSTOM)); + Long.toString(PAGINATION_OLDER_ID_CUSTOM)); Assert.assertTrue(pagination.hasPreviousPage()); Assert.assertEquals(urlParamsPreviousPageExpected, pagination.getUrlParamsPreviousPage()); @@ -60,7 +60,7 @@ public void getUrlParamsPreviousPageNoCountTest() { pagination.setCount(null); Map urlParamsPreviousPageExpected = new HashMap<>(); urlParamsPreviousPageExpected.put(Pagination.PARAM_OLDER_ID, - Integer.toString(PAGINATION_OLDER_ID_CUSTOM)); + Long.toString(PAGINATION_OLDER_ID_CUSTOM)); Assert.assertTrue(pagination.hasPreviousPage()); Assert.assertEquals(urlParamsPreviousPageExpected, pagination.getUrlParamsPreviousPage()); @@ -71,9 +71,9 @@ public void getUrlParamsNextPageNewerTest() { Pagination pagination = createPaginationWithAllPropertiesSet(); Map urlParamsNextPageExpected = new HashMap<>(); urlParamsNextPageExpected.put(Pagination.PARAM_COUNT, - Integer.toString(PAGINATION_COUNT_CUSTOM)); + Long.toString(PAGINATION_COUNT_CUSTOM)); urlParamsNextPageExpected.put(Pagination.PARAM_NEWER_ID, - Integer.toString(PAGINATION_NEWER_ID_CUSTOM)); + Long.toString(PAGINATION_NEWER_ID_CUSTOM)); Assert.assertTrue(pagination.hasNextPageAssured()); Assert.assertEquals(urlParamsNextPageExpected, pagination.getUrlParamsNextPage()); @@ -85,7 +85,7 @@ public void getUrlParamsNextPageNewerNoCountTest() { pagination.setCount(null); Map urlParamsNextPageExpected = new HashMap<>(); urlParamsNextPageExpected.put(Pagination.PARAM_NEWER_ID, - Integer.toString(PAGINATION_NEWER_ID_CUSTOM)); + Long.toString(PAGINATION_NEWER_ID_CUSTOM)); Assert.assertTrue(pagination.hasNextPageAssured()); Assert.assertEquals(urlParamsNextPageExpected, pagination.getUrlParamsNextPage()); @@ -97,9 +97,9 @@ public void getUrlParamsNextPageFutureTest() { pagination.setNewerId(null); Map urlParamsNextPageExpected = new HashMap<>(); urlParamsNextPageExpected.put(Pagination.PARAM_COUNT, - Integer.toString(PAGINATION_COUNT_CUSTOM)); + Long.toString(PAGINATION_COUNT_CUSTOM)); urlParamsNextPageExpected.put(Pagination.PARAM_NEWER_ID, - Integer.toString(PAGINATION_FUTURE_ID_CUSTOM)); + Long.toString(PAGINATION_FUTURE_ID_CUSTOM)); Assert.assertFalse(pagination.hasNextPageAssured()); Assert.assertEquals(urlParamsNextPageExpected, pagination.getUrlParamsNextPage()); @@ -112,7 +112,7 @@ public void getUrlParamsNextPageFutureNoCountTest() { pagination.setCount(null); Map urlParamsNextPageExpected = new HashMap<>(); urlParamsNextPageExpected.put(Pagination.PARAM_NEWER_ID, - Integer.toString(PAGINATION_FUTURE_ID_CUSTOM)); + Long.toString(PAGINATION_FUTURE_ID_CUSTOM)); Assert.assertFalse(pagination.hasNextPageAssured()); Assert.assertEquals(urlParamsNextPageExpected, pagination.getUrlParamsNextPage()); diff --git a/src/test/java/com/bunq/sdk/model/generated/endpoint/PaymentTest.java b/src/test/java/com/bunq/sdk/model/generated/endpoint/PaymentTest.java index e2ac96ac..02146279 100644 --- a/src/test/java/com/bunq/sdk/model/generated/endpoint/PaymentTest.java +++ b/src/test/java/com/bunq/sdk/model/generated/endpoint/PaymentTest.java @@ -22,7 +22,7 @@ public class PaymentTest extends BunqSdkTestBase { */ private static final String AMOUNT_EUR = "0.01"; private static final String PAYMENT_DESCRIPTION = "Java test Payment"; - private static final int PAGE_SIZE = 100; + private static final long PAGE_SIZE = 100; private static final int MAXIMUM_AMOUNT_OF_PAYMENT = 10; /** diff --git a/src/test/java/com/bunq/sdk/model/generated/endpoint/SessionTest.java b/src/test/java/com/bunq/sdk/model/generated/endpoint/SessionTest.java index 2ceb6023..08842f95 100644 --- a/src/test/java/com/bunq/sdk/model/generated/endpoint/SessionTest.java +++ b/src/test/java/com/bunq/sdk/model/generated/endpoint/SessionTest.java @@ -22,7 +22,7 @@ public class SessionTest extends BunqSdkTestBase { /** * Config value. */ - private static final int SESSION_ID_DUMMY = 0; + private static final long SESSION_ID_DUMMY = 0; private static final int SECONDS_TO_SLEEP = 2; /**