FINERACT-2081: Fetch configurations by name
This commit is contained in:
+80
@@ -0,0 +1,80 @@
|
|||||||
|
/**
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.fineract.infrastructure.configuration.api;
|
||||||
|
|
||||||
|
public final class GlobalConfigurationConstants {
|
||||||
|
|
||||||
|
public static final String MAKER_CHECKER = "maker-checker";
|
||||||
|
public static final String AMAZON_S3 = "amazon-s3";
|
||||||
|
public static final String RESCHEDULE_FUTURE_REPAYMENTS = "reschedule-future-repayments";
|
||||||
|
public static final String RESCHEDULE_REPAYMENTS_ON_HOLIDAYS = "reschedule-repayments-on-holidays";
|
||||||
|
public static final String ALLOW_TRANSACTIONS_ON_HOLIDAY = "allow-transactions-on-holiday";
|
||||||
|
public static final String ALLOW_TRANSACTIONS_ON_NON_WORKING_DAY = "allow-transactions-on-non-workingday";
|
||||||
|
public static final String CONSTRAINT_APPROACH_FOR_DATATABLES = "constraint-approach-for-datatables";
|
||||||
|
public static final String PENALTY_WAIT_PERIOD = "penalty-wait-period";
|
||||||
|
public static final String FORCE_PASSWORD_RESET_DAYS = "force-password-reset-days";
|
||||||
|
public static final String GRACE_ON_PENALTY_POSTING = "grace-on-penalty-posting";
|
||||||
|
public static final String SAVINGS_INTEREST_POSTING_CURRENT_PERIOD_END = "savings-interest-posting-current-period-end";
|
||||||
|
public static final String FINANCIAL_YEAR_BEGINNING_MONTH = "financial-year-beginning-month";
|
||||||
|
public static final String MIN_CLIENTS_IN_GROUP = "min-clients-in-group";
|
||||||
|
public static final String MAX_CLIENTS_IN_GROUP = "max-clients-in-group";
|
||||||
|
public static final String MEETINGS_MANDATORY_FOR_JLG_LOANS = "meetings-mandatory-for-jlg-loans";
|
||||||
|
public static final String OFFICE_SPECIFIC_PRODUCTS_ENABLED = "office-specific-products-enabled";
|
||||||
|
public static final String RESTRICT_PRODUCTS_TO_USER_OFFICE = "restrict-products-to-user-office";
|
||||||
|
public static final String OFFICE_OPENING_BALANCES_CONTRA_ACCOUNT = "office-opening-balances-contra-account";
|
||||||
|
public static final String ROUNDING_MODE = "rounding-mode";
|
||||||
|
public static final String BACKDATE_PENALTIES_ENABLED = "backdate-penalties-enabled";
|
||||||
|
public static final String ORGANISATION_START_DATE = "organisation-start-date";
|
||||||
|
public static final String PAYMENT_TYPE_APPLICABLE_FOR_DISBURSEMENT_CHARGES = "paymenttype-applicable-for-disbursement-charges";
|
||||||
|
public static final String INTEREST_CHARGED_FROM_DATE_SAME_AS_DISBURSAL_DATE = "interest-charged-from-date-same-as-disbursal-date";
|
||||||
|
public static final String SKIP_REPAYMENT_ON_FIRST_DAY_OF_MONTH = "skip-repayment-on-first-day-of-month";
|
||||||
|
public static final String CHANGE_EMI_IF_REPAYMENT_DATE_SAME_AS_DISBURSEMENT_DATE = "change-emi-if-repaymentdate-same-as-disbursementdate";
|
||||||
|
public static final String DAILY_TPT_LIMIT = "daily-tpt-limit";
|
||||||
|
public static final String ENABLE_ADDRESS = "enable-address";
|
||||||
|
public static final String SUB_RATES = "sub-rates";
|
||||||
|
public static final String LOAN_RESCHEDULE_IS_FIRST_PAYDAY_ALLOWED_ON_HOLIDAY = "loan-reschedule-is-first-payday-allowed-on-holiday";
|
||||||
|
public static final String ACCOUNT_MAPPING_FOR_PAYMENT_TYPE = "account-mapping-for-payment-type";
|
||||||
|
public static final String ACCOUNT_MAPPING_FOR_CHARGE = "account-mapping-for-charge";
|
||||||
|
public static final String FIXED_DEPOSIT_TRANSFER_INTEREST_NEXT_DAY_FOR_PERIOD_END_POSTING = "fixed-deposit-transfer-interest-next-day-for-period-end-posting";
|
||||||
|
public static final String ALLOW_BACKDATED_TRANSACTION_BEFORE_INTEREST_POSTING = "allow-backdated-transaction-before-interest-posting";
|
||||||
|
public static final String ALLOW_BACKDATED_TRANSACTION_BEFORE_INTEREST_POSTING_DATE_FOR_DAYS = "allow-backdated-transaction-before-interest-posting-date-for-days";
|
||||||
|
public static final String CUSTOM_ACCOUNT_NUMBER_LENGTH = "custom-account-number-length";
|
||||||
|
public static final String RANDOM_ACCOUNT_NUMBER = "random-account-number";
|
||||||
|
public static final String IS_INTEREST_TO_BE_RECOVERED_FIRST_WHEN_GREATER_THAN_EMI = "is-interest-to-be-recovered-first-when-greater-than-emi";
|
||||||
|
public static final String IS_PRINCIPAL_COMPOUNDING_DISABLED_FOR_OVERDUE_LOANS = "is-principal-compounding-disabled-for-overdue-loans";
|
||||||
|
public static final String ENABLE_BUSINESS_DATE = "enable-business-date";
|
||||||
|
public static final String ENABLE_AUTOMATIC_COB_DATE_ADJUSTMENT = "enable-automatic-cob-date-adjustment";
|
||||||
|
public static final String ENABLE_POST_REVERSAL_TXNS_FOR_REVERSE_TRANSACTIONS = "enable-post-reversal-txns-for-reverse-transactions";
|
||||||
|
public static final String PURGE_EXTERNAL_EVENTS_OLDER_THAN_DAYS = "purge-external-events-older-than-days";
|
||||||
|
public static final String DAYS_BEFORE_REPAYMENT_IS_DUE = "days-before-repayment-is-due";
|
||||||
|
public static final String DAYS_AFTER_REPAYMENT_IS_OVERDUE = "days-after-repayment-is-overdue";
|
||||||
|
public static final String ENABLE_AUTO_GENERATED_EXTERNAL_ID = "enable-auto-generated-external-id";
|
||||||
|
public static final String PURGE_PROCESSED_COMMANDS_OLDER_THAN_DAYS = "purge-processed-commands-older-than-days";
|
||||||
|
public static final String ENABLE_COB_BULK_EVENT = "enable-cob-bulk-event";
|
||||||
|
public static final String EXTERNAL_EVENT_BATCH_SIZE = "external-event-batch-size";
|
||||||
|
public static final String REPORT_EXPORT_S3_FOLDER_NAME = "report-export-s3-folder-name";
|
||||||
|
public static final String LOAN_ARREARS_DELINQUENCY_DISPLAY_DATA = "loan-arrears-delinquency-display-data";
|
||||||
|
public static final String CHARGE_ACCRUAL_DATE = "charge-accrual-date";
|
||||||
|
public static final String ASSET_EXTERNALIZATION_OF_NON_ACTIVE_LOANS = "asset-externalization-of-non-active-loans";
|
||||||
|
public static final String ENABLE_SAME_MAKER_CHECKER = "enable-same-maker-checker";
|
||||||
|
public static final String NEXT_PAYMENT_DUE_DATE = "next-payment-due-date";
|
||||||
|
public static final String ENABLE_PAYMENT_HUB_INTEGRATION = "enable-payment-hub-integration";
|
||||||
|
|
||||||
|
private GlobalConfigurationConstants() {}
|
||||||
|
}
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
/**
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.fineract.infrastructure.configuration.exception;
|
||||||
|
|
||||||
|
public class GlobalConfigurationException extends RuntimeException {
|
||||||
|
|
||||||
|
public GlobalConfigurationException(final String name) {
|
||||||
|
super("Global configuration with name: '" + name
|
||||||
|
+ "' is not in the supported format! Global configuration name can only contains lowercase letters or -, and must start with letters!");
|
||||||
|
}
|
||||||
|
}
|
||||||
+73
@@ -0,0 +1,73 @@
|
|||||||
|
/**
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.fineract.infrastructure.configuration.service;
|
||||||
|
|
||||||
|
import static org.apache.commons.collections4.CollectionUtils.isNotEmpty;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.exception.GlobalConfigurationException;
|
||||||
|
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
|
||||||
|
import org.apache.fineract.infrastructure.core.service.JdbcTemplateFactory;
|
||||||
|
import org.apache.fineract.infrastructure.core.service.tenant.TenantDetailsService;
|
||||||
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class GlobalConfigurationValidationService implements InitializingBean {
|
||||||
|
|
||||||
|
private static final String GLOBAL_CONFIGURATION_NAME_PATTERN = "^[a-z][a-z0-9-]*$";
|
||||||
|
private final TenantDetailsService tenantDetailsService;
|
||||||
|
private final JdbcTemplateFactory jdbcTemplateFactory;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterPropertiesSet() throws Exception {
|
||||||
|
validateGlobalConfigurationNames();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateGlobalConfigurationNames() {
|
||||||
|
List<FineractPlatformTenant> tenants = tenantDetailsService.findAllTenants();
|
||||||
|
|
||||||
|
if (isNotEmpty(tenants)) {
|
||||||
|
for (FineractPlatformTenant tenant : tenants) {
|
||||||
|
validateGlobalConfigurationForIndividualTenant(tenant);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateGlobalConfigurationForIndividualTenant(FineractPlatformTenant tenant) {
|
||||||
|
log.debug("Validating global configuration for {}", tenant.getTenantIdentifier());
|
||||||
|
List<String> globalConfigurationNames = getGlobalConfigurationNames(tenant);
|
||||||
|
|
||||||
|
globalConfigurationNames.forEach(globalConfigurationName -> {
|
||||||
|
if (!globalConfigurationName.matches(GLOBAL_CONFIGURATION_NAME_PATTERN)) {
|
||||||
|
throw new GlobalConfigurationException(globalConfigurationName);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<String> getGlobalConfigurationNames(FineractPlatformTenant tenant) {
|
||||||
|
final JdbcTemplate jdbcTemplate = jdbcTemplateFactory.create(tenant);
|
||||||
|
return jdbcTemplate.queryForList("select gc.name as name from c_configuration gc", String.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -16,7 +16,7 @@
|
|||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.event.external.service;
|
package org.apache.fineract.infrastructure.core.service;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
+1
@@ -29,6 +29,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
|
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
|
||||||
|
import org.apache.fineract.infrastructure.core.service.JdbcTemplateFactory;
|
||||||
import org.apache.fineract.infrastructure.core.service.tenant.TenantDetailsService;
|
import org.apache.fineract.infrastructure.core.service.tenant.TenantDetailsService;
|
||||||
import org.apache.fineract.infrastructure.event.business.domain.BulkBusinessEvent;
|
import org.apache.fineract.infrastructure.event.business.domain.BulkBusinessEvent;
|
||||||
import org.apache.fineract.infrastructure.event.business.domain.BusinessEvent;
|
import org.apache.fineract.infrastructure.event.business.domain.BusinessEvent;
|
||||||
|
|||||||
+3
-3
@@ -29,10 +29,10 @@ import org.springframework.stereotype.Component;
|
|||||||
@Order(Ordered.HIGHEST_PRECEDENCE)
|
@Order(Ordered.HIGHEST_PRECEDENCE)
|
||||||
public class GlobalConfigurationGlobalInitializerStep implements FineractGlobalInitializerStep {
|
public class GlobalConfigurationGlobalInitializerStep implements FineractGlobalInitializerStep {
|
||||||
|
|
||||||
public static final String CONFIG_KEY_ENABLE_ADDRESS = "Enable-Address";
|
public static final String CONFIG_KEY_ENABLE_ADDRESS = "enable-address";
|
||||||
public static final String CONFIG_KEY_ENABLE_INTEREST_CALCULATION = "interest-charged-from-date-same-as-disbursal-date";
|
public static final String CONFIG_KEY_ENABLE_INTEREST_CALCULATION = "interest-charged-from-date-same-as-disbursal-date";
|
||||||
public static final String CONFIG_KEY_ENABLE_BUSINESS_DATE = "enable_business_date";
|
public static final String CONFIG_KEY_ENABLE_BUSINESS_DATE = "enable-business-date";
|
||||||
public static final String CONFIG_KEY_ENABLE_RECALCULATE_COB_DATE = "enable_automatic_cob_date_adjustment";
|
public static final String CONFIG_KEY_ENABLE_RECALCULATE_COB_DATE = "enable-automatic-cob-date-adjustment";
|
||||||
public static final String CONFIG_KEY_DAYS_BEFORE_REPAYMENT_IS_DUE = "days-before-repayment-is-due";
|
public static final String CONFIG_KEY_DAYS_BEFORE_REPAYMENT_IS_DUE = "days-before-repayment-is-due";
|
||||||
public static final String CONFIG_KEY_DAYS_AFTER_REPAYMENT_IS_OVERDUE = "days-after-repayment-is-overdue";
|
public static final String CONFIG_KEY_DAYS_AFTER_REPAYMENT_IS_OVERDUE = "days-after-repayment-is-overdue";
|
||||||
public static final String CONFIG_KEY_ENABLE_AUTO_GENERATED_EXTERNAL_ID = "enable-auto-generated-external-id";
|
public static final String CONFIG_KEY_ENABLE_AUTO_GENERATED_EXTERNAL_ID = "enable-auto-generated-external-id";
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ Feature: BusinessDate
|
|||||||
|
|
||||||
|
|
||||||
Scenario: As a user I would like to enable the Business date configuration
|
Scenario: As a user I would like to enable the Business date configuration
|
||||||
Given Global configuration "enable_business_date" is enabled
|
Given Global configuration "enable-business-date" is enabled
|
||||||
|
|
||||||
|
|
||||||
Scenario: As a user I would like to disable the Business date configuration
|
Scenario: As a user I would like to disable the Business date configuration
|
||||||
Given Global configuration "enable_business_date" is disabled
|
Given Global configuration "enable-business-date" is disabled
|
||||||
|
|
||||||
|
|
||||||
Scenario: As a user I would like to set the business date
|
Scenario: As a user I would like to set the business date
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ Feature: Client
|
|||||||
|
|
||||||
|
|
||||||
Scenario Outline: Client creation with address functionality for Fineract
|
Scenario Outline: Client creation with address functionality for Fineract
|
||||||
When Global configuration "Enable-Address" is enabled
|
When Global configuration "enable-address" is enabled
|
||||||
When Admin creates a client with Firstname <firstName> and Lastname <lastName> with address
|
When Admin creates a client with Firstname <firstName> and Lastname <lastName> with address
|
||||||
Then Client is created successfully
|
Then Client is created successfully
|
||||||
Examples:
|
Examples:
|
||||||
|
|||||||
@@ -5659,7 +5659,7 @@ Feature: Loan
|
|||||||
When Admin set "LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALCULATION_TILL_REST_FREQUENCY" loan product "DEFAULT" transaction type to "LAST_INSTALLMENT" future installment allocation rule
|
When Admin set "LP2_ADV_PYMNT_INTEREST_DAILY_EMI_360_30_INTEREST_RECALCULATION_TILL_REST_FREQUENCY" loan product "DEFAULT" transaction type to "LAST_INSTALLMENT" future installment allocation rule
|
||||||
|
|
||||||
Scenario: Interest recalculation - S1 daily for overdue loan
|
Scenario: Interest recalculation - S1 daily for overdue loan
|
||||||
Given Global configuration "enable_business_date" is enabled
|
Given Global configuration "enable-business-date" is enabled
|
||||||
When Admin sets the business date to "1 January 2024"
|
When Admin sets the business date to "1 January 2024"
|
||||||
When Admin creates a client with random data
|
When Admin creates a client with random data
|
||||||
When Admin creates a fully customized loan with the following data:
|
When Admin creates a fully customized loan with the following data:
|
||||||
@@ -5682,7 +5682,7 @@ Feature: Loan
|
|||||||
When Admin removes "LOAN_INTEREST_RECALCULATION" business step into LOAN_CLOSE_OF_BUSINESS workflow
|
When Admin removes "LOAN_INTEREST_RECALCULATION" business step into LOAN_CLOSE_OF_BUSINESS workflow
|
||||||
|
|
||||||
Scenario: Interest recalculation - S2 2 overdue
|
Scenario: Interest recalculation - S2 2 overdue
|
||||||
Given Global configuration "enable_business_date" is enabled
|
Given Global configuration "enable-business-date" is enabled
|
||||||
When Admin sets the business date to "1 January 2024"
|
When Admin sets the business date to "1 January 2024"
|
||||||
When Admin creates a client with random data
|
When Admin creates a client with random data
|
||||||
When Admin creates a fully customized loan with the following data:
|
When Admin creates a fully customized loan with the following data:
|
||||||
@@ -5705,7 +5705,7 @@ Feature: Loan
|
|||||||
When Admin removes "LOAN_INTEREST_RECALCULATION" business step into LOAN_CLOSE_OF_BUSINESS workflow
|
When Admin removes "LOAN_INTEREST_RECALCULATION" business step into LOAN_CLOSE_OF_BUSINESS workflow
|
||||||
|
|
||||||
Scenario: Interest recalculation - S3 1 paid, 1 overdue
|
Scenario: Interest recalculation - S3 1 paid, 1 overdue
|
||||||
Given Global configuration "enable_business_date" is enabled
|
Given Global configuration "enable-business-date" is enabled
|
||||||
When Admin sets the business date to "1 January 2024"
|
When Admin sets the business date to "1 January 2024"
|
||||||
When Admin creates a client with random data
|
When Admin creates a client with random data
|
||||||
When Admin creates a fully customized loan with the following data:
|
When Admin creates a fully customized loan with the following data:
|
||||||
|
|||||||
+27
-2
@@ -59,7 +59,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Tag(name = "Global Configuration", description = "Global configuration related to set of supported enable/disable configurations:\n" + "\n"
|
@Tag(name = "Global Configuration", description = "Global configuration related to set of supported enable/disable configurations:\n" + "\n"
|
||||||
+ "maker-checker - defaults to false - if true turns on maker-checker functionality\n"
|
+ "maker-checker - defaults to false - if true turns on maker-checker functionality\n"
|
||||||
+ "reschedule-future-repayments - defaults to false - if true reschedules repayemnts which falls on a non-working day to configured repayment rescheduling rule\n"
|
+ "reschedule-future-repayments - defaults to false - if true reschedules repayemnts which falls on a non-working day to configured repayment rescheduling rule\n"
|
||||||
+ "allow-transactions-on-non_workingday - defaults to false - if true allows transactions on non-working days\n"
|
+ "allow-transactions-on-non-workingday - defaults to false - if true allows transactions on non-working days\n"
|
||||||
+ "reschedule-repayments-on-holidays - defaults to false - if true reschedules repayemnts which falls on a non-working day to defined reschedule date\n"
|
+ "reschedule-repayments-on-holidays - defaults to false - if true reschedules repayemnts which falls on a non-working day to defined reschedule date\n"
|
||||||
+ "allow-transactions-on-holiday - defaults to false - if true allows transactions on holidays\n"
|
+ "allow-transactions-on-holiday - defaults to false - if true allows transactions on holidays\n"
|
||||||
+ "savings-interest-posting-current-period-end - Set it at the database level before any savings interest is posted. When set as false(default), interest will be posted on the first date of next period. If set as true, interest will be posted on last date of current period. There is no difference in the interest amount posted.\n"
|
+ "savings-interest-posting-current-period-end - Set it at the database level before any savings interest is posted. When set as false(default), interest will be posted on the first date of next period. If set as true, interest will be posted on last date of current period. There is no difference in the interest amount posted.\n"
|
||||||
@@ -123,7 +123,7 @@ public class GlobalConfigurationApiResource {
|
|||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@Operation(summary = "Retrieve Global Configuration", description = "Returns a global enable/disable configuration.\n" + "\n"
|
@Operation(summary = "Retrieve Global Configuration", description = "Returns a global enable/disable configuration.\n" + "\n"
|
||||||
+ "Example Requests:\n" + "\n" + "configurations/name/Enable-Address")
|
+ "Example Requests:\n" + "\n" + "configurations/name/enable-address")
|
||||||
@ApiResponses({
|
@ApiResponses({
|
||||||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GlobalConfigurationPropertyData.class))) })
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GlobalConfigurationPropertyData.class))) })
|
||||||
public String retrieveOneByName(@PathParam("name") @Parameter(description = "name") final String name, @Context final UriInfo uriInfo) {
|
public String retrieveOneByName(@PathParam("name") @Parameter(description = "name") final String name, @Context final UriInfo uriInfo) {
|
||||||
@@ -156,4 +156,29 @@ public class GlobalConfigurationApiResource {
|
|||||||
|
|
||||||
return this.toApiJsonSerializer.serialize(result);
|
return this.toApiJsonSerializer.serialize(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PUT
|
||||||
|
@Path("/name/{configName}")
|
||||||
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
|
@Operation(summary = "Update Global Configuration by name", description = "Updates an enable/disable global configuration item by name")
|
||||||
|
@RequestBody(required = true, content = @Content(schema = @Schema(implementation = GlobalConfigurationApiResourceSwagger.PutGlobalConfigurationsRequest.class)))
|
||||||
|
@ApiResponses({
|
||||||
|
@ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = GlobalConfigurationApiResourceSwagger.PutGlobalConfigurationsResponse.class))) })
|
||||||
|
public String updateConfigurationByName(@PathParam("configName") @Parameter(description = "configName") final String configName,
|
||||||
|
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
|
||||||
|
|
||||||
|
// TODO: Would be better to support string based identifier in Commands and resolve the entity by name in the
|
||||||
|
// service
|
||||||
|
final GlobalConfigurationPropertyData configurationData = this.readPlatformService.retrieveGlobalConfiguration(configName);
|
||||||
|
|
||||||
|
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
|
||||||
|
.updateGlobalConfiguration(configurationData.getId()) //
|
||||||
|
.withJson(apiRequestBodyAsJson) //
|
||||||
|
.build();
|
||||||
|
|
||||||
|
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
|
||||||
|
|
||||||
|
return this.toApiJsonSerializer.serialize(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-12
@@ -20,14 +20,12 @@ package org.apache.fineract.infrastructure.configuration.api;
|
|||||||
|
|
||||||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
||||||
import jakarta.ws.rs.Consumes;
|
import jakarta.ws.rs.Consumes;
|
||||||
import jakarta.ws.rs.POST;
|
import jakarta.ws.rs.PUT;
|
||||||
import jakarta.ws.rs.Path;
|
import jakarta.ws.rs.Path;
|
||||||
import jakarta.ws.rs.PathParam;
|
import jakarta.ws.rs.PathParam;
|
||||||
import jakarta.ws.rs.Produces;
|
import jakarta.ws.rs.Produces;
|
||||||
import jakarta.ws.rs.core.Context;
|
|
||||||
import jakarta.ws.rs.core.MediaType;
|
import jakarta.ws.rs.core.MediaType;
|
||||||
import jakarta.ws.rs.core.Response;
|
import jakarta.ws.rs.core.Response;
|
||||||
import jakarta.ws.rs.core.UriInfo;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.fineract.infrastructure.configuration.domain.GlobalConfigurationProperty;
|
import org.apache.fineract.infrastructure.configuration.domain.GlobalConfigurationProperty;
|
||||||
@@ -37,7 +35,6 @@ import org.apache.fineract.organisation.monetary.domain.MoneyHelper;
|
|||||||
import org.springframework.beans.factory.InitializingBean;
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
import org.springframework.context.annotation.Profile;
|
import org.springframework.context.annotation.Profile;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
|
|
||||||
@Profile(FineractProfiles.TEST)
|
@Profile(FineractProfiles.TEST)
|
||||||
@Component
|
@Component
|
||||||
@@ -61,24 +58,22 @@ public class InternalConfigurationsApiResource implements InitializingBean {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@PUT
|
||||||
@Path("{configId}/value/{configValue}")
|
@Path("name/{configName}/value/{configValue}")
|
||||||
@Consumes({ MediaType.APPLICATION_JSON })
|
@Consumes({ MediaType.APPLICATION_JSON })
|
||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
@SuppressFBWarnings("SLF4J_SIGN_ONLY_FORMAT")
|
@SuppressFBWarnings("SLF4J_SIGN_ONLY_FORMAT")
|
||||||
public Response updateGlobalConfiguration(@Context final UriInfo uriInfo, @PathParam("configId") Long configId,
|
public Response updateGlobalConfiguration(@PathParam("configName") String configName, @PathParam("configValue") Long configValue) {
|
||||||
@PathParam("configValue") Long configValue, @RequestBody(required = false) String error) {
|
|
||||||
log.warn("------------------------------------------------------------");
|
log.warn("------------------------------------------------------------");
|
||||||
log.warn(" ");
|
log.warn(" ");
|
||||||
log.warn("Update trap-door config: {}", configId);
|
log.warn("Update trap-door config: {}", configName);
|
||||||
log.warn(" ");
|
log.warn(" ");
|
||||||
log.warn("------------------------------------------------------------");
|
log.warn("------------------------------------------------------------");
|
||||||
|
|
||||||
final GlobalConfigurationProperty config = repository.findOneWithNotFoundDetection(configId);
|
final GlobalConfigurationProperty config = repository.findOneByNameWithNotFoundDetection(configName);
|
||||||
log.warn("Config to be updated {} original value {}", config.getName(), config.getValue());
|
|
||||||
config.setValue(configValue);
|
config.setValue(configValue);
|
||||||
repository.save(config);
|
repository.save(config);
|
||||||
log.warn("Config to be updated to {}", config.getValue());
|
log.warn("Config {} updated to {}", config.getName(), config.getValue());
|
||||||
repository.removeFromCache(config.getName());
|
repository.removeFromCache(config.getName());
|
||||||
MoneyHelper.fetchRoundingModeFromGlobalConfig();
|
MoneyHelper.fetchRoundingModeFromGlobalConfig();
|
||||||
|
|
||||||
|
|||||||
+95
-101
@@ -26,6 +26,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.apache.fineract.infrastructure.cache.domain.CacheType;
|
import org.apache.fineract.infrastructure.cache.domain.CacheType;
|
||||||
import org.apache.fineract.infrastructure.cache.domain.PlatformCache;
|
import org.apache.fineract.infrastructure.cache.domain.PlatformCache;
|
||||||
import org.apache.fineract.infrastructure.cache.domain.PlatformCacheRepository;
|
import org.apache.fineract.infrastructure.cache.domain.PlatformCacheRepository;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.configuration.data.GlobalConfigurationPropertyData;
|
import org.apache.fineract.infrastructure.configuration.data.GlobalConfigurationPropertyData;
|
||||||
import org.apache.fineract.useradministration.domain.Permission;
|
import org.apache.fineract.useradministration.domain.Permission;
|
||||||
import org.apache.fineract.useradministration.domain.PermissionRepository;
|
import org.apache.fineract.useradministration.domain.PermissionRepository;
|
||||||
@@ -38,23 +39,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class ConfigurationDomainServiceJpa implements ConfigurationDomainService {
|
public class ConfigurationDomainServiceJpa implements ConfigurationDomainService {
|
||||||
|
|
||||||
public static final String ENABLE_BUSINESS_DATE = "enable_business_date";
|
|
||||||
public static final String ENABLE_AUTOMATIC_COB_DATE_ADJUSTMENT = "enable_automatic_cob_date_adjustment";
|
|
||||||
public static final String EXTERNAL_EVENTS_PURGE_DAYS = "purge-external-events-older-than-days";
|
|
||||||
|
|
||||||
public static final String PROCESSED_COMMANDS_PURGE_DAYS = "purge-processed-commands-older-than-days";
|
|
||||||
private static final String DAYS_BEFORE_REPAYMENT_IS_DUE = "days-before-repayment-is-due";
|
|
||||||
private static final String DAYS_AFTER_REPAYMENT_IS_OVERDUE = "days-after-repayment-is-overdue";
|
|
||||||
private static final String ENABLE_EXTERNAL_ID_AUTO_GENERATION = "enable-auto-generated-external-id";
|
|
||||||
private static final String ENABLE_ADDRESS = "Enable-Address";
|
|
||||||
private static final String ENABLE_COB_BULK_EVENT = "enable-cob-bulk-event";
|
|
||||||
private static final String EXTERNAL_EVENT_BATCH_SIZE = "external-event-batch-size";
|
|
||||||
|
|
||||||
private static final String REPORT_EXPORT_S3_FOLDER_NAME = "report-export-s3-folder-name";
|
|
||||||
|
|
||||||
public static final String CHARGE_ACCRUAL_DATE_CRITERIA = "charge-accrual-date";
|
|
||||||
public static final String NEXT_PAYMENT_DUE_DATE = "next-payment-due-date";
|
|
||||||
|
|
||||||
private final PermissionRepository permissionRepository;
|
private final PermissionRepository permissionRepository;
|
||||||
private final GlobalConfigurationRepositoryWrapper globalConfigurationRepository;
|
private final GlobalConfigurationRepositoryWrapper globalConfigurationRepository;
|
||||||
private final PlatformCacheRepository cacheTypeRepository;
|
private final PlatformCacheRepository cacheTypeRepository;
|
||||||
@@ -64,8 +48,7 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
|||||||
if (StringUtils.isBlank(taskPermissionCode)) {
|
if (StringUtils.isBlank(taskPermissionCode)) {
|
||||||
throw new PermissionNotFoundException(taskPermissionCode);
|
throw new PermissionNotFoundException(taskPermissionCode);
|
||||||
}
|
}
|
||||||
final String makerCheckerConfigurationProperty = "maker-checker";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(GlobalConfigurationConstants.MAKER_CHECKER);
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(makerCheckerConfigurationProperty);
|
|
||||||
if (property.isEnabled()) {
|
if (property.isEnabled()) {
|
||||||
final Permission thisTask = this.permissionRepository.findOneByCode(taskPermissionCode);
|
final Permission thisTask = this.permissionRepository.findOneByCode(taskPermissionCode);
|
||||||
if (thisTask == null) {
|
if (thisTask == null) {
|
||||||
@@ -79,18 +62,18 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSameMakerCheckerEnabled() {
|
public boolean isSameMakerCheckerEnabled() {
|
||||||
return getGlobalConfigurationPropertyData("enable-same-maker-checker").isEnabled();
|
return getGlobalConfigurationPropertyData(GlobalConfigurationConstants.ENABLE_SAME_MAKER_CHECKER).isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAmazonS3Enabled() {
|
public boolean isAmazonS3Enabled() {
|
||||||
return getGlobalConfigurationPropertyData("amazon-S3").isEnabled();
|
return getGlobalConfigurationPropertyData(GlobalConfigurationConstants.AMAZON_S3).isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isRescheduleFutureRepaymentsEnabled() {
|
public boolean isRescheduleFutureRepaymentsEnabled() {
|
||||||
final String rescheduleRepaymentsConfigurationProperty = "reschedule-future-repayments";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(rescheduleRepaymentsConfigurationProperty);
|
GlobalConfigurationConstants.RESCHEDULE_FUTURE_REPAYMENTS);
|
||||||
return property.isEnabled();
|
return property.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,29 +84,29 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean isRescheduleRepaymentsOnHolidaysEnabled() {
|
public boolean isRescheduleRepaymentsOnHolidaysEnabled() {
|
||||||
final String holidaysConfigurationProperty = "reschedule-repayments-on-holidays";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(holidaysConfigurationProperty);
|
GlobalConfigurationConstants.RESCHEDULE_REPAYMENTS_ON_HOLIDAYS);
|
||||||
return property.isEnabled();
|
return property.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean allowTransactionsOnHolidayEnabled() {
|
public boolean allowTransactionsOnHolidayEnabled() {
|
||||||
final String allowTransactionsOnHolidayProperty = "allow-transactions-on-holiday";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(allowTransactionsOnHolidayProperty);
|
GlobalConfigurationConstants.ALLOW_TRANSACTIONS_ON_HOLIDAY);
|
||||||
return property.isEnabled();
|
return property.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean allowTransactionsOnNonWorkingDayEnabled() {
|
public boolean allowTransactionsOnNonWorkingDayEnabled() {
|
||||||
final String propertyName = "allow-transactions-on-non_workingday";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.ALLOW_TRANSACTIONS_ON_NON_WORKING_DAY);
|
||||||
return property.isEnabled();
|
return property.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isConstraintApproachEnabledForDatatables() {
|
public boolean isConstraintApproachEnabledForDatatables() {
|
||||||
final String propertyName = "constraint_approach_for_datatables";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.CONSTRAINT_APPROACH_FOR_DATATABLES);
|
||||||
return property.isEnabled();
|
return property.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,50 +126,50 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long retrievePenaltyWaitPeriod() {
|
public Long retrievePenaltyWaitPeriod() {
|
||||||
final String propertyName = "penalty-wait-period";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.PENALTY_WAIT_PERIOD);
|
||||||
return property.getValue();
|
return property.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long retrieveGraceOnPenaltyPostingPeriod() {
|
public Long retrieveGraceOnPenaltyPostingPeriod() {
|
||||||
final String propertyName = "grace-on-penalty-posting";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.GRACE_ON_PENALTY_POSTING);
|
||||||
return property.getValue();
|
return property.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isPasswordForcedResetEnable() {
|
public boolean isPasswordForcedResetEnable() {
|
||||||
final String propertyName = "force-password-reset-days";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.FORCE_PASSWORD_RESET_DAYS);
|
||||||
return property.isEnabled();
|
return property.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long retrievePasswordLiveTime() {
|
public Long retrievePasswordLiveTime() {
|
||||||
final String propertyName = "force-password-reset-days";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.FORCE_PASSWORD_RESET_DAYS);
|
||||||
return property.getValue();
|
return property.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long retrieveOpeningBalancesContraAccount() {
|
public Long retrieveOpeningBalancesContraAccount() {
|
||||||
final String propertyName = "office-opening-balances-contra-account";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.OFFICE_OPENING_BALANCES_CONTRA_ACCOUNT);
|
||||||
return property.getValue();
|
return property.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSavingsInterestPostingAtCurrentPeriodEnd() {
|
public boolean isSavingsInterestPostingAtCurrentPeriodEnd() {
|
||||||
final String propertyName = "savings-interest-posting-current-period-end";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.SAVINGS_INTEREST_POSTING_CURRENT_PERIOD_END);
|
||||||
return property.isEnabled();
|
return property.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer retrieveFinancialYearBeginningMonth() {
|
public Integer retrieveFinancialYearBeginningMonth() {
|
||||||
final String propertyName = "financial-year-beginning-month";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.FINANCIAL_YEAR_BEGINNING_MONTH);
|
||||||
if (property.isEnabled()) {
|
if (property.isEnabled()) {
|
||||||
return property.getValue().intValue();
|
return property.getValue().intValue();
|
||||||
}
|
}
|
||||||
@@ -195,8 +178,8 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer retrieveMinAllowedClientsInGroup() {
|
public Integer retrieveMinAllowedClientsInGroup() {
|
||||||
final String propertyName = "min-clients-in-group";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.MIN_CLIENTS_IN_GROUP);
|
||||||
if (property.isEnabled()) {
|
if (property.isEnabled()) {
|
||||||
return property.getValue().intValue();
|
return property.getValue().intValue();
|
||||||
}
|
}
|
||||||
@@ -205,8 +188,8 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer retrieveMaxAllowedClientsInGroup() {
|
public Integer retrieveMaxAllowedClientsInGroup() {
|
||||||
final String propertyName = "max-clients-in-group";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.MAX_CLIENTS_IN_GROUP);
|
||||||
if (property.isEnabled()) {
|
if (property.isEnabled()) {
|
||||||
return property.getValue().intValue();
|
return property.getValue().intValue();
|
||||||
}
|
}
|
||||||
@@ -215,16 +198,15 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isMeetingMandatoryForJLGLoans() {
|
public boolean isMeetingMandatoryForJLGLoans() {
|
||||||
final String propertyName = "meetings-mandatory-for-jlg-loans";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.MEETINGS_MANDATORY_FOR_JLG_LOANS);
|
||||||
return property.isEnabled();
|
return property.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRoundingMode() {
|
public int getRoundingMode() {
|
||||||
final String propertyName = "rounding-mode";
|
|
||||||
int defaultValue = 6; // 6 Stands for HALF-EVEN
|
int defaultValue = 6; // 6 Stands for HALF-EVEN
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(GlobalConfigurationConstants.ROUNDING_MODE);
|
||||||
if (property.isEnabled()) {
|
if (property.isEnabled()) {
|
||||||
int value = property.getValue().intValue();
|
int value = property.getValue().intValue();
|
||||||
if (value < 0 || value > 6) {
|
if (value < 0 || value > 6) {
|
||||||
@@ -237,78 +219,80 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBackdatePenaltiesEnabled() {
|
public boolean isBackdatePenaltiesEnabled() {
|
||||||
final String propertyName = "backdate-penalties-enabled";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.BACKDATE_PENALTIES_ENABLED);
|
||||||
return property.isEnabled();
|
return property.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isOrganisationstartDateEnabled() {
|
public boolean isOrganisationstartDateEnabled() {
|
||||||
final String propertyName = "organisation-start-date";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.ORGANISATION_START_DATE);
|
||||||
return property.isEnabled();
|
return property.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LocalDate retrieveOrganisationStartDate() {
|
public LocalDate retrieveOrganisationStartDate() {
|
||||||
final String propertyName = "organisation-start-date";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.ORGANISATION_START_DATE);
|
||||||
return property.getDateValue();
|
return property.getDateValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isPaymentTypeApplicableForDisbursementCharge() {
|
public boolean isPaymentTypeApplicableForDisbursementCharge() {
|
||||||
final String propertyName = "paymenttype-applicable-for-disbursement-charges";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.PAYMENT_TYPE_APPLICABLE_FOR_DISBURSEMENT_CHARGES);
|
||||||
return property.isEnabled();
|
return property.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSkippingMeetingOnFirstDayOfMonthEnabled() {
|
public boolean isSkippingMeetingOnFirstDayOfMonthEnabled() {
|
||||||
return getGlobalConfigurationPropertyData("skip-repayment-on-first-day-of-month").isEnabled();
|
return getGlobalConfigurationPropertyData(GlobalConfigurationConstants.SKIP_REPAYMENT_ON_FIRST_DAY_OF_MONTH).isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isFirstRepaymentDateAfterRescheduleAllowedOnHoliday() {
|
public boolean isFirstRepaymentDateAfterRescheduleAllowedOnHoliday() {
|
||||||
return getGlobalConfigurationPropertyData("loan-reschedule-is-first-payday-allowed-on-holiday").isEnabled();
|
return getGlobalConfigurationPropertyData(GlobalConfigurationConstants.LOAN_RESCHEDULE_IS_FIRST_PAYDAY_ALLOWED_ON_HOLIDAY)
|
||||||
|
.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isInterestToBeRecoveredFirstWhenGreaterThanEMI() {
|
public boolean isInterestToBeRecoveredFirstWhenGreaterThanEMI() {
|
||||||
return getGlobalConfigurationPropertyData("is-interest-to-be-recovered-first-when-greater-than-emi").isEnabled();
|
return getGlobalConfigurationPropertyData(GlobalConfigurationConstants.IS_INTEREST_TO_BE_RECOVERED_FIRST_WHEN_GREATER_THAN_EMI)
|
||||||
|
.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isPrincipalCompoundingDisabledForOverdueLoans() {
|
public boolean isPrincipalCompoundingDisabledForOverdueLoans() {
|
||||||
return getGlobalConfigurationPropertyData("is-principal-compounding-disabled-for-overdue-loans").isEnabled();
|
return getGlobalConfigurationPropertyData(GlobalConfigurationConstants.IS_PRINCIPAL_COMPOUNDING_DISABLED_FOR_OVERDUE_LOANS)
|
||||||
|
.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long retreivePeriodInNumberOfDaysForSkipMeetingDate() {
|
public Long retreivePeriodInNumberOfDaysForSkipMeetingDate() {
|
||||||
final String propertyName = "skip-repayment-on-first-day-of-month";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.SKIP_REPAYMENT_ON_FIRST_DAY_OF_MONTH);
|
||||||
return property.getValue();
|
return property.getValue();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isInterestChargedFromDateSameAsDisbursementDate() {
|
public boolean isInterestChargedFromDateSameAsDisbursementDate() {
|
||||||
final String propertyName = "interest-charged-from-date-same-as-disbursal-date";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.INTEREST_CHARGED_FROM_DATE_SAME_AS_DISBURSAL_DATE);
|
||||||
return property.isEnabled();
|
return property.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isChangeEmiIfRepaymentDateSameAsDisbursementDateEnabled() {
|
public boolean isChangeEmiIfRepaymentDateSameAsDisbursementDateEnabled() {
|
||||||
final String propertyName = "change-emi-if-repaymentdate-same-as-disbursementdate";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.CHANGE_EMI_IF_REPAYMENT_DATE_SAME_AS_DISBURSEMENT_DATE);
|
||||||
return property.isEnabled();
|
return property.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isDailyTPTLimitEnabled() {
|
public boolean isDailyTPTLimitEnabled() {
|
||||||
final String propertyName = "daily-tpt-limit";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(GlobalConfigurationConstants.DAILY_TPT_LIMIT);
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
|
||||||
return property.isEnabled();
|
return property.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -364,23 +348,23 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean retrievePivotDateConfig() {
|
public boolean retrievePivotDateConfig() {
|
||||||
final String propertyName = "allow-backdated-transaction-before-interest-posting";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.ALLOW_BACKDATED_TRANSACTION_BEFORE_INTEREST_POSTING);
|
||||||
return !property.isEnabled();
|
return !property.isEnabled();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isRelaxingDaysConfigForPivotDateEnabled() {
|
public boolean isRelaxingDaysConfigForPivotDateEnabled() {
|
||||||
final String propertyName = "allow-backdated-transaction-before-interest-posting-date-for-days";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.ALLOW_BACKDATED_TRANSACTION_BEFORE_INTEREST_POSTING_DATE_FOR_DAYS);
|
||||||
return property.isEnabled();
|
return property.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long retrieveRelaxingDaysConfigForPivotDate() {
|
public Long retrieveRelaxingDaysConfigForPivotDate() {
|
||||||
final String propertyName = "allow-backdated-transaction-before-interest-posting-date-for-days";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.ALLOW_BACKDATED_TRANSACTION_BEFORE_INTEREST_POSTING_DATE_FOR_DAYS);
|
||||||
if (property.getValue() == null) {
|
if (property.getValue() == null) {
|
||||||
return 0L;
|
return 0L;
|
||||||
}
|
}
|
||||||
@@ -394,14 +378,14 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSubRatesEnabled() {
|
public boolean isSubRatesEnabled() {
|
||||||
return getGlobalConfigurationPropertyData("sub-rates").isEnabled();
|
return getGlobalConfigurationPropertyData(GlobalConfigurationConstants.SUB_RATES).isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getAccountMappingForPaymentType() {
|
public String getAccountMappingForPaymentType() {
|
||||||
final String propertyName = "account-mapping-for-payment-type";
|
|
||||||
String defaultValue = "Asset"; // 1 Stands for Account mapped from asset only
|
String defaultValue = "Asset"; // 1 Stands for Account mapped from asset only
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
|
GlobalConfigurationConstants.ACCOUNT_MAPPING_FOR_PAYMENT_TYPE);
|
||||||
if (property.isEnabled()) {
|
if (property.isEnabled()) {
|
||||||
String value = property.getStringValue();
|
String value = property.getStringValue();
|
||||||
if (StringUtils.isBlank(value)) {
|
if (StringUtils.isBlank(value)) {
|
||||||
@@ -414,9 +398,9 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getAccountMappingForCharge() {
|
public String getAccountMappingForCharge() {
|
||||||
final String propertyName = "account-mapping-for-charge";
|
|
||||||
String defaultValue = "Income"; // 1 Stands for Account mapped from income only
|
String defaultValue = "Income"; // 1 Stands for Account mapped from income only
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
|
GlobalConfigurationConstants.ACCOUNT_MAPPING_FOR_CHARGE);
|
||||||
if (property.isEnabled()) {
|
if (property.isEnabled()) {
|
||||||
String value = property.getStringValue();
|
String value = property.getStringValue();
|
||||||
if (StringUtils.isBlank(value)) {
|
if (StringUtils.isBlank(value)) {
|
||||||
@@ -429,88 +413,97 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isNextDayFixedDepositInterestTransferEnabledForPeriodEnd() {
|
public boolean isNextDayFixedDepositInterestTransferEnabledForPeriodEnd() {
|
||||||
final String propertyName = "fixed-deposit-transfer-interest-next-day-for-period-end-posting";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.FIXED_DEPOSIT_TRANSFER_INTEREST_NEXT_DAY_FOR_PERIOD_END_POSTING);
|
||||||
return property.isEnabled();
|
return property.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBusinessDateEnabled() {
|
public boolean isBusinessDateEnabled() {
|
||||||
return getGlobalConfigurationPropertyData(ENABLE_BUSINESS_DATE).isEnabled();
|
return getGlobalConfigurationPropertyData(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE).isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCOBDateAdjustmentEnabled() {
|
public boolean isCOBDateAdjustmentEnabled() {
|
||||||
return getGlobalConfigurationPropertyData(ENABLE_AUTOMATIC_COB_DATE_ADJUSTMENT).isEnabled();
|
return getGlobalConfigurationPropertyData(GlobalConfigurationConstants.ENABLE_AUTOMATIC_COB_DATE_ADJUSTMENT).isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isReversalTransactionAllowed() {
|
public boolean isReversalTransactionAllowed() {
|
||||||
final String propertyName = "enable-post-reversal-txns-for-reverse-transactions";
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(propertyName);
|
GlobalConfigurationConstants.ENABLE_POST_REVERSAL_TXNS_FOR_REVERSE_TRANSACTIONS);
|
||||||
return property.isEnabled();
|
return property.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long retrieveExternalEventsPurgeDaysCriteria() {
|
public Long retrieveExternalEventsPurgeDaysCriteria() {
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(EXTERNAL_EVENTS_PURGE_DAYS);
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
|
GlobalConfigurationConstants.PURGE_EXTERNAL_EVENTS_OLDER_THAN_DAYS);
|
||||||
return property.getValue();
|
return property.getValue();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long retrieveProcessedCommandsPurgeDaysCriteria() {
|
public Long retrieveProcessedCommandsPurgeDaysCriteria() {
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(PROCESSED_COMMANDS_PURGE_DAYS);
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
|
GlobalConfigurationConstants.PURGE_PROCESSED_COMMANDS_OLDER_THAN_DAYS);
|
||||||
return property.getValue();
|
return property.getValue();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long retrieveRepaymentDueDays() {
|
public Long retrieveRepaymentDueDays() {
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(DAYS_BEFORE_REPAYMENT_IS_DUE);
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
|
GlobalConfigurationConstants.DAYS_BEFORE_REPAYMENT_IS_DUE);
|
||||||
return property.getValue();
|
return property.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long retrieveRepaymentOverdueDays() {
|
public Long retrieveRepaymentOverdueDays() {
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(DAYS_AFTER_REPAYMENT_IS_OVERDUE);
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
|
GlobalConfigurationConstants.DAYS_AFTER_REPAYMENT_IS_OVERDUE);
|
||||||
return property.getValue();
|
return property.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isExternalIdAutoGenerationEnabled() {
|
public boolean isExternalIdAutoGenerationEnabled() {
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(ENABLE_EXTERNAL_ID_AUTO_GENERATION);
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
|
GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID);
|
||||||
return property.isEnabled();
|
return property.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAddressEnabled() {
|
public boolean isAddressEnabled() {
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(ENABLE_ADDRESS);
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(GlobalConfigurationConstants.ENABLE_ADDRESS);
|
||||||
return property.isEnabled();
|
return property.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCOBBulkEventEnabled() {
|
public boolean isCOBBulkEventEnabled() {
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(ENABLE_COB_BULK_EVENT);
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
|
GlobalConfigurationConstants.ENABLE_COB_BULK_EVENT);
|
||||||
return property.isEnabled();
|
return property.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long retrieveExternalEventBatchSize() {
|
public Long retrieveExternalEventBatchSize() {
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(EXTERNAL_EVENT_BATCH_SIZE);
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
|
GlobalConfigurationConstants.EXTERNAL_EVENT_BATCH_SIZE);
|
||||||
return property.getValue();
|
return property.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String retrieveReportExportS3FolderName() {
|
public String retrieveReportExportS3FolderName() {
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(REPORT_EXPORT_S3_FOLDER_NAME);
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
|
GlobalConfigurationConstants.REPORT_EXPORT_S3_FOLDER_NAME);
|
||||||
return property.getStringValue();
|
return property.getStringValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getAccrualDateConfigForCharge() {
|
public String getAccrualDateConfigForCharge() {
|
||||||
String defaultValue = "due-date";
|
String defaultValue = "due-date";
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(CHARGE_ACCRUAL_DATE_CRITERIA);
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
|
GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE);
|
||||||
String value = property.getStringValue();
|
String value = property.getStringValue();
|
||||||
if (StringUtils.isBlank(value)) {
|
if (StringUtils.isBlank(value)) {
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
@@ -521,7 +514,8 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
|||||||
@Override
|
@Override
|
||||||
public String getNextPaymentDateConfigForLoan() {
|
public String getNextPaymentDateConfigForLoan() {
|
||||||
String defaultValue = "earliest-unpaid-date";
|
String defaultValue = "earliest-unpaid-date";
|
||||||
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(NEXT_PAYMENT_DUE_DATE);
|
final GlobalConfigurationPropertyData property = getGlobalConfigurationPropertyData(
|
||||||
|
GlobalConfigurationConstants.NEXT_PAYMENT_DUE_DATE);
|
||||||
String value = property.getStringValue();
|
String value = property.getStringValue();
|
||||||
if (StringUtils.isBlank(value)) {
|
if (StringUtils.isBlank(value)) {
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
|
|||||||
+2
-1
@@ -28,6 +28,7 @@ import lombok.Getter;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.configuration.data.GlobalConfigurationPropertyData;
|
import org.apache.fineract.infrastructure.configuration.data.GlobalConfigurationPropertyData;
|
||||||
import org.apache.fineract.infrastructure.configuration.exception.GlobalConfigurationPropertyCannotBeModfied;
|
import org.apache.fineract.infrastructure.configuration.exception.GlobalConfigurationPropertyCannotBeModfied;
|
||||||
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
||||||
@@ -99,7 +100,7 @@ public class GlobalConfigurationProperty extends AbstractPersistableCustom<Long>
|
|||||||
this.stringValue = newStringValue;
|
this.stringValue = newStringValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String passwordPropertyName = "force-password-reset-days";
|
final String passwordPropertyName = GlobalConfigurationConstants.FORCE_PASSWORD_RESET_DAYS;
|
||||||
if (this.name.equalsIgnoreCase(passwordPropertyName)) {
|
if (this.name.equalsIgnoreCase(passwordPropertyName)) {
|
||||||
if ((this.enabled == true && command.hasParameter(valueParamName) && (this.value == 0))
|
if ((this.enabled == true && command.hasParameter(valueParamName) && (this.value == 0))
|
||||||
|| (this.enabled == true && !command.hasParameter(valueParamName) && (previousValue == 0))) {
|
|| (this.enabled == true && !command.hasParameter(valueParamName) && (previousValue == 0))) {
|
||||||
|
|||||||
-2
@@ -24,8 +24,6 @@ public final class FineractEntityAccessConstants {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final String GLOBAL_CONFIG_FOR_OFFICE_SPECIFIC_PRODUCTS = "office-specific-products-enabled";
|
|
||||||
public static final String GLOBAL_CONFIG_FOR_RESTRICT_PRODUCTS_TO_USER_OFFICE = "restrict-products-to-user-office";
|
|
||||||
public static final String ENTITY_ACCESS_CODENAME = "Entity to Entity Access Types";
|
public static final String ENTITY_ACCESS_CODENAME = "Entity to Entity Access Types";
|
||||||
|
|
||||||
/***
|
/***
|
||||||
|
|||||||
+4
-4
@@ -21,9 +21,9 @@ package org.apache.fineract.infrastructure.entityaccess.service;
|
|||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import org.apache.fineract.infrastructure.codes.domain.CodeValueRepositoryWrapper;
|
import org.apache.fineract.infrastructure.codes.domain.CodeValueRepositoryWrapper;
|
||||||
import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService;
|
import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.configuration.domain.GlobalConfigurationProperty;
|
import org.apache.fineract.infrastructure.configuration.domain.GlobalConfigurationProperty;
|
||||||
import org.apache.fineract.infrastructure.configuration.domain.GlobalConfigurationRepositoryWrapper;
|
import org.apache.fineract.infrastructure.configuration.domain.GlobalConfigurationRepositoryWrapper;
|
||||||
import org.apache.fineract.infrastructure.entityaccess.FineractEntityAccessConstants;
|
|
||||||
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityAccessType;
|
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityAccessType;
|
||||||
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityRelation;
|
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityRelation;
|
||||||
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityRelationRepositoryWrapper;
|
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityRelationRepositoryWrapper;
|
||||||
@@ -77,13 +77,13 @@ public class FineractEntityAccessUtil {
|
|||||||
// i.e. this product or charge is specific for this office.
|
// i.e. this product or charge is specific for this office.
|
||||||
|
|
||||||
final GlobalConfigurationProperty property = this.globalConfigurationRepository
|
final GlobalConfigurationProperty property = this.globalConfigurationRepository
|
||||||
.findOneByNameWithNotFoundDetection(FineractEntityAccessConstants.GLOBAL_CONFIG_FOR_OFFICE_SPECIFIC_PRODUCTS);
|
.findOneByNameWithNotFoundDetection(GlobalConfigurationConstants.OFFICE_SPECIFIC_PRODUCTS_ENABLED);
|
||||||
if (property.isEnabled()) {
|
if (property.isEnabled()) {
|
||||||
// If this property is enabled, then Fineract need to restrict
|
// If this property is enabled, then Fineract need to restrict
|
||||||
// access to this loan product to only the office of the current
|
// access to this loan product to only the office of the current
|
||||||
// user
|
// user
|
||||||
final GlobalConfigurationProperty restrictToUserOfficeProperty = this.globalConfigurationRepository
|
final GlobalConfigurationProperty restrictToUserOfficeProperty = this.globalConfigurationRepository
|
||||||
.findOneByNameWithNotFoundDetection(FineractEntityAccessConstants.GLOBAL_CONFIG_FOR_RESTRICT_PRODUCTS_TO_USER_OFFICE);
|
.findOneByNameWithNotFoundDetection(GlobalConfigurationConstants.RESTRICT_PRODUCTS_TO_USER_OFFICE);
|
||||||
|
|
||||||
if (restrictToUserOfficeProperty.isEnabled()) {
|
if (restrictToUserOfficeProperty.isEnabled()) {
|
||||||
final Long officeId = thisUser.getOffice().getId();
|
final Long officeId = thisUser.getOffice().getId();
|
||||||
@@ -105,7 +105,7 @@ public class FineractEntityAccessUtil {
|
|||||||
String inClause = "";
|
String inClause = "";
|
||||||
|
|
||||||
final GlobalConfigurationProperty property = this.globalConfigurationRepository
|
final GlobalConfigurationProperty property = this.globalConfigurationRepository
|
||||||
.findOneByNameWithNotFoundDetection(FineractEntityAccessConstants.GLOBAL_CONFIG_FOR_OFFICE_SPECIFIC_PRODUCTS);
|
.findOneByNameWithNotFoundDetection(GlobalConfigurationConstants.OFFICE_SPECIFIC_PRODUCTS_ENABLED);
|
||||||
|
|
||||||
if (property.isEnabled()) {
|
if (property.isEnabled()) {
|
||||||
// Get 'SQL In Clause' for fetching only products/charges that are
|
// Get 'SQL In Clause' for fetching only products/charges that are
|
||||||
|
|||||||
+1
-1
@@ -26,9 +26,9 @@ import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
|||||||
import org.apache.fineract.infrastructure.businessdate.service.BusinessDateReadPlatformService;
|
import org.apache.fineract.infrastructure.businessdate.service.BusinessDateReadPlatformService;
|
||||||
import org.apache.fineract.infrastructure.core.domain.ActionContext;
|
import org.apache.fineract.infrastructure.core.domain.ActionContext;
|
||||||
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
|
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
|
||||||
|
import org.apache.fineract.infrastructure.core.service.JdbcTemplateFactory;
|
||||||
import org.apache.fineract.infrastructure.core.service.ThreadLocalContextUtil;
|
import org.apache.fineract.infrastructure.core.service.ThreadLocalContextUtil;
|
||||||
import org.apache.fineract.infrastructure.core.service.tenant.TenantDetailsService;
|
import org.apache.fineract.infrastructure.core.service.tenant.TenantDetailsService;
|
||||||
import org.apache.fineract.infrastructure.event.external.service.JdbcTemplateFactory;
|
|
||||||
import org.apache.fineract.infrastructure.jobs.domain.JobExecutionRepository;
|
import org.apache.fineract.infrastructure.jobs.domain.JobExecutionRepository;
|
||||||
import org.apache.fineract.useradministration.domain.AppUser;
|
import org.apache.fineract.useradministration.domain.AppUser;
|
||||||
import org.apache.fineract.useradministration.domain.AppUserRepositoryWrapper;
|
import org.apache.fineract.useradministration.domain.AppUserRepositoryWrapper;
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Tag(name = "Working days", description = "The days of the week that are workdays.\n" + "\n"
|
@Tag(name = "Working days", description = "The days of the week that are workdays.\n" + "\n"
|
||||||
+ "Rescheduling of repayments when it falls on a non-working is turned on /off by enable/disable reschedule-future-repayments parameter in Global configurations\n"
|
+ "Rescheduling of repayments when it falls on a non-working is turned on /off by enable/disable reschedule-future-repayments parameter in Global configurations\n"
|
||||||
+ "\n"
|
+ "\n"
|
||||||
+ "Allow transactions on non-working days is configurable by enabling/disbaling the allow-transactions-on-non_workingday parameter in Global configurations.")
|
+ "Allow transactions on non-working days is configurable by enabling/disbaling the allow-transactions-on-non-workingday parameter in Global configurations.")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class WorkingDaysApiResource {
|
public class WorkingDaysApiResource {
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -27,6 +27,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.apache.fineract.infrastructure.accountnumberformat.domain.AccountNumberFormat;
|
import org.apache.fineract.infrastructure.accountnumberformat.domain.AccountNumberFormat;
|
||||||
import org.apache.fineract.infrastructure.accountnumberformat.domain.AccountNumberFormatEnumerations.AccountNumberPrefixType;
|
import org.apache.fineract.infrastructure.accountnumberformat.domain.AccountNumberFormatEnumerations.AccountNumberPrefixType;
|
||||||
import org.apache.fineract.infrastructure.codes.domain.CodeValue;
|
import org.apache.fineract.infrastructure.codes.domain.CodeValue;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.configuration.data.GlobalConfigurationPropertyData;
|
import org.apache.fineract.infrastructure.configuration.data.GlobalConfigurationPropertyData;
|
||||||
import org.apache.fineract.infrastructure.configuration.service.ConfigurationReadPlatformService;
|
import org.apache.fineract.infrastructure.configuration.service.ConfigurationReadPlatformService;
|
||||||
import org.apache.fineract.portfolio.client.domain.Client;
|
import org.apache.fineract.portfolio.client.domain.Client;
|
||||||
@@ -105,7 +106,7 @@ public class AccountNumberGenerator {
|
|||||||
|
|
||||||
// find if the custom length is defined
|
// find if the custom length is defined
|
||||||
final GlobalConfigurationPropertyData customLength = this.configurationReadPlatformService
|
final GlobalConfigurationPropertyData customLength = this.configurationReadPlatformService
|
||||||
.retrieveGlobalConfiguration("custom-account-number-length");
|
.retrieveGlobalConfiguration(GlobalConfigurationConstants.CUSTOM_ACCOUNT_NUMBER_LENGTH);
|
||||||
|
|
||||||
if (customLength.isEnabled()) {
|
if (customLength.isEnabled()) {
|
||||||
// if it is enabled, and has the value, get it from the repository.
|
// if it is enabled, and has the value, get it from the repository.
|
||||||
@@ -115,7 +116,7 @@ public class AccountNumberGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final GlobalConfigurationPropertyData randomAccountNumber = this.configurationReadPlatformService
|
final GlobalConfigurationPropertyData randomAccountNumber = this.configurationReadPlatformService
|
||||||
.retrieveGlobalConfiguration("random-account-number");
|
.retrieveGlobalConfiguration(GlobalConfigurationConstants.RANDOM_ACCOUNT_NUMBER);
|
||||||
|
|
||||||
if (randomAccountNumber.isEnabled()) {
|
if (randomAccountNumber.isEnabled()) {
|
||||||
accountNumber = randomNumberGenerator(accountMaxLength, propertyMap);
|
accountNumber = randomNumberGenerator(accountMaxLength, propertyMap);
|
||||||
|
|||||||
+2
-1
@@ -31,6 +31,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.configuration.service.ConfigurationReadPlatformService;
|
import org.apache.fineract.infrastructure.configuration.service.ConfigurationReadPlatformService;
|
||||||
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
||||||
import org.apache.fineract.infrastructure.core.data.ApiParameterError;
|
import org.apache.fineract.infrastructure.core.data.ApiParameterError;
|
||||||
@@ -224,7 +225,7 @@ public final class ClientDataValidator {
|
|||||||
baseDataValidator.reset().parameter("isStaff").value(isStaffFlag).notNull();
|
baseDataValidator.reset().parameter("isStaff").value(isStaffFlag).notNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.configurationReadPlatformService.retrieveGlobalConfiguration("Enable-Address").isEnabled()) {
|
if (this.configurationReadPlatformService.retrieveGlobalConfiguration(GlobalConfigurationConstants.ENABLE_ADDRESS).isEnabled()) {
|
||||||
final JsonArray address = this.fromApiJsonHelper.extractJsonArrayNamed(ClientApiConstants.address, element);
|
final JsonArray address = this.fromApiJsonHelper.extractJsonArrayNamed(ClientApiConstants.address, element);
|
||||||
baseDataValidator.reset().parameter(ClientApiConstants.address).value(address).notNull().jsonArrayNotEmpty();
|
baseDataValidator.reset().parameter(ClientApiConstants.address).value(address).notNull().jsonArrayNotEmpty();
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -37,6 +37,7 @@ import java.util.function.Consumer;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService;
|
import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService;
|
||||||
import org.apache.fineract.infrastructure.configuration.domain.GlobalConfigurationProperty;
|
import org.apache.fineract.infrastructure.configuration.domain.GlobalConfigurationProperty;
|
||||||
import org.apache.fineract.infrastructure.configuration.domain.GlobalConfigurationRepositoryWrapper;
|
import org.apache.fineract.infrastructure.configuration.domain.GlobalConfigurationRepositoryWrapper;
|
||||||
@@ -55,7 +56,6 @@ import org.apache.fineract.infrastructure.core.service.ExternalIdFactory;
|
|||||||
import org.apache.fineract.infrastructure.dataqueries.data.EntityTables;
|
import org.apache.fineract.infrastructure.dataqueries.data.EntityTables;
|
||||||
import org.apache.fineract.infrastructure.dataqueries.data.StatusEnum;
|
import org.apache.fineract.infrastructure.dataqueries.data.StatusEnum;
|
||||||
import org.apache.fineract.infrastructure.dataqueries.service.EntityDatatableChecksWritePlatformService;
|
import org.apache.fineract.infrastructure.dataqueries.service.EntityDatatableChecksWritePlatformService;
|
||||||
import org.apache.fineract.infrastructure.entityaccess.FineractEntityAccessConstants;
|
|
||||||
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityAccessType;
|
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityAccessType;
|
||||||
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityRelation;
|
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityRelation;
|
||||||
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityRelationRepository;
|
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityRelationRepository;
|
||||||
@@ -1760,7 +1760,7 @@ public final class LoanApplicationValidator {
|
|||||||
|
|
||||||
private void officeSpecificLoanProductValidation(final Long productId, final Long officeId) {
|
private void officeSpecificLoanProductValidation(final Long productId, final Long officeId) {
|
||||||
final GlobalConfigurationProperty restrictToUserOfficeProperty = this.globalConfigurationRepository
|
final GlobalConfigurationProperty restrictToUserOfficeProperty = this.globalConfigurationRepository
|
||||||
.findOneByNameWithNotFoundDetection(FineractEntityAccessConstants.GLOBAL_CONFIG_FOR_OFFICE_SPECIFIC_PRODUCTS);
|
.findOneByNameWithNotFoundDetection(GlobalConfigurationConstants.OFFICE_SPECIFIC_PRODUCTS_ENABLED);
|
||||||
if (restrictToUserOfficeProperty.isEnabled()) {
|
if (restrictToUserOfficeProperty.isEnabled()) {
|
||||||
FineractEntityRelation fineractEntityRelation = fineractEntityRelationRepository
|
FineractEntityRelation fineractEntityRelation = fineractEntityRelationRepository
|
||||||
.findOneByCodeName(FineractEntityAccessType.OFFICE_ACCESS_TO_LOAN_PRODUCTS.getStr());
|
.findOneByCodeName(FineractEntityAccessType.OFFICE_ACCESS_TO_LOAN_PRODUCTS.getStr());
|
||||||
|
|||||||
@@ -167,4 +167,5 @@
|
|||||||
<include file="parts/0145_job_short_name.xml" relativeToChangelogFile="true" />
|
<include file="parts/0145_job_short_name.xml" relativeToChangelogFile="true" />
|
||||||
<include file="parts/0147_enable_payment_hub_integration.xml" relativeToChangelogFile="true" />
|
<include file="parts/0147_enable_payment_hub_integration.xml" relativeToChangelogFile="true" />
|
||||||
<include file="parts/0148_transaction_summary_with_asset_owner_report_performance_improvement.xml" relativeToChangelogFile="true" />
|
<include file="parts/0148_transaction_summary_with_asset_owner_report_performance_improvement.xml" relativeToChangelogFile="true" />
|
||||||
|
<include file="parts/0149_update_global_configuration_names.xml" relativeToChangelogFile="true" />
|
||||||
</databaseChangeLog>
|
</databaseChangeLog>
|
||||||
|
|||||||
+1
-1
@@ -28,8 +28,8 @@
|
|||||||
</sql>
|
</sql>
|
||||||
</changeSet>
|
</changeSet>
|
||||||
<changeSet author="fineract" id="2">
|
<changeSet author="fineract" id="2">
|
||||||
|
<validCheckSum>9:64863870bbd61795b1a8ced20a6dd7a3</validCheckSum>
|
||||||
<insert tableName="c_configuration">
|
<insert tableName="c_configuration">
|
||||||
<column name="id" valueNumeric="60"/>
|
|
||||||
<column name="name" value="enable-payment-hub-integration"/>
|
<column name="name" value="enable-payment-hub-integration"/>
|
||||||
<column name="value" valueNumeric="0"/>
|
<column name="value" valueNumeric="0"/>
|
||||||
<column name="date_value"/>
|
<column name="date_value"/>
|
||||||
|
|||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
|
||||||
|
Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
or more contributor license agreements. See the NOTICE file
|
||||||
|
distributed with this work for additional information
|
||||||
|
regarding copyright ownership. The ASF licenses this file
|
||||||
|
to you under the Apache License, Version 2.0 (the
|
||||||
|
"License"); you may not use this file except in compliance
|
||||||
|
with the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing,
|
||||||
|
software distributed under the License is distributed on an
|
||||||
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
KIND, either express or implied. See the License for the
|
||||||
|
specific language governing permissions and limitations
|
||||||
|
under the License.
|
||||||
|
|
||||||
|
-->
|
||||||
|
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd">
|
||||||
|
<changeSet author="fineract" id="1">
|
||||||
|
<sql>
|
||||||
|
UPDATE c_configuration SET name = REPLACE(REPLACE(LOWER(name), '_', '-'), ' ', '-');
|
||||||
|
</sql>
|
||||||
|
</changeSet>
|
||||||
|
</databaseChangeLog>
|
||||||
+1
@@ -31,6 +31,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
|
import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
|
||||||
|
import org.apache.fineract.infrastructure.core.service.JdbcTemplateFactory;
|
||||||
import org.apache.fineract.infrastructure.core.service.tenant.TenantDetailsService;
|
import org.apache.fineract.infrastructure.core.service.tenant.TenantDetailsService;
|
||||||
import org.apache.fineract.infrastructure.event.external.exception.ExternalEventConfigurationNotFoundException;
|
import org.apache.fineract.infrastructure.event.external.exception.ExternalEventConfigurationNotFoundException;
|
||||||
import org.apache.fineract.infrastructure.event.external.service.validation.ExternalEventSourceService;
|
import org.apache.fineract.infrastructure.event.external.service.validation.ExternalEventSourceService;
|
||||||
|
|||||||
+4
-4
@@ -64,10 +64,10 @@ import org.apache.fineract.client.models.PostUpdateRescheduleLoansRequest;
|
|||||||
import org.apache.fineract.client.models.PutLoansLoanIdRequest;
|
import org.apache.fineract.client.models.PutLoansLoanIdRequest;
|
||||||
import org.apache.fineract.client.util.CallFailedRuntimeException;
|
import org.apache.fineract.client.util.CallFailedRuntimeException;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.LoanRescheduleRequestHelper;
|
import org.apache.fineract.integrationtests.common.LoanRescheduleRequestHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
@@ -4069,15 +4069,15 @@ public class AdvancedPaymentAllocationLoanRepaymentScheduleTest extends BaseLoan
|
|||||||
AtomicLong createdLoanId = new AtomicLong();
|
AtomicLong createdLoanId = new AtomicLong();
|
||||||
runAt("23 March 2024", () -> {
|
runAt("23 March 2024", () -> {
|
||||||
// Rounding mode - HALF_DOWN
|
// Rounding mode - HALF_DOWN
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfigurationInternal(requestSpec, responseSpec, "23", 5);
|
globalConfigurationHelper.updateGlobalConfigurationInternal(GlobalConfigurationConstants.ROUNDING_MODE, 5L);
|
||||||
createLoanForRoundingMethodValidation(true);
|
createLoanForRoundingMethodValidation(true);
|
||||||
|
|
||||||
// Rounding mode - HALF_UP
|
// Rounding mode - HALF_UP
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfigurationInternal(requestSpec, responseSpec, "23", 4);
|
globalConfigurationHelper.updateGlobalConfigurationInternal(GlobalConfigurationConstants.ROUNDING_MODE, 4L);
|
||||||
createLoanForRoundingMethodValidation(false);
|
createLoanForRoundingMethodValidation(false);
|
||||||
|
|
||||||
// Rounding mode - HALF_EVEN - Default
|
// Rounding mode - HALF_EVEN - Default
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfigurationInternal(requestSpec, responseSpec, "23", 6);
|
globalConfigurationHelper.updateGlobalConfigurationInternal(GlobalConfigurationConstants.ROUNDING_MODE, 6L);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-6
@@ -18,8 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.integrationtests;
|
package org.apache.fineract.integrationtests;
|
||||||
|
|
||||||
import static java.lang.Boolean.FALSE;
|
|
||||||
import static java.lang.Boolean.TRUE;
|
|
||||||
import static org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType.BUSINESS_DATE;
|
import static org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType.BUSINESS_DATE;
|
||||||
import static org.apache.fineract.integrationtests.BaseLoanIntegrationTest.TransactionProcessingStrategyCode.ADVANCED_PAYMENT_ALLOCATION_STRATEGY;
|
import static org.apache.fineract.integrationtests.BaseLoanIntegrationTest.TransactionProcessingStrategyCode.ADVANCED_PAYMENT_ALLOCATION_STRATEGY;
|
||||||
import static org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder.DUE_PENALTY_INTEREST_PRINCIPAL_FEE_IN_ADVANCE_PENALTY_INTEREST_PRINCIPAL_FEE_STRATEGY;
|
import static org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder.DUE_PENALTY_INTEREST_PRINCIPAL_FEE_IN_ADVANCE_PENALTY_INTEREST_PRINCIPAL_FEE_STRATEGY;
|
||||||
@@ -72,8 +70,10 @@ import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
|||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsTransactionIdRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsTransactionIdRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansRequest;
|
import org.apache.fineract.client.models.PostLoansRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansResponse;
|
import org.apache.fineract.client.models.PostLoansResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.client.models.PutLoansLoanIdResponse;
|
import org.apache.fineract.client.models.PutLoansLoanIdResponse;
|
||||||
import org.apache.fineract.client.util.CallFailedRuntimeException;
|
import org.apache.fineract.client.util.CallFailedRuntimeException;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BatchHelper;
|
import org.apache.fineract.integrationtests.common.BatchHelper;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
@@ -152,6 +152,7 @@ public abstract class BaseLoanIntegrationTest {
|
|||||||
createResponseSpecification(Matchers.is(202)));
|
createResponseSpecification(Matchers.is(202)));
|
||||||
protected BusinessDateHelper businessDateHelper = new BusinessDateHelper();
|
protected BusinessDateHelper businessDateHelper = new BusinessDateHelper();
|
||||||
protected DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(DATETIME_PATTERN);
|
protected DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(DATETIME_PATTERN);
|
||||||
|
protected GlobalConfigurationHelper globalConfigurationHelper = new GlobalConfigurationHelper();
|
||||||
|
|
||||||
protected static void validateRepaymentPeriod(GetLoansLoanIdResponse loanDetails, Integer index, LocalDate dueDate, double principalDue,
|
protected static void validateRepaymentPeriod(GetLoansLoanIdResponse loanDetails, Integer index, LocalDate dueDate, double principalDue,
|
||||||
double principalPaid, double principalOutstanding, double paidInAdvance, double paidLate) {
|
double principalPaid, double principalOutstanding, double paidInAdvance, double paidLate) {
|
||||||
@@ -785,14 +786,14 @@ public abstract class BaseLoanIntegrationTest {
|
|||||||
|
|
||||||
protected void runAt(String date, Runnable runnable) {
|
protected void runAt(String date, Runnable runnable) {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(requestSpec, responseSpec, 42, true);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, TRUE);
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
businessDateHelper.updateBusinessDate(
|
businessDateHelper.updateBusinessDate(
|
||||||
new BusinessDateRequest().type(BUSINESS_DATE.getName()).date(date).dateFormat(DATETIME_PATTERN).locale("en"));
|
new BusinessDateRequest().type(BUSINESS_DATE.getName()).date(date).dateFormat(DATETIME_PATTERN).locale("en"));
|
||||||
runnable.run();
|
runnable.run();
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(requestSpec, responseSpec, 42, false);
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -48,17 +48,17 @@ import org.apache.fineract.batch.command.internal.CreateTransactionLoanCommandSt
|
|||||||
import org.apache.fineract.batch.command.internal.GetDatatableEntryByAppTableIdAndDataTableIdCommandStrategy;
|
import org.apache.fineract.batch.command.internal.GetDatatableEntryByAppTableIdAndDataTableIdCommandStrategy;
|
||||||
import org.apache.fineract.batch.domain.BatchRequest;
|
import org.apache.fineract.batch.domain.BatchRequest;
|
||||||
import org.apache.fineract.batch.domain.BatchResponse;
|
import org.apache.fineract.batch.domain.BatchResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
|
import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
|
||||||
import org.apache.fineract.integrationtests.common.BatchHelper;
|
import org.apache.fineract.integrationtests.common.BatchHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
||||||
import org.apache.fineract.integrationtests.common.error.ErrorResponse;
|
import org.apache.fineract.integrationtests.common.error.ErrorResponse;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanAccountLockHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanAccountLockHelper;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
|
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
|
||||||
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
|
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
|
||||||
@@ -73,12 +73,10 @@ import org.junit.jupiter.api.AfterEach;
|
|||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class BatchApiTest extends BaseLoanIntegrationTest {
|
||||||
public class BatchApiTest {
|
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(BatchApiTest.class);
|
private static final Logger LOG = LoggerFactory.getLogger(BatchApiTest.class);
|
||||||
|
|
||||||
@@ -113,12 +111,14 @@ public class BatchApiTest {
|
|||||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
this.datatableHelper = new DatatableHelper(this.requestSpec, this.responseSpec);
|
this.datatableHelper = new DatatableHelper(this.requestSpec, this.responseSpec);
|
||||||
GlobalConfigurationHelper.updateIsAutomaticExternalIdGenerationEnabled(this.requestSpec, this.responseSpec, true);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterEach
|
@AfterEach
|
||||||
public void postActions() {
|
public void postActions() {
|
||||||
GlobalConfigurationHelper.updateIsAutomaticExternalIdGenerationEnabled(this.requestSpec, this.responseSpec, false);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+20
-34
@@ -38,6 +38,7 @@ import org.apache.fineract.client.models.GetObligeeData;
|
|||||||
import org.apache.fineract.client.models.PostClientsClientIdResponse;
|
import org.apache.fineract.client.models.PostClientsClientIdResponse;
|
||||||
import org.apache.fineract.client.models.PostClientsResponse;
|
import org.apache.fineract.client.models.PostClientsResponse;
|
||||||
import org.apache.fineract.client.models.PutClientsClientIdResponse;
|
import org.apache.fineract.client.models.PutClientsClientIdResponse;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
@@ -50,6 +51,7 @@ public class ClientExternalIdTest {
|
|||||||
|
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
|
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@@ -57,13 +59,13 @@ public class ClientExternalIdTest {
|
|||||||
requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||||
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||||
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
|
globalConfigurationHelper = new GlobalConfigurationHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenAutoExternalIdConfigIsOffCreateClient() {
|
public void whenAutoExternalIdConfigIsOffCreateClient() {
|
||||||
// given
|
// given
|
||||||
GlobalConfigurationHelper.manageConfigurations(requestSpec, responseSpec,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, false);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, false);
|
|
||||||
final String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON,
|
final String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON,
|
||||||
null);
|
null);
|
||||||
// when
|
// when
|
||||||
@@ -92,8 +94,7 @@ public class ClientExternalIdTest {
|
|||||||
@Test
|
@Test
|
||||||
public void whenAutoExternalIdConfigIsOnCreateClient() {
|
public void whenAutoExternalIdConfigIsOnCreateClient() {
|
||||||
// given
|
// given
|
||||||
GlobalConfigurationHelper.manageConfigurations(requestSpec, responseSpec,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
final String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON,
|
final String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON,
|
||||||
null);
|
null);
|
||||||
// when
|
// when
|
||||||
@@ -105,15 +106,13 @@ public class ClientExternalIdTest {
|
|||||||
|
|
||||||
fetchClientByExternalId(clientResponse.getResourceExternalId());
|
fetchClientByExternalId(clientResponse.getResourceExternalId());
|
||||||
|
|
||||||
GlobalConfigurationHelper.manageConfigurations(requestSpec, responseSpec,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, false);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenAutoExternalIdConfigIsOnCreateClientWithValue() {
|
public void whenAutoExternalIdConfigIsOnCreateClientWithValue() {
|
||||||
// given
|
// given
|
||||||
GlobalConfigurationHelper.manageConfigurations(requestSpec, responseSpec,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
final String externalId = UUID.randomUUID().toString();
|
final String externalId = UUID.randomUUID().toString();
|
||||||
final String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON,
|
final String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON,
|
||||||
externalId);
|
externalId);
|
||||||
@@ -126,15 +125,13 @@ public class ClientExternalIdTest {
|
|||||||
|
|
||||||
fetchClientByExternalId(clientResponse.getResourceExternalId());
|
fetchClientByExternalId(clientResponse.getResourceExternalId());
|
||||||
|
|
||||||
GlobalConfigurationHelper.manageConfigurations(requestSpec, responseSpec,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, false);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testClientStatusUsingExternalId() {
|
public void testClientStatusUsingExternalId() {
|
||||||
ClientHelper clientHelper = new ClientHelper(requestSpec, responseSpec);
|
ClientHelper clientHelper = new ClientHelper(requestSpec, responseSpec);
|
||||||
GlobalConfigurationHelper.manageConfigurations(requestSpec, responseSpec,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON, null);
|
String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON, null);
|
||||||
final PostClientsResponse addClientResponse = ClientHelper.addClientAsPerson(requestSpec, responseSpec, jsonPayload);
|
final PostClientsResponse addClientResponse = ClientHelper.addClientAsPerson(requestSpec, responseSpec, jsonPayload);
|
||||||
final String clientExternalId = addClientResponse.getResourceExternalId();
|
final String clientExternalId = addClientResponse.getResourceExternalId();
|
||||||
@@ -202,15 +199,13 @@ public class ClientExternalIdTest {
|
|||||||
ClientStatusChecker.verifyClientStatus(ClientStatus.ACTIVE, clientResponse);
|
ClientStatusChecker.verifyClientStatus(ClientStatus.ACTIVE, clientResponse);
|
||||||
log.info("Client data id {} and status {}", clientExternalId, clientResponse.getStatus().getCode());
|
log.info("Client data id {} and status {}", clientExternalId, clientResponse.getStatus().getCode());
|
||||||
|
|
||||||
GlobalConfigurationHelper.manageConfigurations(requestSpec, responseSpec,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, false);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUpdateClientUsingExternalId() {
|
public void testUpdateClientUsingExternalId() {
|
||||||
// given
|
// given
|
||||||
GlobalConfigurationHelper.manageConfigurations(requestSpec, responseSpec,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON, null);
|
String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON, null);
|
||||||
// when
|
// when
|
||||||
final PostClientsResponse clientResponse = ClientHelper.addClientAsPerson(requestSpec, responseSpec, jsonPayload);
|
final PostClientsResponse clientResponse = ClientHelper.addClientAsPerson(requestSpec, responseSpec, jsonPayload);
|
||||||
@@ -223,16 +218,14 @@ public class ClientExternalIdTest {
|
|||||||
assertNotNull(clientUpdateResponse.getResourceExternalId());
|
assertNotNull(clientUpdateResponse.getResourceExternalId());
|
||||||
assertEquals(clientExternalId, clientUpdateResponse.getResourceExternalId());
|
assertEquals(clientExternalId, clientUpdateResponse.getResourceExternalId());
|
||||||
|
|
||||||
GlobalConfigurationHelper.manageConfigurations(requestSpec, responseSpec,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, false);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDeleteClientUsingExternalId() {
|
public void testDeleteClientUsingExternalId() {
|
||||||
// given
|
// given
|
||||||
ClientHelper clientHelper = new ClientHelper(requestSpec, responseSpec);
|
ClientHelper clientHelper = new ClientHelper(requestSpec, responseSpec);
|
||||||
GlobalConfigurationHelper.manageConfigurations(requestSpec, responseSpec,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON, null);
|
String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON, null);
|
||||||
// when
|
// when
|
||||||
final PostClientsResponse clientResponse = ClientHelper.addClientAsPerson(requestSpec, responseSpec, jsonPayload);
|
final PostClientsResponse clientResponse = ClientHelper.addClientAsPerson(requestSpec, responseSpec, jsonPayload);
|
||||||
@@ -250,15 +243,13 @@ public class ClientExternalIdTest {
|
|||||||
assertNotNull(clientDeleteResponse.getResourceExternalId());
|
assertNotNull(clientDeleteResponse.getResourceExternalId());
|
||||||
assertEquals(clientExternalId, clientDeleteResponse.getResourceExternalId());
|
assertEquals(clientExternalId, clientDeleteResponse.getResourceExternalId());
|
||||||
|
|
||||||
GlobalConfigurationHelper.manageConfigurations(requestSpec, responseSpec,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, false);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetClientAccountsUsingExternalId() {
|
public void testGetClientAccountsUsingExternalId() {
|
||||||
// given
|
// given
|
||||||
GlobalConfigurationHelper.manageConfigurations(requestSpec, responseSpec,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
final String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON,
|
final String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON,
|
||||||
null);
|
null);
|
||||||
// when
|
// when
|
||||||
@@ -271,15 +262,13 @@ public class ClientExternalIdTest {
|
|||||||
// then
|
// then
|
||||||
assertNotNull(clientAccountsResponse);
|
assertNotNull(clientAccountsResponse);
|
||||||
|
|
||||||
GlobalConfigurationHelper.manageConfigurations(requestSpec, responseSpec,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, false);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetClientTransferProposalDate() {
|
public void testGetClientTransferProposalDate() {
|
||||||
// given
|
// given
|
||||||
GlobalConfigurationHelper.manageConfigurations(requestSpec, responseSpec,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
final String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON,
|
final String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON,
|
||||||
null);
|
null);
|
||||||
final PostClientsResponse clientResponse = ClientHelper.addClientAsPerson(requestSpec, responseSpec, jsonPayload);
|
final PostClientsResponse clientResponse = ClientHelper.addClientAsPerson(requestSpec, responseSpec, jsonPayload);
|
||||||
@@ -292,15 +281,13 @@ public class ClientExternalIdTest {
|
|||||||
|
|
||||||
fetchClientByExternalId(clientResponse.getResourceExternalId());
|
fetchClientByExternalId(clientResponse.getResourceExternalId());
|
||||||
|
|
||||||
GlobalConfigurationHelper.manageConfigurations(requestSpec, responseSpec,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, false);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetClientObligeeData() {
|
public void testGetClientObligeeData() {
|
||||||
// given
|
// given
|
||||||
GlobalConfigurationHelper.manageConfigurations(requestSpec, responseSpec,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
final String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON,
|
final String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON,
|
||||||
null);
|
null);
|
||||||
// when
|
// when
|
||||||
@@ -313,8 +300,7 @@ public class ClientExternalIdTest {
|
|||||||
|
|
||||||
fetchClientByExternalId(clientResponse.getResourceExternalId());
|
fetchClientByExternalId(clientResponse.getResourceExternalId());
|
||||||
|
|
||||||
GlobalConfigurationHelper.manageConfigurations(requestSpec, responseSpec,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, false);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fetchClientByExternalId(final String externalId) {
|
private void fetchClientByExternalId(final String externalId) {
|
||||||
|
|||||||
+85
-48
@@ -86,13 +86,14 @@ import org.apache.fineract.client.models.PostLoansLoanIdTransactionsTransactionI
|
|||||||
import org.apache.fineract.client.models.PostLoansRequest;
|
import org.apache.fineract.client.models.PostLoansRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansResponse;
|
import org.apache.fineract.client.models.PostLoansResponse;
|
||||||
import org.apache.fineract.client.models.PutChargeTransactionChangesRequest;
|
import org.apache.fineract.client.models.PutChargeTransactionChangesRequest;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.client.util.CallFailedRuntimeException;
|
import org.apache.fineract.client.util.CallFailedRuntimeException;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
@@ -105,7 +106,6 @@ import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuil
|
|||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductHelper;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.integrationtests.common.savings.AccountTransferHelper;
|
import org.apache.fineract.integrationtests.common.savings.AccountTransferHelper;
|
||||||
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
|
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
|
||||||
@@ -117,7 +117,6 @@ import org.apache.fineract.portfolio.charge.domain.ChargePaymentMode;
|
|||||||
import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
|
import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
import org.junit.platform.commons.util.StringUtils;
|
import org.junit.platform.commons.util.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -127,9 +126,8 @@ import org.slf4j.LoggerFactory;
|
|||||||
* repayments and verifying accounting transactions
|
* repayments and verifying accounting transactions
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
|
||||||
@SuppressFBWarnings(value = "RV_EXCEPTION_NOT_THROWN", justification = "False positive")
|
@SuppressFBWarnings(value = "RV_EXCEPTION_NOT_THROWN", justification = "False positive")
|
||||||
public class ClientLoanIntegrationTest {
|
public class ClientLoanIntegrationTest extends BaseLoanIntegrationTest {
|
||||||
|
|
||||||
static {
|
static {
|
||||||
Utils.initializeRESTAssured();
|
Utils.initializeRESTAssured();
|
||||||
@@ -2545,8 +2543,7 @@ public class ClientLoanIntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void loanWithChargesOfTypeAmountPercentageAndPeriodicAccrualAccountingEnabled() throws InterruptedException {
|
public void loanWithChargesOfTypeAmountPercentageAndPeriodicAccrualAccountingEnabled() throws InterruptedException {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);
|
final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);
|
||||||
ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);
|
ClientHelper.verifyClientCreatedOnServer(REQUEST_SPEC, RESPONSE_SPEC, clientID);
|
||||||
|
|
||||||
@@ -2745,8 +2742,7 @@ public class ClientLoanIntegrationTest {
|
|||||||
loanStatusHashMap = LOAN_TRANSACTION_HELPER.getLoanDetail(REQUEST_SPEC, RESPONSE_SPEC, loanID, "status");
|
loanStatusHashMap = LOAN_TRANSACTION_HELPER.getLoanDetail(REQUEST_SPEC, RESPONSE_SPEC, loanID, "status");
|
||||||
LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap);
|
LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap);
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, false);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3446,7 +3442,9 @@ public class ClientLoanIntegrationTest {
|
|||||||
try {
|
try {
|
||||||
DateFormat dateFormat = new SimpleDateFormat(DATETIME_PATTERN, Locale.US);
|
DateFormat dateFormat = new SimpleDateFormat(DATETIME_PATTERN, Locale.US);
|
||||||
dateFormat.setTimeZone(Utils.getTimeZoneOfTenant());
|
dateFormat.setTimeZone(Utils.getTimeZoneOfTenant());
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(REQUEST_SPEC, RESPONSE_SPEC, "42", true);
|
globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
|
GlobalConfigurationConstants.IS_INTEREST_TO_BE_RECOVERED_FIRST_WHEN_GREATER_THAN_EMI,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
Calendar startDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
|
Calendar startDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
|
||||||
startDate.add(Calendar.MONTH, -8);
|
startDate.add(Calendar.MONTH, -8);
|
||||||
|
|
||||||
@@ -3495,7 +3493,9 @@ public class ClientLoanIntegrationTest {
|
|||||||
HashMap loanRepayment = LOAN_TRANSACTION_HELPER.makeRepaymentWithAccountNo(loanFirstRepaymentDate, earlyPayment, accountNo);
|
HashMap loanRepayment = LOAN_TRANSACTION_HELPER.makeRepaymentWithAccountNo(loanFirstRepaymentDate, earlyPayment, accountNo);
|
||||||
assertNotNull(loanRepayment);
|
assertNotNull(loanRepayment);
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(REQUEST_SPEC, RESPONSE_SPEC, "42", false);
|
globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
|
GlobalConfigurationConstants.IS_INTEREST_TO_BE_RECOVERED_FIRST_WHEN_GREATER_THAN_EMI,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4933,7 +4933,9 @@ public class ClientLoanIntegrationTest {
|
|||||||
try {
|
try {
|
||||||
DateFormat dateFormat = new SimpleDateFormat(DATETIME_PATTERN, Locale.US);
|
DateFormat dateFormat = new SimpleDateFormat(DATETIME_PATTERN, Locale.US);
|
||||||
dateFormat.setTimeZone(Utils.getTimeZoneOfTenant());
|
dateFormat.setTimeZone(Utils.getTimeZoneOfTenant());
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(REQUEST_SPEC, RESPONSE_SPEC, "42", true);
|
globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
|
GlobalConfigurationConstants.IS_INTEREST_TO_BE_RECOVERED_FIRST_WHEN_GREATER_THAN_EMI,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
Calendar startDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
|
Calendar startDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
|
||||||
Calendar currentDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
|
Calendar currentDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
|
||||||
startDate.add(Calendar.MONTH, -8);
|
startDate.add(Calendar.MONTH, -8);
|
||||||
@@ -4987,7 +4989,9 @@ public class ClientLoanIntegrationTest {
|
|||||||
loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);
|
loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(REQUEST_SPEC, RESPONSE_SPEC, loanID);
|
||||||
LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap);
|
LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap);
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(REQUEST_SPEC, RESPONSE_SPEC, "42", false);
|
globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
|
GlobalConfigurationConstants.IS_INTEREST_TO_BE_RECOVERED_FIRST_WHEN_GREATER_THAN_EMI,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4998,7 +5002,9 @@ public class ClientLoanIntegrationTest {
|
|||||||
final LoanTransactionHelper validationErrorHelper = new LoanTransactionHelper(REQUEST_SPEC, errorResponse);
|
final LoanTransactionHelper validationErrorHelper = new LoanTransactionHelper(REQUEST_SPEC, errorResponse);
|
||||||
DateFormat dateFormat = new SimpleDateFormat(DATETIME_PATTERN, Locale.US);
|
DateFormat dateFormat = new SimpleDateFormat(DATETIME_PATTERN, Locale.US);
|
||||||
dateFormat.setTimeZone(Utils.getTimeZoneOfTenant());
|
dateFormat.setTimeZone(Utils.getTimeZoneOfTenant());
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(REQUEST_SPEC, RESPONSE_SPEC, "42", true);
|
globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
|
GlobalConfigurationConstants.IS_INTEREST_TO_BE_RECOVERED_FIRST_WHEN_GREATER_THAN_EMI,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
Calendar startDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
|
Calendar startDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
|
||||||
Calendar currentDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
|
Calendar currentDate = Calendar.getInstance(Utils.getTimeZoneOfTenant());
|
||||||
startDate.add(Calendar.MONTH, -8);
|
startDate.add(Calendar.MONTH, -8);
|
||||||
@@ -5062,7 +5068,9 @@ public class ClientLoanIntegrationTest {
|
|||||||
ArrayList<HashMap> error = (ArrayList<HashMap>) savingsAccountErrorData.get("errors");
|
ArrayList<HashMap> error = (ArrayList<HashMap>) savingsAccountErrorData.get("errors");
|
||||||
assertEquals("error.msg.loan.transaction.cannot.be.a.future.date", error.get(0).get("userMessageGlobalisationCode"));
|
assertEquals("error.msg.loan.transaction.cannot.be.a.future.date", error.get(0).get("userMessageGlobalisationCode"));
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(REQUEST_SPEC, RESPONSE_SPEC, "42", false);
|
globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
|
GlobalConfigurationConstants.IS_INTEREST_TO_BE_RECOVERED_FIRST_WHEN_GREATER_THAN_EMI,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5182,7 +5190,8 @@ public class ClientLoanIntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void chargeAdjustmentForUnpaidCharge() {
|
public void chargeAdjustmentForUnpaidCharge() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("01 November 2022").dateFormat(DATETIME_PATTERN).locale("en"));
|
.date("01 November 2022").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||||
final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();
|
final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();
|
||||||
@@ -5344,14 +5353,16 @@ public class ClientLoanIntegrationTest {
|
|||||||
assertEquals(0.0f, loanSummary.get("principalPaid"));
|
assertEquals(0.0f, loanSummary.get("principalPaid"));
|
||||||
assertEquals(1005.0f, loanSummary.get("totalOutstanding"));
|
assertEquals(1005.0f, loanSummary.get("totalOutstanding"));
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void chargeAdjustmentAccountingValidation() {
|
public void chargeAdjustmentAccountingValidation() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("01 November 2022").dateFormat(DATETIME_PATTERN).locale("en"));
|
.date("01 November 2022").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||||
final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();
|
final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();
|
||||||
@@ -5509,8 +5520,7 @@ public class ClientLoanIntegrationTest {
|
|||||||
Integer feeLoanChargeId = LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper
|
Integer feeLoanChargeId = LOAN_TRANSACTION_HELPER.addChargesForLoan(loanID, LoanTransactionHelper
|
||||||
.getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(feeCharge.getResourceId()), feeCharge1AddedDate, "3"));
|
.getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(feeCharge.getResourceId()), feeCharge1AddedDate, "3"));
|
||||||
|
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
final String feeLoanChargeDate = DATE_TIME_FORMATTER.format(targetDate);
|
final String feeLoanChargeDate = DATE_TIME_FORMATTER.format(targetDate);
|
||||||
PERIODIC_ACCRUAL_ACCOUNTING_HELPER.runPeriodicAccrualAccounting(feeLoanChargeDate);
|
PERIODIC_ACCRUAL_ACCOUNTING_HELPER.runPeriodicAccrualAccounting(feeLoanChargeDate);
|
||||||
|
|
||||||
@@ -5740,9 +5750,9 @@ public class ClientLoanIntegrationTest {
|
|||||||
|
|
||||||
assertTrue(loanDetails.getStatus().getOverpaid());
|
assertTrue(loanDetails.getStatus().getOverpaid());
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, false);
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6030,8 +6040,10 @@ public class ClientLoanIntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void chargeOff() {
|
public void chargeOff() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsAutomaticExternalIdGenerationEnabled(REQUEST_SPEC, RESPONSE_SPEC, true);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID,
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, true);
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("30 September 2022").dateFormat(DATETIME_PATTERN).locale("en"));
|
.date("30 September 2022").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||||
final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();
|
final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();
|
||||||
@@ -6276,15 +6288,18 @@ public class ClientLoanIntegrationTest {
|
|||||||
LOAN_TRANSACTION_HELPER.makeCreditBalanceRefund((long) loanID, new PostLoansLoanIdTransactionsRequest()
|
LOAN_TRANSACTION_HELPER.makeCreditBalanceRefund((long) loanID, new PostLoansLoanIdTransactionsRequest()
|
||||||
.dateFormat(DATETIME_PATTERN).transactionDate("08 September 2022").locale("en").transactionAmount(3007.0));
|
.dateFormat(DATETIME_PATTERN).transactionDate("08 September 2022").locale("en").transactionAmount(3007.0));
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateIsAutomaticExternalIdGenerationEnabled(REQUEST_SPEC, RESPONSE_SPEC, false);
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCloseOpenMaturityDate() {
|
public void testCloseOpenMaturityDate() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsAutomaticExternalIdGenerationEnabled(REQUEST_SPEC, RESPONSE_SPEC, true);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();
|
final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();
|
||||||
final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();
|
final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();
|
||||||
final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();
|
final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();
|
||||||
@@ -6338,14 +6353,16 @@ public class ClientLoanIntegrationTest {
|
|||||||
|
|
||||||
assertTrue(expectedMaturityDate.isEqual(actualMaturityDate));
|
assertTrue(expectedMaturityDate.isEqual(actualMaturityDate));
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsAutomaticExternalIdGenerationEnabled(REQUEST_SPEC, RESPONSE_SPEC, false);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testReverseReplay() {
|
public void testReverseReplay() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsAutomaticExternalIdGenerationEnabled(REQUEST_SPEC, RESPONSE_SPEC, true);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();
|
final Account assetAccount = ACCOUNT_HELPER.createAssetAccount();
|
||||||
final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();
|
final Account incomeAccount = ACCOUNT_HELPER.createIncomeAccount();
|
||||||
final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();
|
final Account expenseAccount = ACCOUNT_HELPER.createExpenseAccount();
|
||||||
@@ -6475,15 +6492,18 @@ public class ClientLoanIntegrationTest {
|
|||||||
assertEquals(290.0, loanDetails.getTransactions().get(5).getOverpaymentPortion());
|
assertEquals(290.0, loanDetails.getTransactions().get(5).getOverpaymentPortion());
|
||||||
assertEquals(LocalDate.of(2022, 9, 7), loanDetails.getTransactions().get(5).getDate());
|
assertEquals(LocalDate.of(2022, 9, 7), loanDetails.getTransactions().get(5).getDate());
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsAutomaticExternalIdGenerationEnabled(REQUEST_SPEC, RESPONSE_SPEC, false);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCreditBalanceRefundAfterMaturityWithReverseReplayOfRepayments() {
|
public void testCreditBalanceRefundAfterMaturityWithReverseReplayOfRepayments() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsAutomaticExternalIdGenerationEnabled(REQUEST_SPEC, RESPONSE_SPEC, true);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID,
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, true);
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("10 October 2022").dateFormat(DATETIME_PATTERN).locale("en"));
|
.date("10 October 2022").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||||
|
|
||||||
@@ -6606,16 +6626,20 @@ public class ClientLoanIntegrationTest {
|
|||||||
.count());
|
.count());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsAutomaticExternalIdGenerationEnabled(REQUEST_SPEC, RESPONSE_SPEC, false);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID,
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, false);
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCreditBalanceRefundBeforeMaturityWithReverseReplayOfRepaymentsAndRefund() {
|
public void testCreditBalanceRefundBeforeMaturityWithReverseReplayOfRepaymentsAndRefund() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsAutomaticExternalIdGenerationEnabled(REQUEST_SPEC, RESPONSE_SPEC, true);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID,
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, true);
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("10 October 2022").dateFormat(DATETIME_PATTERN).locale("en"));
|
.date("10 October 2022").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||||
|
|
||||||
@@ -6734,16 +6758,20 @@ public class ClientLoanIntegrationTest {
|
|||||||
assertEquals(700.0, loanDetails.getRepaymentSchedule().getPeriods().get(1).getPrincipalOutstanding());
|
assertEquals(700.0, loanDetails.getRepaymentSchedule().getPeriods().get(1).getPrincipalOutstanding());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsAutomaticExternalIdGenerationEnabled(REQUEST_SPEC, RESPONSE_SPEC, false);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID,
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, false);
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void accrualIsCalculatedWhenTheLoanIsClosed() {
|
public void accrualIsCalculatedWhenTheLoanIsClosed() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsAutomaticExternalIdGenerationEnabled(REQUEST_SPEC, RESPONSE_SPEC, true);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID,
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, true);
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("10 October 2022").dateFormat(DATETIME_PATTERN).locale("en"));
|
.date("10 October 2022").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||||
|
|
||||||
@@ -6811,16 +6839,21 @@ public class ClientLoanIntegrationTest {
|
|||||||
});
|
});
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsAutomaticExternalIdGenerationEnabled(REQUEST_SPEC, RESPONSE_SPEC, false);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID,
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, false);
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLoanTransactionOrderAfterReverseReplay() {
|
public void testLoanTransactionOrderAfterReverseReplay() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(REQUEST_SPEC, RESPONSE_SPEC, "42", true);
|
globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, Boolean.TRUE);
|
GlobalConfigurationConstants.IS_INTEREST_TO_BE_RECOVERED_FIRST_WHEN_GREATER_THAN_EMI,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("01 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
.date("01 January 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||||
LOG.info("-----------------------------------NEW CLIENT-----------------------------------------");
|
LOG.info("-----------------------------------NEW CLIENT-----------------------------------------");
|
||||||
@@ -6882,8 +6915,11 @@ public class ClientLoanIntegrationTest {
|
|||||||
.transactionAmount(0.0).locale("en"));
|
.transactionAmount(0.0).locale("en"));
|
||||||
checkLoanTransactionOrder(loanId, loanDisbursementUUID, firstRepaymentUUID, secondRepaymentUUID, thirdRepaymentUUID);
|
checkLoanTransactionOrder(loanId, loanDisbursementUUID, firstRepaymentUUID, secondRepaymentUUID, thirdRepaymentUUID);
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(REQUEST_SPEC, RESPONSE_SPEC, "42", false);
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
|
GlobalConfigurationConstants.IS_INTEREST_TO_BE_RECOVERED_FIRST_WHEN_GREATER_THAN_EMI,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8049,7 +8085,8 @@ public class ClientLoanIntegrationTest {
|
|||||||
.loanTermFrequencyType(0).principal(BigDecimal.valueOf(1000.0)).loanType("individual"));
|
.loanTermFrequencyType(0).principal(BigDecimal.valueOf(1000.0)).loanType("individual"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private PostLoanProductsRequest createOnePeriod30DaysLongNoInterestPeriodicAccrualProduct() {
|
@Override
|
||||||
|
protected PostLoanProductsRequest createOnePeriod30DaysLongNoInterestPeriodicAccrualProduct() {
|
||||||
return new PostLoanProductsRequest().name(Utils.uniqueRandomStringGenerator("LOAN_PRODUCT_", 6))//
|
return new PostLoanProductsRequest().name(Utils.uniqueRandomStringGenerator("LOAN_PRODUCT_", 6))//
|
||||||
.shortName(Utils.uniqueRandomStringGenerator("", 4))//
|
.shortName(Utils.uniqueRandomStringGenerator("", 4))//
|
||||||
.description("Loan Product Description")//
|
.description("Loan Product Description")//
|
||||||
|
|||||||
+26
-11
@@ -41,7 +41,9 @@ import java.util.List;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import org.apache.fineract.client.models.PostPaymentTypesRequest;
|
import org.apache.fineract.client.models.PostPaymentTypesRequest;
|
||||||
import org.apache.fineract.client.models.PostPaymentTypesResponse;
|
import org.apache.fineract.client.models.PostPaymentTypesResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||||
@@ -85,6 +87,7 @@ public class ClientSavingsIntegrationTest {
|
|||||||
private SavingsProductHelper savingsProductHelper;
|
private SavingsProductHelper savingsProductHelper;
|
||||||
private SchedulerJobHelper scheduleJobHelper;
|
private SchedulerJobHelper scheduleJobHelper;
|
||||||
private PaymentTypeHelper paymentTypeHelper;
|
private PaymentTypeHelper paymentTypeHelper;
|
||||||
|
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@@ -94,6 +97,7 @@ public class ClientSavingsIntegrationTest {
|
|||||||
this.requestSpec.header("Fineract-Platform-TenantId", "default");
|
this.requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
this.paymentTypeHelper = new PaymentTypeHelper();
|
this.paymentTypeHelper = new PaymentTypeHelper();
|
||||||
|
this.globalConfigurationHelper = new GlobalConfigurationHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -226,7 +230,9 @@ public class ClientSavingsIntegrationTest {
|
|||||||
|
|
||||||
Assertions.assertNotNull(summaryAfterPosting.get("interestPostedTillDate"));
|
Assertions.assertNotNull(summaryAfterPosting.get("interestPostedTillDate"));
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec, "38", false);
|
globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
|
GlobalConfigurationConstants.ALLOW_BACKDATED_TRANSACTION_BEFORE_INTEREST_POSTING,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
|
||||||
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(403).build();
|
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(403).build();
|
||||||
final SavingsAccountHelper validationErrorHelper = new SavingsAccountHelper(this.requestSpec, errorResponse);
|
final SavingsAccountHelper validationErrorHelper = new SavingsAccountHelper(this.requestSpec, errorResponse);
|
||||||
@@ -242,7 +248,9 @@ public class ClientSavingsIntegrationTest {
|
|||||||
List<HashMap> error = (List<HashMap>) validationErrorHelper.depositToSavingsAccount(savingsId, "3000", depositDate,
|
List<HashMap> error = (List<HashMap>) validationErrorHelper.depositToSavingsAccount(savingsId, "3000", depositDate,
|
||||||
CommonConstants.RESPONSE_ERROR);
|
CommonConstants.RESPONSE_ERROR);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec, "38", true);
|
globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
|
GlobalConfigurationConstants.ALLOW_BACKDATED_TRANSACTION_BEFORE_INTEREST_POSTING,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
// LOG.info(savingsAccountErrorData.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE).toString());
|
// LOG.info(savingsAccountErrorData.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE).toString());
|
||||||
assertEquals("error.msg.savings.transaction.is.not.allowed", error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
assertEquals("error.msg.savings.transaction.is.not.allowed", error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||||
@@ -635,7 +643,8 @@ public class ClientSavingsIntegrationTest {
|
|||||||
public void testSavingsAccountCharges() {
|
public void testSavingsAccountCharges() {
|
||||||
Integer savingsId = null;
|
Integer savingsId = null;
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
LocalDate submittedDate = LocalDate.of(2022, 9, 28);
|
LocalDate submittedDate = LocalDate.of(2022, 9, 28);
|
||||||
String submittedDateString = "28 September 2022";
|
String submittedDateString = "28 September 2022";
|
||||||
@@ -806,7 +815,8 @@ public class ClientSavingsIntegrationTest {
|
|||||||
} finally {
|
} finally {
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2024, 11, 11));
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2024, 11, 11));
|
||||||
savingsAccountHelper.closeSavingsAccountOnDate(savingsId, "true", "11 November 2024");
|
savingsAccountHelper.closeSavingsAccountOnDate(savingsId, "true", "11 November 2024");
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3081,7 +3091,8 @@ public class ClientSavingsIntegrationTest {
|
|||||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||||
this.savingsProductHelper = new SavingsProductHelper();
|
this.savingsProductHelper = new SavingsProductHelper();
|
||||||
this.scheduleJobHelper = new SchedulerJobHelper(requestSpec);
|
this.scheduleJobHelper = new SchedulerJobHelper(requestSpec);
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec, "46", true);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_POST_REVERSAL_TXNS_FOR_REVERSE_TRANSACTIONS,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
LocalDate transactionDate = LocalDate.now(Utils.getZoneIdOfTenant()).minusDays(5);
|
LocalDate transactionDate = LocalDate.now(Utils.getZoneIdOfTenant()).minusDays(5);
|
||||||
LocalDate nextTransactionDate = transactionDate.plusDays(2);
|
LocalDate nextTransactionDate = transactionDate.plusDays(2);
|
||||||
final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd MMMM yyyy");
|
final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd MMMM yyyy");
|
||||||
@@ -3113,7 +3124,8 @@ public class ClientSavingsIntegrationTest {
|
|||||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||||
this.savingsProductHelper = new SavingsProductHelper();
|
this.savingsProductHelper = new SavingsProductHelper();
|
||||||
this.scheduleJobHelper = new SchedulerJobHelper(requestSpec);
|
this.scheduleJobHelper = new SchedulerJobHelper(requestSpec);
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec, "46", false);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_POST_REVERSAL_TXNS_FOR_REVERSE_TRANSACTIONS,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
LocalDate transactionDate = LocalDate.now(Utils.getZoneIdOfTenant()).minusDays(5);
|
LocalDate transactionDate = LocalDate.now(Utils.getZoneIdOfTenant()).minusDays(5);
|
||||||
LocalDate nextTransactionDate = transactionDate.plusDays(2);
|
LocalDate nextTransactionDate = transactionDate.plusDays(2);
|
||||||
final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd MMMM yyyy");
|
final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd MMMM yyyy");
|
||||||
@@ -3207,14 +3219,17 @@ public class ClientSavingsIntegrationTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void configurationForBackdatedTransaction() {
|
public void configurationForBackdatedTransaction() {
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec, "38", false);
|
globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec, "39", true);
|
GlobalConfigurationConstants.ALLOW_BACKDATED_TRANSACTION_BEFORE_INTEREST_POSTING,
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(requestSpec, responseSpec, "39", "5");
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
|
GlobalConfigurationConstants.ALLOW_BACKDATED_TRANSACTION_BEFORE_INTEREST_POSTING_DATE_FOR_DAYS,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true).value(5L));
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterEach
|
@AfterEach
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.resetAllDefaultGlobalConfigurations();
|
||||||
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.verifyAllDefaultGlobalConfigurations();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-12
@@ -35,7 +35,6 @@ import java.security.SecureRandom;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import org.apache.commons.lang3.BooleanUtils;
|
|
||||||
import org.apache.fineract.client.models.GetClientClientIdAddressesResponse;
|
import org.apache.fineract.client.models.GetClientClientIdAddressesResponse;
|
||||||
import org.apache.fineract.client.models.GetClientsClientIdResponse;
|
import org.apache.fineract.client.models.GetClientsClientIdResponse;
|
||||||
import org.apache.fineract.client.models.GlobalConfigurationPropertyData;
|
import org.apache.fineract.client.models.GlobalConfigurationPropertyData;
|
||||||
@@ -43,6 +42,8 @@ import org.apache.fineract.client.models.PostClientClientIdAddressesRequest;
|
|||||||
import org.apache.fineract.client.models.PostClientClientIdAddressesResponse;
|
import org.apache.fineract.client.models.PostClientClientIdAddressesResponse;
|
||||||
import org.apache.fineract.client.models.PostClientsAddressRequest;
|
import org.apache.fineract.client.models.PostClientsAddressRequest;
|
||||||
import org.apache.fineract.client.models.PostClientsRequest;
|
import org.apache.fineract.client.models.PostClientsRequest;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
@@ -58,6 +59,7 @@ public class ClientTest {
|
|||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
private ClientHelper clientHelper;
|
private ClientHelper clientHelper;
|
||||||
|
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@@ -66,12 +68,13 @@ public class ClientTest {
|
|||||||
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||||
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
clientHelper = new ClientHelper(requestSpec, responseSpec);
|
clientHelper = new ClientHelper(requestSpec, responseSpec);
|
||||||
|
globalConfigurationHelper = new GlobalConfigurationHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterEach
|
@AfterEach
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(requestSpec, responseSpec);
|
globalConfigurationHelper.resetAllDefaultGlobalConfigurations();
|
||||||
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(requestSpec, responseSpec);
|
globalConfigurationHelper.verifyAllDefaultGlobalConfigurations();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -203,15 +206,11 @@ public class ClientTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testClientAddressCreationWorks() {
|
public void testClientAddressCreationWorks() {
|
||||||
// given
|
// given
|
||||||
GlobalConfigurationPropertyData addressEnabledConfig = GlobalConfigurationHelper.getGlobalConfigurationByName(requestSpec,
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_ADDRESS,
|
||||||
responseSpec, "Enable-Address");
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
Long configId = addressEnabledConfig.getId();
|
GlobalConfigurationPropertyData updatedAddressEnabledConfig = globalConfigurationHelper
|
||||||
|
.getGlobalConfigurationByName(GlobalConfigurationConstants.ENABLE_ADDRESS);
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(requestSpec, responseSpec, configId, true);
|
assertThat(updatedAddressEnabledConfig.getEnabled()).isTrue();
|
||||||
GlobalConfigurationPropertyData updatedAddressEnabledConfig = GlobalConfigurationHelper.getGlobalConfigurationByName(requestSpec,
|
|
||||||
responseSpec, "Enable-Address");
|
|
||||||
boolean isAddressEnabled = BooleanUtils.toBoolean(updatedAddressEnabledConfig.getEnabled());
|
|
||||||
assertThat(isAddressEnabled).isTrue();
|
|
||||||
|
|
||||||
Integer addressTypeId = CodeHelper.createAddressTypeCodeValue(requestSpec, responseSpec,
|
Integer addressTypeId = CodeHelper.createAddressTypeCodeValue(requestSpec, responseSpec,
|
||||||
Utils.randomStringGenerator("Residential address", 4), 0);
|
Utils.randomStringGenerator("Residential address", 4), 0);
|
||||||
|
|||||||
+11
-9
@@ -46,16 +46,16 @@ import org.apache.fineract.client.models.GetLoansLoanIdRepaymentSchedule;
|
|||||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||||
import org.apache.fineract.client.models.PaymentAllocationOrder;
|
import org.apache.fineract.client.models.PaymentAllocationOrder;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
|
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
|
||||||
import org.apache.fineract.portfolio.loanaccount.domain.LoanStatus;
|
import org.apache.fineract.portfolio.loanaccount.domain.LoanStatus;
|
||||||
@@ -63,14 +63,12 @@ import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanSchedul
|
|||||||
import org.apache.fineract.portfolio.loanproduct.domain.PaymentAllocationType;
|
import org.apache.fineract.portfolio.loanproduct.domain.PaymentAllocationType;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Named;
|
import org.junit.jupiter.api.Named;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
import org.junit.jupiter.params.ParameterizedTest;
|
import org.junit.jupiter.params.ParameterizedTest;
|
||||||
import org.junit.jupiter.params.provider.Arguments;
|
import org.junit.jupiter.params.provider.Arguments;
|
||||||
import org.junit.jupiter.params.provider.MethodSource;
|
import org.junit.jupiter.params.provider.MethodSource;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class DelinquencyAndChargebackIntegrationTest extends BaseLoanIntegrationTest {
|
||||||
public class DelinquencyAndChargebackIntegrationTest {
|
|
||||||
|
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
@@ -93,7 +91,8 @@ public class DelinquencyAndChargebackIntegrationTest {
|
|||||||
@MethodSource("loanProductFactory")
|
@MethodSource("loanProductFactory")
|
||||||
public void testLoanClassificationStepAsPartOfCOB(LoanProductTestBuilder loanProductTestBuilder) {
|
public void testLoanClassificationStepAsPartOfCOB(LoanProductTestBuilder loanProductTestBuilder) {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
final LocalDate todaysDate = Utils.getDateAsLocalDate("01 April 2012");
|
final LocalDate todaysDate = Utils.getDateAsLocalDate("01 April 2012");
|
||||||
LocalDate businessDate = todaysDate.minusMonths(3);
|
LocalDate businessDate = todaysDate.minusMonths(3);
|
||||||
@@ -205,7 +204,8 @@ public class DelinquencyAndChargebackIntegrationTest {
|
|||||||
getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
|
getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
|
||||||
validateLoanAccount(getLoansLoanIdResponse, amountVal, "950.00", 4, Double.valueOf("50.00"));
|
validateLoanAccount(getLoansLoanIdResponse, amountVal, "950.00", 4, Double.valueOf("50.00"));
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,7 +213,8 @@ public class DelinquencyAndChargebackIntegrationTest {
|
|||||||
@MethodSource("loanProductFactory")
|
@MethodSource("loanProductFactory")
|
||||||
public void testLoanClassificationStepAsPartOfCOBRepeated(LoanProductTestBuilder loanProductTestBuilder) {
|
public void testLoanClassificationStepAsPartOfCOBRepeated(LoanProductTestBuilder loanProductTestBuilder) {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
List<LocalDate> expectedDates = new ArrayList();
|
List<LocalDate> expectedDates = new ArrayList();
|
||||||
|
|
||||||
@@ -336,7 +337,8 @@ public class DelinquencyAndChargebackIntegrationTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+30
-15
@@ -63,15 +63,16 @@ import org.apache.fineract.client.models.PostLoansRequest;
|
|||||||
import org.apache.fineract.client.models.PostLoansResponse;
|
import org.apache.fineract.client.models.PostLoansResponse;
|
||||||
import org.apache.fineract.client.models.PutDelinquencyBucketResponse;
|
import org.apache.fineract.client.models.PutDelinquencyBucketResponse;
|
||||||
import org.apache.fineract.client.models.PutDelinquencyRangeResponse;
|
import org.apache.fineract.client.models.PutDelinquencyRangeResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.client.models.PutLoanProductsProductIdRequest;
|
import org.apache.fineract.client.models.PutLoanProductsProductIdRequest;
|
||||||
import org.apache.fineract.client.models.PutLoanProductsProductIdResponse;
|
import org.apache.fineract.client.models.PutLoanProductsProductIdResponse;
|
||||||
import org.apache.fineract.cob.data.JobBusinessStepConfigData;
|
import org.apache.fineract.cob.data.JobBusinessStepConfigData;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessStepConfigurationHelper;
|
import org.apache.fineract.integrationtests.common.BusinessStepConfigurationHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
||||||
@@ -314,7 +315,8 @@ public class DelinquencyBucketsIntegrationTest extends BaseLoanIntegrationTest {
|
|||||||
try {
|
try {
|
||||||
// Given
|
// Given
|
||||||
final LoanTransactionHelper loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
final LoanTransactionHelper loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
final LocalDate bussinesLocalDate = Utils.getDateAsLocalDate("01 March 2012");
|
final LocalDate bussinesLocalDate = Utils.getDateAsLocalDate("01 March 2012");
|
||||||
log.info("Current date {}", bussinesLocalDate);
|
log.info("Current date {}", bussinesLocalDate);
|
||||||
@@ -402,14 +404,16 @@ public class DelinquencyBucketsIntegrationTest extends BaseLoanIntegrationTest {
|
|||||||
assertEquals(getDelinquencyTagsHistory.get(0).getDelinquencyRange().getClassification(), classificationExpected);
|
assertEquals(getDelinquencyTagsHistory.get(0).getDelinquencyRange().getClassification(), classificationExpected);
|
||||||
log.info("Delinquency Tag Item with Lifted On {}", getDelinquencyTagsHistory.get(0).getLiftedOnDate());
|
log.info("Delinquency Tag Item with Lifted On {}", getDelinquencyTagsHistory.get(0).getLiftedOnDate());
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLoanClassificationRealtimeWithCharges() {
|
public void testLoanClassificationRealtimeWithCharges() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
final LocalDate bussinesLocalDate = Utils.getDateAsLocalDate("01 April 2012");
|
final LocalDate bussinesLocalDate = Utils.getDateAsLocalDate("01 April 2012");
|
||||||
log.info("Current date {}", bussinesLocalDate);
|
log.info("Current date {}", bussinesLocalDate);
|
||||||
@@ -497,7 +501,8 @@ public class DelinquencyBucketsIntegrationTest extends BaseLoanIntegrationTest {
|
|||||||
// Evaluate a Delinquency Tag set after add charge to the Loan
|
// Evaluate a Delinquency Tag set after add charge to the Loan
|
||||||
assertEquals(getLoansLoanIdResponse.getDelinquencyRange().getClassification(), classificationExpected);
|
assertEquals(getLoansLoanIdResponse.getDelinquencyRange().getClassification(), classificationExpected);
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -711,7 +716,8 @@ public class DelinquencyBucketsIntegrationTest extends BaseLoanIntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testLoanClassificationJob() {
|
public void testLoanClassificationJob() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
LocalDate businessDate = Utils.getLocalDateOfTenant();
|
LocalDate businessDate = Utils.getLocalDateOfTenant();
|
||||||
businessDate = businessDate.minusDays(37);
|
businessDate = businessDate.minusDays(37);
|
||||||
@@ -794,14 +800,16 @@ public class DelinquencyBucketsIntegrationTest extends BaseLoanIntegrationTest {
|
|||||||
assertEquals(secondTestCase.getClassification(), classificationExpected);
|
assertEquals(secondTestCase.getClassification(), classificationExpected);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLoanClassificationStepAsPartOfCOB() {
|
public void testLoanClassificationStepAsPartOfCOB() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
LocalDate bussinesLocalDate = Utils.getDateAsLocalDate("01 April 2012");
|
LocalDate bussinesLocalDate = Utils.getDateAsLocalDate("01 April 2012");
|
||||||
log.info("Current date {}", bussinesLocalDate);
|
log.info("Current date {}", bussinesLocalDate);
|
||||||
@@ -896,14 +904,16 @@ public class DelinquencyBucketsIntegrationTest extends BaseLoanIntegrationTest {
|
|||||||
assertEquals(getLoanProductsProductResponse.getDelinquencyBucket().getName(), delinquencyBucket.getName());
|
assertEquals(getLoanProductsProductResponse.getDelinquencyBucket().getName(), delinquencyBucket.getName());
|
||||||
assertEquals(secondTestCase.getClassification(), classificationExpected);
|
assertEquals(secondTestCase.getClassification(), classificationExpected);
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLoanClassificationToValidateNegatives() {
|
public void testLoanClassificationToValidateNegatives() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
LocalDate bussinesLocalDate = Utils.getDateAsLocalDate("01 January 2012");
|
LocalDate bussinesLocalDate = Utils.getDateAsLocalDate("01 January 2012");
|
||||||
log.info("Current date {}", bussinesLocalDate);
|
log.info("Current date {}", bussinesLocalDate);
|
||||||
@@ -975,14 +985,16 @@ public class DelinquencyBucketsIntegrationTest extends BaseLoanIntegrationTest {
|
|||||||
assertEquals(0, getLoansLoanIdCollectionData.getPastDueDays());
|
assertEquals(0, getLoansLoanIdCollectionData.getPastDueDays());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLoanClassificationUsingAgeingArrears() {
|
public void testLoanClassificationUsingAgeingArrears() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
LocalDate bussinesLocalDate = Utils.getDateAsLocalDate("01 January 2012");
|
LocalDate bussinesLocalDate = Utils.getDateAsLocalDate("01 January 2012");
|
||||||
log.info("Current date {}", bussinesLocalDate);
|
log.info("Current date {}", bussinesLocalDate);
|
||||||
@@ -1064,7 +1076,8 @@ public class DelinquencyBucketsIntegrationTest extends BaseLoanIntegrationTest {
|
|||||||
assertEquals(0, getLoansLoanIdCollectionData.getPastDueDays());
|
assertEquals(0, getLoansLoanIdCollectionData.getPastDueDays());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1394,7 +1407,8 @@ public class DelinquencyBucketsIntegrationTest extends BaseLoanIntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testLoanClassificationOnlyForActiveLoanWithCOB() {
|
public void testLoanClassificationOnlyForActiveLoanWithCOB() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
final String operationDate = "01 January 2012";
|
final String operationDate = "01 January 2012";
|
||||||
|
|
||||||
LocalDate bussinesLocalDate = Utils.getDateAsLocalDate(operationDate);
|
LocalDate bussinesLocalDate = Utils.getDateAsLocalDate(operationDate);
|
||||||
@@ -1445,7 +1459,8 @@ public class DelinquencyBucketsIntegrationTest extends BaseLoanIntegrationTest {
|
|||||||
assertEquals(0, delinquent.getDelinquentAmount());
|
assertEquals(0, delinquent.getDelinquentAmount());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+55
-31
@@ -39,10 +39,11 @@ import org.apache.fineract.client.models.PostLoansLoanIdChargesChargeIdResponse;
|
|||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsTransactionIdRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsTransactionIdRequest;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.LoanRescheduleRequestHelper;
|
import org.apache.fineract.integrationtests.common.LoanRescheduleRequestHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
@@ -52,17 +53,14 @@ import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuil
|
|||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanRescheduleRequestTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanRescheduleRequestTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.integrationtests.inlinecob.InlineLoanCOBHelper;
|
import org.apache.fineract.integrationtests.inlinecob.InlineLoanCOBHelper;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class DueDateRespectiveLoanRepaymentScheduleTest extends BaseLoanIntegrationTest {
|
||||||
public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(DueDateRespectiveLoanRepaymentScheduleTest.class);
|
private static final Logger LOG = LoggerFactory.getLogger(DueDateRespectiveLoanRepaymentScheduleTest.class);
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
@@ -100,7 +98,8 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
@Test
|
@Test
|
||||||
public void scenario1() {
|
public void scenario1() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("2023.02.01").dateFormat("yyyy.MM.dd").locale("en"));
|
.date("2023.02.01").dateFormat("yyyy.MM.dd").locale("en"));
|
||||||
|
|
||||||
@@ -188,7 +187,8 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
assertEquals(1, response.getTransactions().get(3).getLoanChargePaidByList().size());
|
assertEquals(1, response.getTransactions().get(3).getLoanChargePaidByList().size());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,7 +209,8 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
@Test
|
@Test
|
||||||
public void scenario2() {
|
public void scenario2() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("2023.02.01").dateFormat("yyyy.MM.dd").locale("en"));
|
.date("2023.02.01").dateFormat("yyyy.MM.dd").locale("en"));
|
||||||
|
|
||||||
@@ -305,7 +306,8 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
assertEquals(firstChargeId, response.getTransactions().get(3).getLoanChargePaidByList().get(0).getChargeId().intValue());
|
assertEquals(firstChargeId, response.getTransactions().get(3).getLoanChargePaidByList().get(0).getChargeId().intValue());
|
||||||
assertEquals(1, response.getTransactions().get(3).getLoanChargePaidByList().size());
|
assertEquals(1, response.getTransactions().get(3).getLoanChargePaidByList().size());
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -320,7 +322,8 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
@Test
|
@Test
|
||||||
public void scenario3() {
|
public void scenario3() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("2023.02.01").dateFormat("yyyy.MM.dd").locale("en"));
|
.date("2023.02.01").dateFormat("yyyy.MM.dd").locale("en"));
|
||||||
|
|
||||||
@@ -423,7 +426,8 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
response.getTransactions().get(repaymentOrderNo).getLoanChargePaidByList().get(0).getChargeId().intValue());
|
response.getTransactions().get(repaymentOrderNo).getLoanChargePaidByList().get(0).getChargeId().intValue());
|
||||||
assertEquals(1, response.getTransactions().get(repaymentOrderNo).getLoanChargePaidByList().size());
|
assertEquals(1, response.getTransactions().get(repaymentOrderNo).getLoanChargePaidByList().size());
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,7 +441,8 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
@Test
|
@Test
|
||||||
public void scenario4() {
|
public void scenario4() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("2023.02.01").dateFormat("yyyy.MM.dd").locale("en"));
|
.date("2023.02.01").dateFormat("yyyy.MM.dd").locale("en"));
|
||||||
|
|
||||||
@@ -511,7 +516,8 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
assertEquals(1, response.getTransactions().get(1).getLoanChargePaidByList().size());
|
assertEquals(1, response.getTransactions().get(1).getLoanChargePaidByList().size());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,7 +532,8 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
@Test
|
@Test
|
||||||
public void scenario5() {
|
public void scenario5() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("2023.02.01").dateFormat("yyyy.MM.dd").locale("en"));
|
.date("2023.02.01").dateFormat("yyyy.MM.dd").locale("en"));
|
||||||
|
|
||||||
@@ -660,7 +667,8 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
assertEquals(0.0, response.getTransactions().get(secondRepaymentIndex).getOutstandingLoanBalance());
|
assertEquals(0.0, response.getTransactions().get(secondRepaymentIndex).getOutstandingLoanBalance());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -674,7 +682,8 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
@Test
|
@Test
|
||||||
public void scenario6() {
|
public void scenario6() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("2023.03.01").dateFormat("yyyy.MM.dd").locale("en"));
|
.date("2023.03.01").dateFormat("yyyy.MM.dd").locale("en"));
|
||||||
|
|
||||||
@@ -735,7 +744,8 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
assertEquals(1, response.getTransactions().get(1).getLoanChargePaidByList().size());
|
assertEquals(1, response.getTransactions().get(1).getLoanChargePaidByList().size());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -749,7 +759,8 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
@Test
|
@Test
|
||||||
public void scenario7() {
|
public void scenario7() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("2023.01.28").dateFormat("yyyy.MM.dd").locale("en"));
|
.date("2023.01.28").dateFormat("yyyy.MM.dd").locale("en"));
|
||||||
|
|
||||||
@@ -869,7 +880,8 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
assertEquals(1, response.getTransactions().get(2).getLoanChargePaidByList().size());
|
assertEquals(1, response.getTransactions().get(2).getLoanChargePaidByList().size());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -884,7 +896,8 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
@Test
|
@Test
|
||||||
public void scenario8() {
|
public void scenario8() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("2023.02.15").dateFormat("yyyy.MM.dd").locale("en"));
|
.date("2023.02.15").dateFormat("yyyy.MM.dd").locale("en"));
|
||||||
|
|
||||||
@@ -1090,7 +1103,8 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
assertEquals(1, response.getTransactions().get(4).getLoanChargePaidByList().size());
|
assertEquals(1, response.getTransactions().get(4).getLoanChargePaidByList().size());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1108,7 +1122,8 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
@Test
|
@Test
|
||||||
public void scenario9() {
|
public void scenario9() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("2023.02.15").dateFormat("yyyy.MM.dd").locale("en"));
|
.date("2023.02.15").dateFormat("yyyy.MM.dd").locale("en"));
|
||||||
|
|
||||||
@@ -1400,7 +1415,8 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
assertEquals(2, response.getTransactions().get(5).getLoanChargePaidByList().size());
|
assertEquals(2, response.getTransactions().get(5).getLoanChargePaidByList().size());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1414,10 +1430,12 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
@Test
|
@Test
|
||||||
public void scenario10() {
|
public void scenario10() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("2023.05.14").dateFormat("yyyy.MM.dd").locale("en"));
|
.date("2023.05.14").dateFormat("yyyy.MM.dd").locale("en"));
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(requestSpec, responseSpec, "submitted-date");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("submitted-date"));
|
||||||
|
|
||||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||||
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
||||||
@@ -1593,8 +1611,10 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
assertEquals(0.0, loanDetails.getTransactions().get(4).getOutstandingLoanBalance());
|
assertEquals(0.0, loanDetails.getTransactions().get(4).getOutstandingLoanBalance());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(requestSpec, responseSpec, "due-date");
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("due-date"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1608,10 +1628,12 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
@Test
|
@Test
|
||||||
public void scenario11() {
|
public void scenario11() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("2023.05.14").dateFormat("yyyy.MM.dd").locale("en"));
|
.date("2023.05.14").dateFormat("yyyy.MM.dd").locale("en"));
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(requestSpec, responseSpec, "submitted-date");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("submitted-date"));
|
||||||
|
|
||||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||||
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
||||||
@@ -1787,8 +1809,10 @@ public class DueDateRespectiveLoanRepaymentScheduleTest {
|
|||||||
assertEquals(2.95, loanDetails.getTransactions().get(4).getFeeChargesPortion());
|
assertEquals(2.95, loanDetails.getTransactions().get(4).getFeeChargesPortion());
|
||||||
assertEquals(0.0, loanDetails.getTransactions().get(4).getOutstandingLoanBalance());
|
assertEquals(0.0, loanDetails.getTransactions().get(4).getOutstandingLoanBalance());
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(requestSpec, responseSpec, "due-date");
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("due-date"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+15
-37
@@ -23,11 +23,6 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
|
|||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
import io.restassured.builder.RequestSpecBuilder;
|
|
||||||
import io.restassured.builder.ResponseSpecBuilder;
|
|
||||||
import io.restassured.http.ContentType;
|
|
||||||
import io.restassured.specification.RequestSpecification;
|
|
||||||
import io.restassured.specification.ResponseSpecification;
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
@@ -61,58 +56,36 @@ import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
|||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsTransactionIdRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsTransactionIdRequest;
|
||||||
import org.apache.fineract.client.models.PutChargeTransactionChangesRequest;
|
import org.apache.fineract.client.models.PutChargeTransactionChangesRequest;
|
||||||
import org.apache.fineract.client.models.PutChargeTransactionChangesResponse;
|
import org.apache.fineract.client.models.PutChargeTransactionChangesResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.client.models.PutLoansLoanIdChargesChargeIdRequest;
|
import org.apache.fineract.client.models.PutLoansLoanIdChargesChargeIdRequest;
|
||||||
import org.apache.fineract.client.models.PutLoansLoanIdChargesChargeIdResponse;
|
import org.apache.fineract.client.models.PutLoansLoanIdChargesChargeIdResponse;
|
||||||
import org.apache.fineract.client.models.PutLoansLoanIdRequest;
|
import org.apache.fineract.client.models.PutLoansLoanIdRequest;
|
||||||
import org.apache.fineract.client.models.PutLoansLoanIdResponse;
|
import org.apache.fineract.client.models.PutLoansLoanIdResponse;
|
||||||
import org.apache.fineract.client.util.CallFailedRuntimeException;
|
import org.apache.fineract.client.util.CallFailedRuntimeException;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
import org.apache.fineract.integrationtests.client.IntegrationTest;
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
|
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
|
||||||
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
|
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
|
||||||
import org.apache.fineract.integrationtests.common.products.DelinquencyRangesHelper;
|
import org.apache.fineract.integrationtests.common.products.DelinquencyRangesHelper;
|
||||||
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
|
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class ExternalIdSupportIntegrationTest extends BaseLoanIntegrationTest {
|
||||||
public class ExternalIdSupportIntegrationTest extends IntegrationTest {
|
|
||||||
|
|
||||||
private ResponseSpecification responseSpec;
|
|
||||||
private RequestSpecification requestSpec;
|
|
||||||
|
|
||||||
private ClientHelper clientHelper;
|
|
||||||
private AccountHelper accountHelper;
|
|
||||||
private LoanTransactionHelper loanTransactionHelper;
|
|
||||||
|
|
||||||
private DateTimeFormatter dateFormatter = new DateTimeFormatterBuilder().appendPattern("dd MMMM yyyy").toFormatter();
|
private DateTimeFormatter dateFormatter = new DateTimeFormatterBuilder().appendPattern("dd MMMM yyyy").toFormatter();
|
||||||
|
|
||||||
@BeforeAll
|
|
||||||
public void init() {
|
|
||||||
Utils.initializeRESTAssured();
|
|
||||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
|
||||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
|
||||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
|
||||||
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
|
||||||
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
|
|
||||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test() {
|
public void test() {
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(requestSpec, responseSpec, 50, true);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||||
final Account assetFeeAndPenaltyAccount = this.accountHelper.createAssetAccount();
|
final Account assetFeeAndPenaltyAccount = this.accountHelper.createAssetAccount();
|
||||||
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
||||||
@@ -691,7 +664,8 @@ public class ExternalIdSupportIntegrationTest extends IntegrationTest {
|
|||||||
response = loanTransactionHelper.getLoanTransactionDetails(loanExternalIdStr, payChargeExternalIdStr);
|
response = loanTransactionHelper.getLoanTransactionDetails(loanExternalIdStr, payChargeExternalIdStr);
|
||||||
assertEquals(payChargeExternalIdStr, response.getExternalId());
|
assertEquals(payChargeExternalIdStr, response.getExternalId());
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(requestSpec, responseSpec, 50, false);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -854,8 +828,10 @@ public class ExternalIdSupportIntegrationTest extends IntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void loan() {
|
public void loan() {
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(requestSpec, responseSpec, 50, true);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID,
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
new BusinessDateHelper().updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
new BusinessDateHelper().updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("2022.10.10").dateFormat("yyyy.MM.dd").locale("en"));
|
.date("2022.10.10").dateFormat("yyyy.MM.dd").locale("en"));
|
||||||
try {
|
try {
|
||||||
@@ -1105,8 +1081,10 @@ public class ExternalIdSupportIntegrationTest extends IntegrationTest {
|
|||||||
assertEquals(transactionExternalId3, chargeOffResult.getResourceExternalId());
|
assertEquals(transactionExternalId3, chargeOffResult.getResourceExternalId());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(requestSpec, responseSpec, 50, false);
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+14
-30
@@ -28,6 +28,8 @@ import io.restassured.specification.ResponseSpecification;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
||||||
@@ -52,6 +54,7 @@ public class FlexibleSavingsInterestPostingIntegrationTest {
|
|||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
private SavingsProductHelper savingsProductHelper;
|
private SavingsProductHelper savingsProductHelper;
|
||||||
private SavingsAccountHelper savingsAccountHelper;
|
private SavingsAccountHelper savingsAccountHelper;
|
||||||
|
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@@ -61,6 +64,7 @@ public class FlexibleSavingsInterestPostingIntegrationTest {
|
|||||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||||
this.savingsProductHelper = new SavingsProductHelper();
|
this.savingsProductHelper = new SavingsProductHelper();
|
||||||
|
this.globalConfigurationHelper = new GlobalConfigurationHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -71,7 +75,7 @@ public class FlexibleSavingsInterestPostingIntegrationTest {
|
|||||||
Assertions.assertNotNull(clientID);
|
Assertions.assertNotNull(clientID);
|
||||||
|
|
||||||
// Configuring global config flags
|
// Configuring global config flags
|
||||||
configureInterestPosting(true, 4);
|
configureInterestPosting(true, 4L);
|
||||||
|
|
||||||
final Integer savingsId = createSavingsAccount(clientID, startDate);
|
final Integer savingsId = createSavingsAccount(clientID, startDate);
|
||||||
|
|
||||||
@@ -108,36 +112,16 @@ public class FlexibleSavingsInterestPostingIntegrationTest {
|
|||||||
return savingsId;
|
return savingsId;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configureInterestPosting(final Boolean periodEndEnable, final Integer financialYearBeginningMonth) {
|
private void configureInterestPosting(final Boolean periodEndEnable, final Long financialYearBeginningMonth) {
|
||||||
final ArrayList<HashMap> globalConfig = GlobalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
|
|
||||||
Assertions.assertNotNull(globalConfig);
|
|
||||||
|
|
||||||
// Updating flag for interest posting at period end
|
// Updating flag for interest posting at period end
|
||||||
Integer periodEndConfigId = (Integer) globalConfig.get(10).get("id");
|
String periodEndConfigName = GlobalConfigurationConstants.SAVINGS_INTEREST_POSTING_CURRENT_PERIOD_END;
|
||||||
Assertions.assertNotNull(periodEndConfigId);
|
globalConfigurationHelper.updateGlobalConfiguration(periodEndConfigName,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(periodEndEnable));
|
||||||
HashMap periodEndConfigData = GlobalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
|
|
||||||
periodEndConfigId.toString());
|
|
||||||
Assertions.assertNotNull(periodEndConfigData);
|
|
||||||
|
|
||||||
Boolean enabled = (Boolean) globalConfig.get(10).get("enabled");
|
|
||||||
|
|
||||||
if (!enabled.equals(periodEndEnable)) {
|
|
||||||
periodEndConfigId = GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec,
|
|
||||||
periodEndConfigId.toString(), periodEndEnable);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Updating value for financial year beginning month
|
// Updating value for financial year beginning month
|
||||||
Integer financialYearBeginningConfigId = (Integer) globalConfig.get(11).get("id");
|
String financialYearBeginningConfigName = GlobalConfigurationConstants.FINANCIAL_YEAR_BEGINNING_MONTH;
|
||||||
Assertions.assertNotNull(financialYearBeginningConfigId);
|
globalConfigurationHelper.updateGlobalConfiguration(financialYearBeginningConfigName,
|
||||||
|
new PutGlobalConfigurationsRequest().value(financialYearBeginningMonth));
|
||||||
HashMap financialYearBeginningConfigData = GlobalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
|
|
||||||
financialYearBeginningConfigId.toString());
|
|
||||||
Assertions.assertNotNull(financialYearBeginningConfigData);
|
|
||||||
|
|
||||||
financialYearBeginningConfigId = GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec,
|
|
||||||
financialYearBeginningConfigId.toString(), financialYearBeginningMonth.toString());
|
|
||||||
Assertions.assertNotNull(financialYearBeginningConfigId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Integer createSavingsProduct() {
|
private Integer createSavingsProduct() {
|
||||||
@@ -149,8 +133,8 @@ public class FlexibleSavingsInterestPostingIntegrationTest {
|
|||||||
// Reset configuration fields
|
// Reset configuration fields
|
||||||
@AfterEach
|
@AfterEach
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.resetAllDefaultGlobalConfigurations();
|
||||||
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.verifyAllDefaultGlobalConfigurations();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
-79
@@ -1,79 +0,0 @@
|
|||||||
/**
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*/
|
|
||||||
package org.apache.fineract.integrationtests;
|
|
||||||
|
|
||||||
import io.restassured.builder.RequestSpecBuilder;
|
|
||||||
import io.restassured.builder.ResponseSpecBuilder;
|
|
||||||
import io.restassured.http.ContentType;
|
|
||||||
import io.restassured.specification.RequestSpecification;
|
|
||||||
import io.restassured.specification.ResponseSpecification;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
|
||||||
import org.junit.jupiter.api.AfterEach;
|
|
||||||
import org.junit.jupiter.api.Assertions;
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
|
|
||||||
public class GlobalConfigInterestChargedFromDateSameAsDisbursalDateTest {
|
|
||||||
|
|
||||||
private ResponseSpecification responseSpec;
|
|
||||||
private RequestSpecification requestSpec;
|
|
||||||
private GlobalConfigurationHelper globalConfigurationHelper;
|
|
||||||
|
|
||||||
@BeforeEach
|
|
||||||
public void setup() {
|
|
||||||
Utils.initializeRESTAssured();
|
|
||||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
|
||||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
|
||||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
|
||||||
}
|
|
||||||
|
|
||||||
@AfterEach
|
|
||||||
public void tearDown() {
|
|
||||||
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
|
||||||
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings({ "static-access", "rawtypes", "unchecked" })
|
|
||||||
@Test
|
|
||||||
public void testInterestChargedFromDateSameAsDisbursalDate() {
|
|
||||||
this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec);
|
|
||||||
|
|
||||||
// Retrieving All Global Configuration details
|
|
||||||
final ArrayList<HashMap> globalConfig = GlobalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
|
|
||||||
Assertions.assertNotNull(globalConfig);
|
|
||||||
|
|
||||||
String configName = "interest-charged-from-date-same-as-disbursal-date";
|
|
||||||
boolean newBooleanValue = true;
|
|
||||||
|
|
||||||
for (Integer configIndex = 0; configIndex < globalConfig.size(); configIndex++) {
|
|
||||||
if (globalConfig.get(configIndex).get("name").equals(configName)) {
|
|
||||||
String configId = globalConfig.get(configIndex).get("id").toString();
|
|
||||||
Integer updateConfigId = GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec,
|
|
||||||
this.responseSpec, configId.toString(), newBooleanValue);
|
|
||||||
Assertions.assertNotNull(updateConfigId);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
+46
-188
@@ -18,14 +18,20 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.integrationtests;
|
package org.apache.fineract.integrationtests;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
import io.restassured.builder.RequestSpecBuilder;
|
import io.restassured.builder.RequestSpecBuilder;
|
||||||
import io.restassured.builder.ResponseSpecBuilder;
|
import io.restassured.builder.ResponseSpecBuilder;
|
||||||
import io.restassured.http.ContentType;
|
import io.restassured.http.ContentType;
|
||||||
import io.restassured.specification.RequestSpecification;
|
import io.restassured.specification.RequestSpecification;
|
||||||
import io.restassured.specification.ResponseSpecification;
|
import io.restassured.specification.ResponseSpecification;
|
||||||
import java.util.ArrayList;
|
import org.apache.fineract.client.models.GetGlobalConfigurationsResponse;
|
||||||
import java.util.HashMap;
|
import org.apache.fineract.client.models.GlobalConfigurationPropertyData;
|
||||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
|
import org.apache.fineract.client.util.CallFailedRuntimeException;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.junit.jupiter.api.AfterEach;
|
import org.junit.jupiter.api.AfterEach;
|
||||||
@@ -40,7 +46,6 @@ public class GlobalConfigurationTest {
|
|||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
private GlobalConfigurationHelper globalConfigurationHelper;
|
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||||
private ResponseSpecification httpStatusForidden;
|
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@@ -48,205 +53,58 @@ public class GlobalConfigurationTest {
|
|||||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
this.httpStatusForidden = new ResponseSpecBuilder().expectStatusCode(403).build();
|
globalConfigurationHelper = new GlobalConfigurationHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterEach
|
@AfterEach
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.resetAllDefaultGlobalConfigurations();
|
||||||
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.verifyAllDefaultGlobalConfigurations();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGlobalConfigurations() {
|
public void testGlobalConfigurations() {
|
||||||
this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec);
|
|
||||||
|
|
||||||
// Retrieving All Global Configuration details
|
// Retrieving All Global Configuration details
|
||||||
final ArrayList<HashMap> globalConfig = GlobalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
|
final GetGlobalConfigurationsResponse globalConfig = globalConfigurationHelper.getAllGlobalConfigurations();
|
||||||
Assertions.assertNotNull(globalConfig);
|
Assertions.assertNotNull(globalConfig);
|
||||||
|
}
|
||||||
|
|
||||||
String configName = "penalty-wait-period";
|
@Test
|
||||||
for (Integer configIndex = 0; configIndex < globalConfig.size() - 1; configIndex++) {
|
public void testGlobalConfigurationUpdate() {
|
||||||
if (globalConfig.get(configIndex).get("name").equals(configName)) {
|
String configName = GlobalConfigurationConstants.PENALTY_WAIT_PERIOD;
|
||||||
Integer configId = (Integer) globalConfig.get(configIndex).get("id");
|
GlobalConfigurationPropertyData config = globalConfigurationHelper.getGlobalConfigurationByName(configName);
|
||||||
Assertions.assertNotNull(configId);
|
try {
|
||||||
|
Assertions.assertNotNull(config);
|
||||||
HashMap configDataBefore = GlobalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
|
Assertions.assertNotNull(config.getValue());
|
||||||
configId.toString());
|
Long newValue = config.getValue() + 1;
|
||||||
Assertions.assertNotNull(configDataBefore);
|
Assertions.assertNotNull(config.getEnabled());
|
||||||
|
// Updating Value for penalty-wait-period Global Configuration
|
||||||
Integer value = (Integer) configDataBefore.get("value") + 1;
|
boolean newEnabledValue = !config.getEnabled();
|
||||||
|
// Updating Enabled Flag for penalty-wait-period Global
|
||||||
// Updating Value for penalty-wait-period Global Configuration
|
// Configuration
|
||||||
configId = GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec,
|
globalConfigurationHelper.updateGlobalConfiguration(config.getName(),
|
||||||
configId.toString(), value.toString());
|
new PutGlobalConfigurationsRequest().value(newValue).enabled(newEnabledValue));
|
||||||
Assertions.assertNotNull(configId);
|
GlobalConfigurationPropertyData updatedConfiguration = globalConfigurationHelper.getGlobalConfigurationByName(configName);
|
||||||
|
// Verifying Value for penalty-wait-period after the update
|
||||||
HashMap configDataAfter = GlobalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
|
Assertions.assertEquals(newValue, updatedConfiguration.getValue(), "Verifying Global Config Value after the update");
|
||||||
configId.toString());
|
// Verifying Enabled Flag for penalty-wait-period after Updation
|
||||||
|
Assertions.assertEquals(newEnabledValue, updatedConfiguration.getEnabled(),
|
||||||
// Verifying Value for penalty-wait-period after Updation
|
"Verifying Enabled Flag Global Config after the update");
|
||||||
Assertions.assertEquals(value, configDataAfter.get("value"), "Verifying Global Config Value after Updation");
|
} finally {
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(config.getName(),
|
||||||
// Updating Enabled Flag for penalty-wait-period Global
|
new PutGlobalConfigurationsRequest().value(config.getValue()).enabled(config.getEnabled()));
|
||||||
// Configuration
|
|
||||||
Boolean enabled = (Boolean) globalConfig.get(configIndex).get("enabled");
|
|
||||||
|
|
||||||
if (enabled == true) {
|
|
||||||
enabled = false;
|
|
||||||
} else {
|
|
||||||
enabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
configId = GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec,
|
|
||||||
configId.toString(), enabled);
|
|
||||||
|
|
||||||
configDataAfter = GlobalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
|
|
||||||
configId.toString());
|
|
||||||
|
|
||||||
// Verifying Enabled Flag for penalty-wait-period after Updation
|
|
||||||
Assertions.assertEquals(enabled, configDataAfter.get("enabled"), "Verifying Enabled Flag Global Config after Updation");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGlobalConfigurationsEnableDisable() {
|
public void testPasswordUpdateFailing() {
|
||||||
this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec);
|
String configName = GlobalConfigurationConstants.FORCE_PASSWORD_RESET_DAYS;
|
||||||
|
GlobalConfigurationPropertyData config = globalConfigurationHelper.getGlobalConfigurationByName(configName);
|
||||||
|
Assertions.assertNotNull(config);
|
||||||
|
|
||||||
// Retrieving All Global Configuration details
|
CallFailedRuntimeException exception = assertThrows(CallFailedRuntimeException.class, () -> globalConfigurationHelper
|
||||||
final ArrayList<HashMap> globalConfig = GlobalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
|
.updateGlobalConfiguration(configName, new PutGlobalConfigurationsRequest().enabled(true).value(null)));
|
||||||
Assertions.assertNotNull(globalConfig);
|
assertEquals(403, exception.getResponse().code());
|
||||||
String configName = "enable_payment_hub_integration";
|
assertTrue(exception.getMessage().contains("error.msg.password.reset.days.value.must.be.greater.than.zero"));
|
||||||
for (Integer configIndex = 0; configIndex < globalConfig.size() - 1; configIndex++) {
|
|
||||||
if (globalConfig.get(configIndex).get("name").equals(configName)) {
|
|
||||||
Integer configId = (Integer) globalConfig.get(configIndex).get("id");
|
|
||||||
Assertions.assertNotNull(configId);
|
|
||||||
|
|
||||||
HashMap configDataBefore = GlobalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
|
|
||||||
configId.toString());
|
|
||||||
Assertions.assertNotNull(configDataBefore);
|
|
||||||
|
|
||||||
Integer value = (Integer) configDataBefore.get("value") + 1;
|
|
||||||
|
|
||||||
// Updating Enabled Flag for use-payment-hub Global
|
|
||||||
// Configuration
|
|
||||||
Boolean enabled = (Boolean) globalConfig.get(configIndex).get("enabled");
|
|
||||||
|
|
||||||
if (enabled == true) {
|
|
||||||
enabled = false;
|
|
||||||
} else {
|
|
||||||
enabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
configId = GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec,
|
|
||||||
configId.toString(), enabled);
|
|
||||||
|
|
||||||
HashMap configDataAfter = GlobalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
|
|
||||||
configId.toString());
|
|
||||||
|
|
||||||
// Verifying Enabled Flag for use-payment-hub after Updation
|
|
||||||
Assertions.assertEquals(enabled, configDataAfter.get("enabled"), "Verifying Enabled Flag Global Config after Updation");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testGlobalConfigurationIsCacheEnabled() {
|
|
||||||
this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec);
|
|
||||||
|
|
||||||
// Retrieving Is Cache Enabled Global Configuration details
|
|
||||||
ArrayList<HashMap> isCacheGlobalConfig = GlobalConfigurationHelper.getGlobalConfigurationIsCacheEnabled(this.requestSpec,
|
|
||||||
this.responseSpec);
|
|
||||||
Assertions.assertNotNull(isCacheGlobalConfig);
|
|
||||||
|
|
||||||
for (Integer cacheType = 0; cacheType <= isCacheGlobalConfig.size() - 1; cacheType++) {
|
|
||||||
|
|
||||||
// Retrieving Is Cache Enabled Global Configuration details
|
|
||||||
isCacheGlobalConfig = GlobalConfigurationHelper.getGlobalConfigurationIsCacheEnabled(this.requestSpec, this.responseSpec);
|
|
||||||
Assertions.assertNotNull(isCacheGlobalConfig);
|
|
||||||
|
|
||||||
HashMap cacheTypeAsHashMap = (HashMap) isCacheGlobalConfig.get(cacheType).get("cacheType");
|
|
||||||
Integer cacheTypeId = (Integer) cacheTypeAsHashMap.get("id");
|
|
||||||
String cacheTypeValue = (String) cacheTypeAsHashMap.get("value");
|
|
||||||
Boolean enabled = (Boolean) isCacheGlobalConfig.get(cacheType).get("enabled");
|
|
||||||
|
|
||||||
if (cacheTypeValue.compareTo("No cache") == 0 && enabled == true) {
|
|
||||||
cacheTypeId += 1;
|
|
||||||
} else if (cacheTypeValue.compareTo("Single node") == 0 && enabled == true) {
|
|
||||||
cacheTypeId -= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
HashMap changes = GlobalConfigurationHelper.updateIsCacheEnabledForGlobalConfiguration(this.requestSpec, this.responseSpec,
|
|
||||||
cacheTypeId.toString());
|
|
||||||
Assertions.assertEquals(cacheTypeId, changes.get("cacheType"), "Verifying Is Cache Enabled Global Config after Updation");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testGlobalConfigForcePasswordResetDays() {
|
|
||||||
|
|
||||||
// Retrieving All Global Configuration details
|
|
||||||
final ArrayList<HashMap> globalConfig = GlobalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
|
|
||||||
Assertions.assertNotNull(globalConfig);
|
|
||||||
|
|
||||||
String configName = "force-password-reset-days";
|
|
||||||
String newValue = "0";
|
|
||||||
String newBooleanValue = "true";
|
|
||||||
|
|
||||||
for (Integer configIndex = 0; configIndex < globalConfig.size() - 1; configIndex++) {
|
|
||||||
if (globalConfig.get(configIndex).get("name").equals(configName)) {
|
|
||||||
Integer configId = (Integer) globalConfig.get(configIndex).get("id");
|
|
||||||
Assertions.assertNotNull(configId);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Update force-password-reset-days with value as 0 and Enable as true - failure case
|
|
||||||
*/
|
|
||||||
ArrayList error = (ArrayList) GlobalConfigurationHelper.updatePasswordResetDaysForGlobalConfiguration(this.requestSpec,
|
|
||||||
this.httpStatusForidden, configId, newValue, newBooleanValue, CommonConstants.RESPONSE_ERROR);
|
|
||||||
HashMap hash = (HashMap) error.get(0);
|
|
||||||
|
|
||||||
Assertions.assertEquals("error.msg.password.reset.days.value.must.be.greater.than.zero",
|
|
||||||
hash.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE),
|
|
||||||
"Force Password Reset days value must be greater than zero.");
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Update force-password-reset-days with value as 50 and Enable as true - success case
|
|
||||||
*/
|
|
||||||
final HashMap updateSuccess = (HashMap) GlobalConfigurationHelper.updatePasswordResetDaysForGlobalConfiguration(
|
|
||||||
this.requestSpec, this.responseSpec, configId, "50", newBooleanValue, "changes");
|
|
||||||
Assertions.assertNotNull(updateSuccess);
|
|
||||||
|
|
||||||
/* Update with value as 0 and Enable as false - success case */
|
|
||||||
final HashMap updateSuccess1 = (HashMap) GlobalConfigurationHelper.updatePasswordResetDaysForGlobalConfiguration(
|
|
||||||
this.requestSpec, this.responseSpec, configId, newValue, "false", "changes");
|
|
||||||
Assertions.assertNotNull(updateSuccess1);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Update without sending value and Enable as true - failure case
|
|
||||||
*/
|
|
||||||
ArrayList failure = (ArrayList) GlobalConfigurationHelper.updatePasswordResetDaysForGlobalConfiguration(this.requestSpec,
|
|
||||||
this.httpStatusForidden, configId, null, newBooleanValue, CommonConstants.RESPONSE_ERROR);
|
|
||||||
HashMap failureHash = (HashMap) failure.get(0);
|
|
||||||
Assertions.assertEquals("error.msg.password.reset.days.value.must.be.greater.than.zero",
|
|
||||||
failureHash.get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE),
|
|
||||||
"Force Password Reset days value must be greater than zero.");
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* Update other global configuration property */
|
|
||||||
String otherConfigName = "maker-checker";
|
|
||||||
for (Integer configIndex = 0; configIndex < globalConfig.size() - 1; configIndex++) {
|
|
||||||
if (globalConfig.get(configIndex).get("name").equals(otherConfigName)) {
|
|
||||||
String configId = globalConfig.get(configIndex).get("id").toString();
|
|
||||||
Integer updateConfigId = GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec,
|
|
||||||
configId, newValue);
|
|
||||||
Assertions.assertNotNull(updateConfigId);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-14
@@ -28,41 +28,34 @@ import io.restassured.http.ContentType;
|
|||||||
import io.restassured.specification.RequestSpecification;
|
import io.restassured.specification.RequestSpecification;
|
||||||
import io.restassured.specification.ResponseSpecification;
|
import io.restassured.specification.ResponseSpecification;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.time.format.DateTimeFormatterBuilder;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import org.apache.fineract.client.models.GetDelinquencyBucketsResponse;
|
import org.apache.fineract.client.models.GetDelinquencyBucketsResponse;
|
||||||
import org.apache.fineract.client.models.GetLoanProductsProductIdResponse;
|
import org.apache.fineract.client.models.GetLoanProductsProductIdResponse;
|
||||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||||
import org.apache.fineract.client.models.GetLoansLoanIdSummary;
|
import org.apache.fineract.client.models.GetLoansLoanIdSummary;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.cob.data.JobBusinessStepConfigData;
|
import org.apache.fineract.cob.data.JobBusinessStepConfigData;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessStepConfigurationHelper;
|
import org.apache.fineract.integrationtests.common.BusinessStepConfigurationHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
|
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class LoanAccountArrearsAgeingCOBBusinessStepTest extends BaseLoanIntegrationTest {
|
||||||
public class LoanAccountArrearsAgeingCOBBusinessStepTest {
|
|
||||||
|
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
private ResponseSpecification responseSpecErr400;
|
|
||||||
private ResponseSpecification responseSpecErr503;
|
|
||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
private ClientHelper clientHelper;
|
private ClientHelper clientHelper;
|
||||||
private LoanTransactionHelper loanTransactionHelper;
|
private LoanTransactionHelper loanTransactionHelper;
|
||||||
private DateTimeFormatter dateFormatter = new DateTimeFormatterBuilder().appendPattern("dd MMMM yyyy").toFormatter();
|
|
||||||
public static final String UPDATE_LOAN_ARREARS_AGING = "UPDATE_LOAN_ARREARS_AGING";
|
public static final String UPDATE_LOAN_ARREARS_AGING = "UPDATE_LOAN_ARREARS_AGING";
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
@@ -71,8 +64,6 @@ public class LoanAccountArrearsAgeingCOBBusinessStepTest {
|
|||||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
this.responseSpecErr400 = new ResponseSpecBuilder().expectStatusCode(400).build();
|
|
||||||
this.responseSpecErr503 = new ResponseSpecBuilder().expectStatusCode(503).build();
|
|
||||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||||
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
||||||
}
|
}
|
||||||
@@ -81,7 +72,8 @@ public class LoanAccountArrearsAgeingCOBBusinessStepTest {
|
|||||||
public void loanArrearsAgeingCOBBusinessStepTest() {
|
public void loanArrearsAgeingCOBBusinessStepTest() {
|
||||||
// Set Business Date
|
// Set Business Date
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
LocalDate businessDate = Utils.getLocalDateOfTenant();
|
LocalDate businessDate = Utils.getLocalDateOfTenant();
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
||||||
@@ -148,7 +140,8 @@ public class LoanAccountArrearsAgeingCOBBusinessStepTest {
|
|||||||
assertEquals(loan2Summary.getPrincipalOverdue(), 1000.00);
|
assertEquals(loan2Summary.getPrincipalOverdue(), 1000.00);
|
||||||
assertEquals(loan2Summary.getTotalOverdue(), 1000.00);
|
assertEquals(loan2Summary.getTotalOverdue(), 1000.00);
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+23
-15
@@ -35,22 +35,20 @@ import org.apache.fineract.client.models.GetLoanProductsProductIdResponse;
|
|||||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class LoanAccountBackdatedDisbursementTest extends BaseLoanIntegrationTest {
|
||||||
public class LoanAccountBackdatedDisbursementTest {
|
|
||||||
|
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
@@ -74,7 +72,8 @@ public class LoanAccountBackdatedDisbursementTest {
|
|||||||
// Set business date
|
// Set business date
|
||||||
LocalDate businessDate = LocalDate.of(2023, 3, 3);
|
LocalDate businessDate = LocalDate.of(2023, 3, 3);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
||||||
|
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
@@ -282,7 +281,8 @@ public class LoanAccountBackdatedDisbursementTest {
|
|||||||
assertEquals(false, loanDetails.getRepaymentSchedule().getPeriods().get(6).getComplete());
|
assertEquals(false, loanDetails.getRepaymentSchedule().getPeriods().get(6).getComplete());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -293,7 +293,8 @@ public class LoanAccountBackdatedDisbursementTest {
|
|||||||
// Set business date
|
// Set business date
|
||||||
LocalDate businessDate = LocalDate.of(2023, 3, 3);
|
LocalDate businessDate = LocalDate.of(2023, 3, 3);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
||||||
|
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
@@ -494,7 +495,8 @@ public class LoanAccountBackdatedDisbursementTest {
|
|||||||
assertEquals(false, loanDetails.getRepaymentSchedule().getPeriods().get(6).getComplete());
|
assertEquals(false, loanDetails.getRepaymentSchedule().getPeriods().get(6).getComplete());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -505,7 +507,8 @@ public class LoanAccountBackdatedDisbursementTest {
|
|||||||
// Set business date
|
// Set business date
|
||||||
LocalDate businessDate = LocalDate.of(2023, 3, 3);
|
LocalDate businessDate = LocalDate.of(2023, 3, 3);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
||||||
|
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
@@ -758,7 +761,8 @@ public class LoanAccountBackdatedDisbursementTest {
|
|||||||
assertEquals(false, loanDetails.getRepaymentSchedule().getPeriods().get(6).getComplete());
|
assertEquals(false, loanDetails.getRepaymentSchedule().getPeriods().get(6).getComplete());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -771,7 +775,8 @@ public class LoanAccountBackdatedDisbursementTest {
|
|||||||
// Set business date
|
// Set business date
|
||||||
LocalDate businessDate = LocalDate.of(2023, 3, 3);
|
LocalDate businessDate = LocalDate.of(2023, 3, 3);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
||||||
|
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
@@ -864,7 +869,8 @@ public class LoanAccountBackdatedDisbursementTest {
|
|||||||
loanErrorData.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
loanErrorData.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -875,7 +881,8 @@ public class LoanAccountBackdatedDisbursementTest {
|
|||||||
// Set business date
|
// Set business date
|
||||||
LocalDate businessDate = LocalDate.of(2023, 3, 3);
|
LocalDate businessDate = LocalDate.of(2023, 3, 3);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
||||||
|
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
@@ -1053,7 +1060,8 @@ public class LoanAccountBackdatedDisbursementTest {
|
|||||||
assertEquals(333.34, loanDetails.getRepaymentSchedule().getPeriods().get(4).getTotalInstallmentAmountForPeriod());
|
assertEquals(333.34, loanDetails.getRepaymentSchedule().getPeriods().get(4).getTotalInstallmentAmountForPeriod());
|
||||||
assertEquals(false, loanDetails.getRepaymentSchedule().getPeriods().get(4).getComplete());
|
assertEquals(false, loanDetails.getRepaymentSchedule().getPeriods().get(4).getComplete());
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-60
@@ -18,9 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.integrationtests;
|
package org.apache.fineract.integrationtests;
|
||||||
|
|
||||||
import static java.lang.Boolean.FALSE;
|
|
||||||
import static java.lang.Boolean.TRUE;
|
|
||||||
import static org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType.BUSINESS_DATE;
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
@@ -34,19 +31,15 @@ import java.time.LocalDate;
|
|||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.time.format.DateTimeFormatterBuilder;
|
import java.time.format.DateTimeFormatterBuilder;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
import org.apache.fineract.client.models.AdvancedPaymentData;
|
import org.apache.fineract.client.models.AdvancedPaymentData;
|
||||||
import org.apache.fineract.client.models.AllowAttributeOverrides;
|
import org.apache.fineract.client.models.AllowAttributeOverrides;
|
||||||
import org.apache.fineract.client.models.BusinessDateRequest;
|
|
||||||
import org.apache.fineract.client.models.ChargeData;
|
import org.apache.fineract.client.models.ChargeData;
|
||||||
import org.apache.fineract.client.models.ChargeToGLAccountMapper;
|
import org.apache.fineract.client.models.ChargeToGLAccountMapper;
|
||||||
import org.apache.fineract.client.models.GetLoanFeeToIncomeAccountMappings;
|
import org.apache.fineract.client.models.GetLoanFeeToIncomeAccountMappings;
|
||||||
import org.apache.fineract.client.models.GetLoanPaymentChannelToFundSourceMappings;
|
import org.apache.fineract.client.models.GetLoanPaymentChannelToFundSourceMappings;
|
||||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||||
import org.apache.fineract.client.models.PaymentAllocationOrder;
|
|
||||||
import org.apache.fineract.client.models.PostLoanProductsRequest;
|
import org.apache.fineract.client.models.PostLoanProductsRequest;
|
||||||
import org.apache.fineract.client.models.PostLoanProductsResponse;
|
import org.apache.fineract.client.models.PostLoanProductsResponse;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
||||||
@@ -55,37 +48,30 @@ import org.apache.fineract.client.models.PostPaymentTypesRequest;
|
|||||||
import org.apache.fineract.client.models.PostPaymentTypesResponse;
|
import org.apache.fineract.client.models.PostPaymentTypesResponse;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.PaymentTypeHelper;
|
import org.apache.fineract.integrationtests.common.PaymentTypeHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.JournalEntryHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
||||||
import org.apache.fineract.integrationtests.common.funds.FundsHelper;
|
import org.apache.fineract.integrationtests.common.funds.FundsHelper;
|
||||||
import org.apache.fineract.integrationtests.common.funds.FundsResourceHandler;
|
import org.apache.fineract.integrationtests.common.funds.FundsResourceHandler;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductHelper;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
|
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
|
||||||
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleProcessingType;
|
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleProcessingType;
|
||||||
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleType;
|
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleType;
|
||||||
import org.apache.fineract.portfolio.loanproduct.domain.PaymentAllocationType;
|
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class LoanAccountChargeReveseReplayWithAdvancedPaymentAllocationTest extends BaseLoanIntegrationTest {
|
||||||
public class LoanAccountChargeReveseReplayWithAdvancedPaymentAllocationTest {
|
|
||||||
|
|
||||||
private static final DateTimeFormatter DATE_FORMATTER = new DateTimeFormatterBuilder().appendPattern("dd MMMM yyyy").toFormatter();
|
private static final DateTimeFormatter DATE_FORMATTER = new DateTimeFormatterBuilder().appendPattern("dd MMMM yyyy").toFormatter();
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
private ClientHelper clientHelper;
|
private ClientHelper clientHelper;
|
||||||
private LoanTransactionHelper loanTransactionHelper;
|
private LoanTransactionHelper loanTransactionHelper;
|
||||||
private JournalEntryHelper journalEntryHelper;
|
|
||||||
private AccountHelper accountHelper;
|
private AccountHelper accountHelper;
|
||||||
private LoanProductHelper loanProductHelper;
|
private LoanProductHelper loanProductHelper;
|
||||||
private PaymentTypeHelper paymentTypeHelper;
|
private PaymentTypeHelper paymentTypeHelper;
|
||||||
@@ -145,7 +131,6 @@ public class LoanAccountChargeReveseReplayWithAdvancedPaymentAllocationTest {
|
|||||||
this.writtenOff = this.accountHelper.createExpenseAccount();
|
this.writtenOff = this.accountHelper.createExpenseAccount();
|
||||||
this.goodwillExpenseAccount = this.accountHelper.createExpenseAccount();
|
this.goodwillExpenseAccount = this.accountHelper.createExpenseAccount();
|
||||||
|
|
||||||
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
|
|
||||||
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -516,48 +501,4 @@ public class LoanAccountChargeReveseReplayWithAdvancedPaymentAllocationTest {
|
|||||||
|
|
||||||
return Long.valueOf(fundId);
|
return Long.valueOf(fundId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private AdvancedPaymentData createDefaultPaymentAllocation(String futureInstallmentAllocationRule) {
|
|
||||||
AdvancedPaymentData advancedPaymentData = new AdvancedPaymentData();
|
|
||||||
advancedPaymentData.setTransactionType("DEFAULT");
|
|
||||||
advancedPaymentData.setFutureInstallmentAllocationRule(futureInstallmentAllocationRule);
|
|
||||||
|
|
||||||
List<PaymentAllocationOrder> paymentAllocationOrders = getPaymentAllocationOrder(PaymentAllocationType.PAST_DUE_PENALTY,
|
|
||||||
PaymentAllocationType.PAST_DUE_FEE, PaymentAllocationType.PAST_DUE_PRINCIPAL, PaymentAllocationType.PAST_DUE_INTEREST,
|
|
||||||
PaymentAllocationType.DUE_PENALTY, PaymentAllocationType.DUE_FEE, PaymentAllocationType.DUE_PRINCIPAL,
|
|
||||||
PaymentAllocationType.DUE_INTEREST, PaymentAllocationType.IN_ADVANCE_PENALTY, PaymentAllocationType.IN_ADVANCE_FEE,
|
|
||||||
PaymentAllocationType.IN_ADVANCE_PRINCIPAL, PaymentAllocationType.IN_ADVANCE_INTEREST);
|
|
||||||
|
|
||||||
advancedPaymentData.setPaymentAllocationOrder(paymentAllocationOrders);
|
|
||||||
return advancedPaymentData;
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<PaymentAllocationOrder> getPaymentAllocationOrder(PaymentAllocationType... paymentAllocationTypes) {
|
|
||||||
AtomicInteger integer = new AtomicInteger(1);
|
|
||||||
return Arrays.stream(paymentAllocationTypes).map(pat -> {
|
|
||||||
PaymentAllocationOrder paymentAllocationOrder = new PaymentAllocationOrder();
|
|
||||||
paymentAllocationOrder.setPaymentAllocationRule(pat.name());
|
|
||||||
paymentAllocationOrder.setOrder(integer.getAndIncrement());
|
|
||||||
return paymentAllocationOrder;
|
|
||||||
}).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void runAt(String date, Runnable runnable) {
|
|
||||||
try {
|
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(requestSpec, responseSpec, 42, true);
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, TRUE);
|
|
||||||
businessDateHelper.updateBusinessDate(
|
|
||||||
new BusinessDateRequest().type(BUSINESS_DATE.getName()).date(date).dateFormat(DATETIME_PATTERN).locale("en"));
|
|
||||||
runnable.run();
|
|
||||||
} finally {
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, FALSE);
|
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(requestSpec, responseSpec, 42, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateBusinessDate(String date) {
|
|
||||||
businessDateHelper.updateBusinessDate(
|
|
||||||
new BusinessDateRequest().type(BUSINESS_DATE.getName()).date(date).dateFormat(DATETIME_PATTERN).locale("en"));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-7
@@ -37,22 +37,20 @@ import org.apache.fineract.client.models.GetLoanProductsProductIdResponse;
|
|||||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
|
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class LoanAccountOverpaidDateStatusTest extends BaseLoanIntegrationTest {
|
||||||
public class LoanAccountOverpaidDateStatusTest {
|
|
||||||
|
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
@@ -75,7 +73,8 @@ public class LoanAccountOverpaidDateStatusTest {
|
|||||||
try {
|
try {
|
||||||
final LocalDate todaysDate = Utils.getLocalDateOfTenant();
|
final LocalDate todaysDate = Utils.getLocalDateOfTenant();
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, todaysDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, todaysDate);
|
||||||
|
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
@@ -159,7 +158,8 @@ public class LoanAccountOverpaidDateStatusTest {
|
|||||||
assertNotNull(loanDetailsOverpaid_3.getOverpaidOnDate());
|
assertNotNull(loanDetailsOverpaid_3.getOverpaidOnDate());
|
||||||
assertEquals(loanDetailsOverpaid_3.getOverpaidOnDate(), LocalDate.of(2022, 9, 14));
|
assertEquals(loanDetailsOverpaid_3.getOverpaidOnDate(), LocalDate.of(2022, 9, 14));
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-43
@@ -32,37 +32,30 @@ import java.time.LocalDate;
|
|||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.time.format.DateTimeFormatterBuilder;
|
import java.time.format.DateTimeFormatterBuilder;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
import org.apache.fineract.client.models.AdvancedPaymentData;
|
import org.apache.fineract.client.models.AdvancedPaymentData;
|
||||||
import org.apache.fineract.client.models.GetLoanProductsProductIdResponse;
|
import org.apache.fineract.client.models.GetLoanProductsProductIdResponse;
|
||||||
import org.apache.fineract.client.models.GetLoansLoanIdRepaymentPeriod;
|
import org.apache.fineract.client.models.GetLoansLoanIdRepaymentPeriod;
|
||||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||||
import org.apache.fineract.client.models.PaymentAllocationOrder;
|
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleType;
|
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleType;
|
||||||
import org.apache.fineract.portfolio.loanproduct.domain.PaymentAllocationType;
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class LoanAccountPaymentAllocationWithOverlappingDownPaymentInstallmentTest extends BaseLoanIntegrationTest {
|
||||||
public class LoanAccountPaymentAllocationWithOverlappingDownPaymentInstallmentTest {
|
|
||||||
|
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
@@ -93,7 +86,8 @@ public class LoanAccountPaymentAllocationWithOverlappingDownPaymentInstallmentTe
|
|||||||
// Set business date
|
// Set business date
|
||||||
LocalDate disbursementDate = LocalDate.of(2023, 3, 3);
|
LocalDate disbursementDate = LocalDate.of(2023, 3, 3);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, disbursementDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, disbursementDate);
|
||||||
|
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
@@ -245,7 +239,8 @@ public class LoanAccountPaymentAllocationWithOverlappingDownPaymentInstallmentTe
|
|||||||
false, LocalDate.of(2023, 4, 3), LocalDate.of(2023, 5, 3));
|
false, LocalDate.of(2023, 4, 3), LocalDate.of(2023, 5, 3));
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -264,7 +259,8 @@ public class LoanAccountPaymentAllocationWithOverlappingDownPaymentInstallmentTe
|
|||||||
// Set business date
|
// Set business date
|
||||||
LocalDate disbursementDate = LocalDate.of(2023, 3, 3);
|
LocalDate disbursementDate = LocalDate.of(2023, 3, 3);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, disbursementDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, disbursementDate);
|
||||||
|
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
@@ -421,7 +417,8 @@ public class LoanAccountPaymentAllocationWithOverlappingDownPaymentInstallmentTe
|
|||||||
false, LocalDate.of(2023, 4, 3), LocalDate.of(2023, 5, 3));
|
false, LocalDate.of(2023, 4, 3), LocalDate.of(2023, 5, 3));
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -438,7 +435,8 @@ public class LoanAccountPaymentAllocationWithOverlappingDownPaymentInstallmentTe
|
|||||||
// Set business date
|
// Set business date
|
||||||
LocalDate disbursementDate = LocalDate.of(2023, 3, 3);
|
LocalDate disbursementDate = LocalDate.of(2023, 3, 3);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, disbursementDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, disbursementDate);
|
||||||
|
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
@@ -613,7 +611,8 @@ public class LoanAccountPaymentAllocationWithOverlappingDownPaymentInstallmentTe
|
|||||||
false, LocalDate.of(2023, 4, 3), LocalDate.of(2023, 5, 3));
|
false, LocalDate.of(2023, 4, 3), LocalDate.of(2023, 5, 3));
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -631,7 +630,8 @@ public class LoanAccountPaymentAllocationWithOverlappingDownPaymentInstallmentTe
|
|||||||
// Set business date
|
// Set business date
|
||||||
LocalDate disbursementDate = LocalDate.of(2023, 3, 3);
|
LocalDate disbursementDate = LocalDate.of(2023, 3, 3);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, disbursementDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, disbursementDate);
|
||||||
|
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
@@ -809,7 +809,8 @@ public class LoanAccountPaymentAllocationWithOverlappingDownPaymentInstallmentTe
|
|||||||
false, LocalDate.of(2023, 4, 3), LocalDate.of(2023, 5, 3));
|
false, LocalDate.of(2023, 4, 3), LocalDate.of(2023, 5, 3));
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -881,31 +882,6 @@ public class LoanAccountPaymentAllocationWithOverlappingDownPaymentInstallmentTe
|
|||||||
return loanTransactionHelper.getLoanProduct(loanProductId);
|
return loanTransactionHelper.getLoanProduct(loanProductId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private AdvancedPaymentData createDefaultPaymentAllocation(String futureInstallmentAllocationRule) {
|
|
||||||
AdvancedPaymentData advancedPaymentData = new AdvancedPaymentData();
|
|
||||||
advancedPaymentData.setTransactionType("DEFAULT");
|
|
||||||
advancedPaymentData.setFutureInstallmentAllocationRule(futureInstallmentAllocationRule);
|
|
||||||
|
|
||||||
List<PaymentAllocationOrder> paymentAllocationOrders = getPaymentAllocationOrder(PaymentAllocationType.PAST_DUE_PENALTY,
|
|
||||||
PaymentAllocationType.PAST_DUE_FEE, PaymentAllocationType.PAST_DUE_PRINCIPAL, PaymentAllocationType.PAST_DUE_INTEREST,
|
|
||||||
PaymentAllocationType.DUE_PENALTY, PaymentAllocationType.DUE_FEE, PaymentAllocationType.DUE_PRINCIPAL,
|
|
||||||
PaymentAllocationType.DUE_INTEREST, PaymentAllocationType.IN_ADVANCE_PENALTY, PaymentAllocationType.IN_ADVANCE_FEE,
|
|
||||||
PaymentAllocationType.IN_ADVANCE_PRINCIPAL, PaymentAllocationType.IN_ADVANCE_INTEREST);
|
|
||||||
|
|
||||||
advancedPaymentData.setPaymentAllocationOrder(paymentAllocationOrders);
|
|
||||||
return advancedPaymentData;
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<PaymentAllocationOrder> getPaymentAllocationOrder(PaymentAllocationType... paymentAllocationTypes) {
|
|
||||||
AtomicInteger integer = new AtomicInteger(1);
|
|
||||||
return Arrays.stream(paymentAllocationTypes).map(pat -> {
|
|
||||||
PaymentAllocationOrder paymentAllocationOrder = new PaymentAllocationOrder();
|
|
||||||
paymentAllocationOrder.setPaymentAllocationRule(pat.name());
|
|
||||||
paymentAllocationOrder.setOrder(integer.getAndIncrement());
|
|
||||||
return paymentAllocationOrder;
|
|
||||||
}).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void checkDownPaymentTransaction(final LocalDate transactionDate, final Float principalPortion, final Float interestPortion,
|
private void checkDownPaymentTransaction(final LocalDate transactionDate, final Float principalPortion, final Float interestPortion,
|
||||||
final Float feePortion, final Float penaltyPortion, final Integer loanID) {
|
final Float feePortion, final Float penaltyPortion, final Integer loanID) {
|
||||||
ArrayList<HashMap> transactions = (ArrayList<HashMap>) loanTransactionHelper.getLoanTransactions(this.requestSpec,
|
ArrayList<HashMap> transactions = (ArrayList<HashMap>) loanTransactionHelper.getLoanTransactions(this.requestSpec,
|
||||||
|
|||||||
+19
-13
@@ -32,21 +32,19 @@ import java.util.UUID;
|
|||||||
import org.apache.fineract.client.models.GetLoanProductsProductIdResponse;
|
import org.apache.fineract.client.models.GetLoanProductsProductIdResponse;
|
||||||
import org.apache.fineract.client.models.GetLoansLoanIdRepaymentPeriod;
|
import org.apache.fineract.client.models.GetLoansLoanIdRepaymentPeriod;
|
||||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class LoanAccountRepaymentCalculationTest extends BaseLoanIntegrationTest {
|
||||||
public class LoanAccountRepaymentCalculationTest {
|
|
||||||
|
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
@@ -70,7 +68,8 @@ public class LoanAccountRepaymentCalculationTest {
|
|||||||
// Set business date
|
// Set business date
|
||||||
LocalDate disbursementDate = LocalDate.of(2023, 3, 3);
|
LocalDate disbursementDate = LocalDate.of(2023, 3, 3);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, disbursementDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, disbursementDate);
|
||||||
|
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
@@ -151,7 +150,8 @@ public class LoanAccountRepaymentCalculationTest {
|
|||||||
LocalDate.of(2023, 6, 3), false);
|
LocalDate.of(2023, 6, 3), false);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -163,7 +163,8 @@ public class LoanAccountRepaymentCalculationTest {
|
|||||||
// Set business date
|
// Set business date
|
||||||
LocalDate disbursementDate = LocalDate.of(2023, 3, 3);
|
LocalDate disbursementDate = LocalDate.of(2023, 3, 3);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, disbursementDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, disbursementDate);
|
||||||
|
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
@@ -244,7 +245,8 @@ public class LoanAccountRepaymentCalculationTest {
|
|||||||
LocalDate.of(2023, 6, 3), false);
|
LocalDate.of(2023, 6, 3), false);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -256,7 +258,8 @@ public class LoanAccountRepaymentCalculationTest {
|
|||||||
// Set business date
|
// Set business date
|
||||||
LocalDate disbursementDate = LocalDate.of(2023, 3, 3);
|
LocalDate disbursementDate = LocalDate.of(2023, 3, 3);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, disbursementDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, disbursementDate);
|
||||||
|
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
@@ -322,7 +325,8 @@ public class LoanAccountRepaymentCalculationTest {
|
|||||||
LocalDate.of(2023, 6, 3), false);
|
LocalDate.of(2023, 6, 3), false);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -334,7 +338,8 @@ public class LoanAccountRepaymentCalculationTest {
|
|||||||
// Set business date
|
// Set business date
|
||||||
LocalDate disbursementDate = LocalDate.of(2023, 3, 3);
|
LocalDate disbursementDate = LocalDate.of(2023, 3, 3);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, disbursementDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, disbursementDate);
|
||||||
|
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
@@ -400,7 +405,8 @@ public class LoanAccountRepaymentCalculationTest {
|
|||||||
LocalDate.of(2023, 6, 3), false);
|
LocalDate.of(2023, 6, 3), false);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-6
@@ -28,8 +28,8 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.fineract.client.models.GetClientsClientIdAccountsResponse;
|
import org.apache.fineract.client.models.GetClientsClientIdAccountsResponse;
|
||||||
import org.apache.fineract.client.models.GetClientsLoanAccounts;
|
import org.apache.fineract.client.models.GetClientsLoanAccounts;
|
||||||
import org.apache.fineract.client.models.PostClientsResponse;
|
import org.apache.fineract.client.models.PostClientsResponse;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
@@ -41,7 +41,7 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class LoanAccountsContainsCurrencyFieldTest {
|
public class LoanAccountsContainsCurrencyFieldTest extends BaseLoanIntegrationTest {
|
||||||
|
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
@@ -65,8 +65,7 @@ public class LoanAccountsContainsCurrencyFieldTest {
|
|||||||
String formattedDate = "01 September 2022";
|
String formattedDate = "01 September 2022";
|
||||||
|
|
||||||
// given
|
// given
|
||||||
GlobalConfigurationHelper.manageConfigurations(requestSpec, responseSpec,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
final String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON,
|
final String jsonPayload = ClientHelper.getBasicClientAsJSON(ClientHelper.DEFAULT_OFFICE_ID, ClientHelper.LEGALFORM_ID_PERSON,
|
||||||
null);
|
null);
|
||||||
// when
|
// when
|
||||||
@@ -74,8 +73,7 @@ public class LoanAccountsContainsCurrencyFieldTest {
|
|||||||
final String clientExternalId = clientResponse.getResourceExternalId();
|
final String clientExternalId = clientResponse.getResourceExternalId();
|
||||||
final long clientId = clientResponse.getClientId();
|
final long clientId = clientResponse.getClientId();
|
||||||
|
|
||||||
GlobalConfigurationHelper.manageConfigurations(requestSpec, responseSpec,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, false);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, false);
|
|
||||||
|
|
||||||
Integer loanProductId = createLoanProduct(false, NONE);
|
Integer loanProductId = createLoanProduct(false, NONE);
|
||||||
|
|
||||||
|
|||||||
+70
-41
@@ -40,11 +40,12 @@ import org.apache.fineract.client.models.GetLoansLoanIdRepaymentPeriod;
|
|||||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.LoanRescheduleRequestHelper;
|
import org.apache.fineract.integrationtests.common.LoanRescheduleRequestHelper;
|
||||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
@@ -60,7 +61,7 @@ import org.apache.fineract.integrationtests.inlinecob.InlineLoanCOBHelper;
|
|||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
public class LoanAccrualTransactionOnChargeSubmittedDateTest {
|
public class LoanAccrualTransactionOnChargeSubmittedDateTest extends BaseLoanIntegrationTest {
|
||||||
|
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
@@ -98,12 +99,14 @@ public class LoanAccrualTransactionOnChargeSubmittedDateTest {
|
|||||||
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
|
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
|
||||||
|
|
||||||
// Set business date
|
// Set business date
|
||||||
LocalDate currentDate = LocalDate.of(2023, 03, 3);
|
LocalDate currentDate = LocalDate.of(2023, 3, 3);
|
||||||
final String accrualRunTillDate = dateFormatter.format(currentDate);
|
final String accrualRunTillDate = dateFormatter.format(currentDate);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(this.requestSpec, this.responseSpec, "submitted-date");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("submitted-date"));
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
String loanExternalIdStr = UUID.randomUUID().toString();
|
String loanExternalIdStr = UUID.randomUUID().toString();
|
||||||
|
|
||||||
@@ -146,7 +149,7 @@ public class LoanAccrualTransactionOnChargeSubmittedDateTest {
|
|||||||
checkAccrualTransaction(currentDate, 0.0f, 10.0f, 10.0f, loanId);
|
checkAccrualTransaction(currentDate, 0.0f, 10.0f, 10.0f, loanId);
|
||||||
|
|
||||||
// Set business date
|
// Set business date
|
||||||
LocalDate futureDate = LocalDate.of(2023, 03, 4);
|
LocalDate futureDate = LocalDate.of(2023, 3, 4);
|
||||||
final String nextAccrualRunDate = dateFormatter.format(futureDate);
|
final String nextAccrualRunDate = dateFormatter.format(futureDate);
|
||||||
|
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, futureDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, futureDate);
|
||||||
@@ -174,8 +177,10 @@ public class LoanAccrualTransactionOnChargeSubmittedDateTest {
|
|||||||
checkAccrualTransaction(futureDate, 0.0f, 10.0f, 0.0f, loanId);
|
checkAccrualTransaction(futureDate, 0.0f, 10.0f, 0.0f, loanId);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(this.requestSpec, this.responseSpec, "due-date");
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("due-date"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -192,12 +197,14 @@ public class LoanAccrualTransactionOnChargeSubmittedDateTest {
|
|||||||
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
|
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
|
||||||
|
|
||||||
// Set business date
|
// Set business date
|
||||||
LocalDate currentDate = LocalDate.of(2023, 03, 3);
|
LocalDate currentDate = LocalDate.of(2023, 3, 3);
|
||||||
final String accrualRunTillDate = dateFormatter.format(currentDate);
|
final String accrualRunTillDate = dateFormatter.format(currentDate);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(this.requestSpec, this.responseSpec, "submitted-date");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("submitted-date"));
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
String loanExternalIdStr = UUID.randomUUID().toString();
|
String loanExternalIdStr = UUID.randomUUID().toString();
|
||||||
|
|
||||||
@@ -241,7 +248,7 @@ public class LoanAccrualTransactionOnChargeSubmittedDateTest {
|
|||||||
checkAccrualTransaction(currentDate, 0.0f, 10.0f, 10.0f, loanId);
|
checkAccrualTransaction(currentDate, 0.0f, 10.0f, 10.0f, loanId);
|
||||||
|
|
||||||
// Set business date
|
// Set business date
|
||||||
LocalDate futureDate = LocalDate.of(2023, 03, 4);
|
LocalDate futureDate = LocalDate.of(2023, 3, 4);
|
||||||
final String nextAccrualRunDate = dateFormatter.format(futureDate);
|
final String nextAccrualRunDate = dateFormatter.format(futureDate);
|
||||||
|
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, futureDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, futureDate);
|
||||||
@@ -269,8 +276,10 @@ public class LoanAccrualTransactionOnChargeSubmittedDateTest {
|
|||||||
checkAccrualTransaction(futureDate, 0.0f, 10.0f, 0.0f, loanId);
|
checkAccrualTransaction(futureDate, 0.0f, 10.0f, 0.0f, loanId);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(this.requestSpec, this.responseSpec, "due-date");
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("due-date"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,12 +295,14 @@ public class LoanAccrualTransactionOnChargeSubmittedDateTest {
|
|||||||
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
|
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
|
||||||
|
|
||||||
// Set business date
|
// Set business date
|
||||||
LocalDate currentDate = LocalDate.of(2023, 03, 3);
|
LocalDate currentDate = LocalDate.of(2023, 3, 3);
|
||||||
final String accrualRunTillDate = dateFormatter.format(currentDate);
|
final String accrualRunTillDate = dateFormatter.format(currentDate);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(this.requestSpec, this.responseSpec, "submitted-date");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("submitted-date"));
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
String loanExternalIdStr = UUID.randomUUID().toString();
|
String loanExternalIdStr = UUID.randomUUID().toString();
|
||||||
|
|
||||||
@@ -337,7 +348,7 @@ public class LoanAccrualTransactionOnChargeSubmittedDateTest {
|
|||||||
checkAccrualTransaction(currentDate, 0.0f, 10.0f, 10.0f, loanId);
|
checkAccrualTransaction(currentDate, 0.0f, 10.0f, 10.0f, loanId);
|
||||||
|
|
||||||
// Set business date
|
// Set business date
|
||||||
LocalDate futureDate = LocalDate.of(2023, 03, 4);
|
LocalDate futureDate = LocalDate.of(2023, 3, 4);
|
||||||
final String nextAccrualRunDate = dateFormatter.format(futureDate);
|
final String nextAccrualRunDate = dateFormatter.format(futureDate);
|
||||||
|
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, futureDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, futureDate);
|
||||||
@@ -366,8 +377,10 @@ public class LoanAccrualTransactionOnChargeSubmittedDateTest {
|
|||||||
checkAccrualTransaction(futureDate, 0.0f, 10.0f, 0.0f, loanId);
|
checkAccrualTransaction(futureDate, 0.0f, 10.0f, 0.0f, loanId);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(this.requestSpec, this.responseSpec, "due-date");
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("due-date"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -383,12 +396,14 @@ public class LoanAccrualTransactionOnChargeSubmittedDateTest {
|
|||||||
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
|
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
|
||||||
|
|
||||||
// Set business date
|
// Set business date
|
||||||
LocalDate currentDate = LocalDate.of(2023, 03, 3);
|
LocalDate currentDate = LocalDate.of(2023, 3, 3);
|
||||||
final String accrualRunTillDate = dateFormatter.format(currentDate);
|
final String accrualRunTillDate = dateFormatter.format(currentDate);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(this.requestSpec, this.responseSpec, "submitted-date");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("submitted-date"));
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
String loanExternalIdStr = UUID.randomUUID().toString();
|
String loanExternalIdStr = UUID.randomUUID().toString();
|
||||||
|
|
||||||
@@ -432,7 +447,7 @@ public class LoanAccrualTransactionOnChargeSubmittedDateTest {
|
|||||||
checkAccrualTransaction(currentDate, 0.0f, 10.0f, 10.0f, loanId);
|
checkAccrualTransaction(currentDate, 0.0f, 10.0f, 10.0f, loanId);
|
||||||
|
|
||||||
// Set business date
|
// Set business date
|
||||||
LocalDate futureDate = LocalDate.of(2023, 03, 4);
|
LocalDate futureDate = LocalDate.of(2023, 3, 4);
|
||||||
final String nextAccrualRunDate = dateFormatter.format(futureDate);
|
final String nextAccrualRunDate = dateFormatter.format(futureDate);
|
||||||
|
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, futureDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, futureDate);
|
||||||
@@ -460,8 +475,10 @@ public class LoanAccrualTransactionOnChargeSubmittedDateTest {
|
|||||||
checkAccrualTransaction(futureDate, 0.0f, 10.0f, 0.0f, loanId);
|
checkAccrualTransaction(futureDate, 0.0f, 10.0f, 0.0f, loanId);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(this.requestSpec, this.responseSpec, "due-date");
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("due-date"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -477,12 +494,14 @@ public class LoanAccrualTransactionOnChargeSubmittedDateTest {
|
|||||||
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
|
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
|
||||||
|
|
||||||
// Set business date
|
// Set business date
|
||||||
LocalDate currentDate = LocalDate.of(2023, 03, 3);
|
LocalDate currentDate = LocalDate.of(2023, 3, 3);
|
||||||
final String accrualRunTillDate = dateFormatter.format(currentDate);
|
final String accrualRunTillDate = dateFormatter.format(currentDate);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(this.requestSpec, this.responseSpec, "submitted-date");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("submitted-date"));
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
String loanExternalIdStr = UUID.randomUUID().toString();
|
String loanExternalIdStr = UUID.randomUUID().toString();
|
||||||
|
|
||||||
@@ -529,8 +548,10 @@ public class LoanAccrualTransactionOnChargeSubmittedDateTest {
|
|||||||
checkAccrualTransactionsForMultipleRepaymentSchedulesChargeDueDate(currentDate, loanId);
|
checkAccrualTransactionsForMultipleRepaymentSchedulesChargeDueDate(currentDate, loanId);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(this.requestSpec, this.responseSpec, "due-date");
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("due-date"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -546,11 +567,13 @@ public class LoanAccrualTransactionOnChargeSubmittedDateTest {
|
|||||||
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
|
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
|
||||||
|
|
||||||
// Set business date
|
// Set business date
|
||||||
LocalDate currentDate = LocalDate.of(2023, 03, 3);
|
LocalDate currentDate = LocalDate.of(2023, 3, 3);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(this.requestSpec, this.responseSpec, "submitted-date");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("submitted-date"));
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
String loanExternalIdStr = UUID.randomUUID().toString();
|
String loanExternalIdStr = UUID.randomUUID().toString();
|
||||||
|
|
||||||
@@ -588,7 +611,7 @@ public class LoanAccrualTransactionOnChargeSubmittedDateTest {
|
|||||||
checkAccrualTransaction(currentDate, 0.0f, 0.0f, 10.0f, loanId);
|
checkAccrualTransaction(currentDate, 0.0f, 0.0f, 10.0f, loanId);
|
||||||
|
|
||||||
// Set business date
|
// Set business date
|
||||||
LocalDate futureDate = LocalDate.of(2023, 03, 4);
|
LocalDate futureDate = LocalDate.of(2023, 3, 4);
|
||||||
|
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, futureDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, futureDate);
|
||||||
|
|
||||||
@@ -599,8 +622,10 @@ public class LoanAccrualTransactionOnChargeSubmittedDateTest {
|
|||||||
checkAccrualTransaction(currentDate, 0.0f, 0.0f, 10.0f, loanId);
|
checkAccrualTransaction(currentDate, 0.0f, 0.0f, 10.0f, loanId);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(this.requestSpec, this.responseSpec, "due-date");
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("due-date"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -617,9 +642,11 @@ public class LoanAccrualTransactionOnChargeSubmittedDateTest {
|
|||||||
// Set business date
|
// Set business date
|
||||||
LocalDate currentDate = LocalDate.of(2023, 05, 19);
|
LocalDate currentDate = LocalDate.of(2023, 05, 19);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(this.requestSpec, this.responseSpec, "submitted-date");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("submitted-date"));
|
||||||
|
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
String loanExternalIdStr = UUID.randomUUID().toString();
|
String loanExternalIdStr = UUID.randomUUID().toString();
|
||||||
@@ -721,8 +748,10 @@ public class LoanAccrualTransactionOnChargeSubmittedDateTest {
|
|||||||
verifyPeriodDates(periods);
|
verifyPeriodDates(periods);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(this.requestSpec, this.responseSpec, "due-date");
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("due-date"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -37,11 +37,12 @@ import org.apache.fineract.client.models.GetDelinquencyBucketsResponse;
|
|||||||
import org.apache.fineract.client.models.GetLoanProductsProductIdResponse;
|
import org.apache.fineract.client.models.GetLoanProductsProductIdResponse;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
||||||
@@ -49,15 +50,12 @@ import org.apache.fineract.integrationtests.common.accounting.PeriodicAccrualAcc
|
|||||||
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
|
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class LoanAccrualTransactionReversalTest extends BaseLoanIntegrationTest {
|
||||||
public class LoanAccrualTransactionReversalTest {
|
|
||||||
|
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
@@ -142,7 +140,8 @@ public class LoanAccrualTransactionReversalTest {
|
|||||||
LocalDate currentDate = LocalDate.of(2022, 05, 8);
|
LocalDate currentDate = LocalDate.of(2022, 05, 8);
|
||||||
final String accrualRunTillDate = dateFormatter.format(currentDate);
|
final String accrualRunTillDate = dateFormatter.format(currentDate);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
||||||
|
|
||||||
// Accounts oof periodic accrual
|
// Accounts oof periodic accrual
|
||||||
@@ -176,7 +175,8 @@ public class LoanAccrualTransactionReversalTest {
|
|||||||
// check previous accrual is reversed and new accrual created for same date and different amount.
|
// check previous accrual is reversed and new accrual created for same date and different amount.
|
||||||
checkAccrualTransaction(currentDate, 0.71f, 0.0f, 0.0f, loanId);
|
checkAccrualTransaction(currentDate, 0.71f, 0.0f, 0.0f, loanId);
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-5
@@ -26,8 +26,9 @@ import org.apache.fineract.client.models.PostLoanProductsResponse;
|
|||||||
import org.apache.fineract.client.models.PostLoansLoanIdResponse;
|
import org.apache.fineract.client.models.PostLoansLoanIdResponse;
|
||||||
import org.apache.fineract.client.models.PostLoansRequest;
|
import org.apache.fineract.client.models.PostLoansRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansResponse;
|
import org.apache.fineract.client.models.PostLoansResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
@@ -41,7 +42,8 @@ public class LoanAccrualTransactionWithInterestAndChargeAccrualDateAsSubmittedOn
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Configure Charge accrual date as submitted on date
|
// Configure Charge accrual date as submitted on date
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(this.requestSpec, this.responseSpec, "submitted-date");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("submitted-date"));
|
||||||
|
|
||||||
// Create Client
|
// Create Client
|
||||||
Long clientId = clientHelper.createClient(ClientHelper.defaultClientCreationRequest()).getClientId();
|
Long clientId = clientHelper.createClient(ClientHelper.defaultClientCreationRequest()).getClientId();
|
||||||
@@ -102,7 +104,8 @@ public class LoanAccrualTransactionWithInterestAndChargeAccrualDateAsSubmittedOn
|
|||||||
transaction(500.0, "Disbursement", "26 April 2024", 1000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
|
transaction(500.0, "Disbursement", "26 April 2024", 1000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(this.requestSpec, this.responseSpec, "due-date");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("due-date"));
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -115,7 +118,8 @@ public class LoanAccrualTransactionWithInterestAndChargeAccrualDateAsSubmittedOn
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Configure Charge accrual date as submitted on date
|
// Configure Charge accrual date as submitted on date
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(this.requestSpec, this.responseSpec, "submitted-date");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("submitted-date"));
|
||||||
|
|
||||||
// Create Client
|
// Create Client
|
||||||
Long clientId = clientHelper.createClient(ClientHelper.defaultClientCreationRequest()).getClientId();
|
Long clientId = clientHelper.createClient(ClientHelper.defaultClientCreationRequest()).getClientId();
|
||||||
@@ -200,7 +204,8 @@ public class LoanAccrualTransactionWithInterestAndChargeAccrualDateAsSubmittedOn
|
|||||||
transaction(500.0, "Disbursement", "26 April 2024", 1000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
|
transaction(500.0, "Disbursement", "26 April 2024", 1000.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateChargeAccrualDateConfiguration(this.requestSpec, this.responseSpec, "due-date");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().stringValue("due-date"));
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
+51
-29
@@ -31,11 +31,12 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
||||||
@@ -44,17 +45,14 @@ import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuil
|
|||||||
import org.apache.fineract.integrationtests.common.loans.LoanCOBCatchUpHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanCOBCatchUpHelper;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.integrationtests.inlinecob.InlineLoanCOBHelper;
|
import org.apache.fineract.integrationtests.inlinecob.InlineLoanCOBHelper;
|
||||||
import org.awaitility.Awaitility;
|
import org.awaitility.Awaitility;
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class LoanCOBAccountLockCatchupInlineCOBTest extends BaseLoanIntegrationTest {
|
||||||
public class LoanCOBAccountLockCatchupInlineCOBTest {
|
|
||||||
|
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
@@ -78,9 +76,11 @@ public class LoanCOBAccountLockCatchupInlineCOBTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testCatchUpInLockedInstanceLastCOBDateIsNull() {
|
public void testCatchUpInLockedInstanceLastCOBDateIsNull() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "0");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(0L));
|
||||||
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||||
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
||||||
|
|
||||||
@@ -126,17 +126,21 @@ public class LoanCOBAccountLockCatchupInlineCOBTest {
|
|||||||
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||||
requestSpec.header("Fineract-Platform-TenantId", "default");
|
requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||||
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "2");
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(2L));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInlineCOBInLockedInstanceLastCOBDateIsNull() {
|
public void testInlineCOBInLockedInstanceLastCOBDateIsNull() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "0");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(0L));
|
||||||
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||||
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
||||||
|
|
||||||
@@ -181,17 +185,21 @@ public class LoanCOBAccountLockCatchupInlineCOBTest {
|
|||||||
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||||
requestSpec.header("Fineract-Platform-TenantId", "default");
|
requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||||
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "2");
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(2L));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCatchUpInLockedInstanceLastCOBDateIsNotNull() {
|
public void testCatchUpInLockedInstanceLastCOBDateIsNotNull() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "0");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(0L));
|
||||||
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||||
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
||||||
|
|
||||||
@@ -255,17 +263,21 @@ public class LoanCOBAccountLockCatchupInlineCOBTest {
|
|||||||
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||||
requestSpec.header("Fineract-Platform-TenantId", "default");
|
requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||||
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "2");
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(2L));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInlineCOBInLockedInstanceLastCOBDateIsNotNull() {
|
public void testInlineCOBInLockedInstanceLastCOBDateIsNotNull() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "0");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(0L));
|
||||||
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||||
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
||||||
|
|
||||||
@@ -313,17 +325,21 @@ public class LoanCOBAccountLockCatchupInlineCOBTest {
|
|||||||
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||||
requestSpec.header("Fineract-Platform-TenantId", "default");
|
requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||||
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "2");
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(2L));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLoanCOBNoLock() {
|
public void testLoanCOBNoLock() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "0");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(0L));
|
||||||
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||||
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
||||||
final SchedulerJobHelper schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
final SchedulerJobHelper schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
||||||
@@ -368,17 +384,21 @@ public class LoanCOBAccountLockCatchupInlineCOBTest {
|
|||||||
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||||
requestSpec.header("Fineract-Platform-TenantId", "default");
|
requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||||
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "2");
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(2L));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLoanCOBWithLoanAccountLockedWithInlineCOB() {
|
public void testLoanCOBWithLoanAccountLockedWithInlineCOB() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "0");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(0L));
|
||||||
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||||
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
||||||
final SchedulerJobHelper schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
final SchedulerJobHelper schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
||||||
@@ -425,8 +445,10 @@ public class LoanCOBAccountLockCatchupInlineCOBTest {
|
|||||||
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||||
requestSpec.header("Fineract-Platform-TenantId", "default");
|
requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||||
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "2");
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(2L));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-4
@@ -27,10 +27,11 @@ import io.restassured.http.ContentType;
|
|||||||
import io.restassured.specification.RequestSpecification;
|
import io.restassured.specification.RequestSpecification;
|
||||||
import io.restassured.specification.ResponseSpecification;
|
import io.restassured.specification.ResponseSpecification;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.client.util.CallFailedRuntimeException;
|
import org.apache.fineract.client.util.CallFailedRuntimeException;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanCOBCatchUpHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanCOBCatchUpHelper;
|
||||||
@@ -44,7 +45,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
|
|||||||
|
|
||||||
@Order(1)
|
@Order(1)
|
||||||
@ExtendWith(InstanceModeSupportExtension.class)
|
@ExtendWith(InstanceModeSupportExtension.class)
|
||||||
public class LoanCOBCatchUpInstanceModeIntegrationTest {
|
public class LoanCOBCatchUpInstanceModeIntegrationTest extends BaseLoanIntegrationTest {
|
||||||
|
|
||||||
private LoanCOBCatchUpHelper loanCOBCatchUpHelper;
|
private LoanCOBCatchUpHelper loanCOBCatchUpHelper;
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
@@ -62,7 +63,8 @@ public class LoanCOBCatchUpInstanceModeIntegrationTest {
|
|||||||
schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
||||||
originalSchedulerStatus = schedulerJobHelper.getSchedulerStatus();
|
originalSchedulerStatus = schedulerJobHelper.getSchedulerStatus();
|
||||||
final LocalDate todaysDate = Utils.getLocalDateOfTenant();
|
final LocalDate todaysDate = Utils.getLocalDateOfTenant();
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, todaysDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, todaysDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,7 +124,8 @@ public class LoanCOBCatchUpInstanceModeIntegrationTest {
|
|||||||
|
|
||||||
@AfterEach
|
@AfterEach
|
||||||
public void tearDown() throws InterruptedException {
|
public void tearDown() throws InterruptedException {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
schedulerJobHelper.updateSchedulerStatus(originalSchedulerStatus);
|
schedulerJobHelper.updateSchedulerStatus(originalSchedulerStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+11
-9
@@ -32,12 +32,13 @@ import java.util.List;
|
|||||||
import org.apache.fineract.batch.domain.BatchRequest;
|
import org.apache.fineract.batch.domain.BatchRequest;
|
||||||
import org.apache.fineract.batch.domain.BatchResponse;
|
import org.apache.fineract.batch.domain.BatchResponse;
|
||||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BatchHelper;
|
import org.apache.fineract.integrationtests.common.BatchHelper;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanAccountLockHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanAccountLockHelper;
|
||||||
@@ -45,7 +46,6 @@ import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuil
|
|||||||
import org.apache.fineract.integrationtests.common.loans.LoanCOBCatchUpHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanCOBCatchUpHelper;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.integrationtests.useradministration.users.UserHelper;
|
import org.apache.fineract.integrationtests.useradministration.users.UserHelper;
|
||||||
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleType;
|
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleType;
|
||||||
@@ -53,10 +53,8 @@ import org.apache.http.HttpStatus;
|
|||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class LoanCatchUpIntegrationTest extends BaseLoanIntegrationTest {
|
||||||
public class LoanCatchUpIntegrationTest {
|
|
||||||
|
|
||||||
private static final String REPAYMENT_LOAN_PERMISSION = "REPAYMENT_LOAN";
|
private static final String REPAYMENT_LOAN_PERMISSION = "REPAYMENT_LOAN";
|
||||||
private static final String READ_LOAN_PERMISSION = "READ_LOAN";
|
private static final String READ_LOAN_PERMISSION = "READ_LOAN";
|
||||||
@@ -81,9 +79,11 @@ public class LoanCatchUpIntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testCatchUpInLockedInstance() {
|
public void testCatchUpInLockedInstance() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "0");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(0L));
|
||||||
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||||
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
||||||
|
|
||||||
@@ -146,8 +146,10 @@ public class LoanCatchUpIntegrationTest {
|
|||||||
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||||
requestSpec.header("Fineract-Platform-TenantId", "default");
|
requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||||
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "2");
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(2L));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -36,11 +36,12 @@ import org.apache.fineract.client.models.PostLoansLoanIdChargesChargeIdRequest;
|
|||||||
import org.apache.fineract.client.models.PostLoansLoanIdChargesChargeIdResponse;
|
import org.apache.fineract.client.models.PostLoansLoanIdChargesChargeIdResponse;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.client.models.PutLoansLoanIdResponse;
|
import org.apache.fineract.client.models.PutLoansLoanIdResponse;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
||||||
@@ -50,16 +51,13 @@ import org.apache.fineract.integrationtests.common.accounting.PeriodicAccrualAcc
|
|||||||
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.integrationtests.common.system.CodeHelper;
|
import org.apache.fineract.integrationtests.common.system.CodeHelper;
|
||||||
import org.apache.fineract.integrationtests.inlinecob.InlineLoanCOBHelper;
|
import org.apache.fineract.integrationtests.inlinecob.InlineLoanCOBHelper;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class LoanChargeOffAccountingTest extends BaseLoanIntegrationTest {
|
||||||
public class LoanChargeOffAccountingTest {
|
|
||||||
|
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
@@ -690,7 +688,8 @@ public class LoanChargeOffAccountingTest {
|
|||||||
@Test
|
@Test
|
||||||
public void noIncomeRecognitionAfterChargeOff() {
|
public void noIncomeRecognitionAfterChargeOff() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 9, 5));
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 9, 5));
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
String loanExternalIdStr = UUID.randomUUID().toString();
|
String loanExternalIdStr = UUID.randomUUID().toString();
|
||||||
@@ -785,7 +784,8 @@ public class LoanChargeOffAccountingTest {
|
|||||||
assertTrue(loanDetails.getTransactions().get(5).getType().getRepayment());
|
assertTrue(loanDetails.getTransactions().get(5).getType().getRepayment());
|
||||||
assertEquals(6, loanDetails.getTransactions().size());
|
assertEquals(6, loanDetails.getTransactions().size());
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -44,12 +44,13 @@ import org.apache.fineract.client.models.PostClientsResponse;
|
|||||||
import org.apache.fineract.client.models.PostLoansLoanIdRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansRequest;
|
import org.apache.fineract.client.models.PostLoansRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansResponse;
|
import org.apache.fineract.client.models.PostLoansResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
@@ -58,7 +59,6 @@ import org.apache.fineract.integrationtests.common.accounting.FinancialActivityA
|
|||||||
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
|
import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
|
||||||
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
|
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
|
||||||
@@ -71,11 +71,9 @@ import org.junit.jupiter.api.AfterAll;
|
|||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class LoanChargePaymentWithAdvancedPaymentAllocationTest {
|
public class LoanChargePaymentWithAdvancedPaymentAllocationTest extends BaseLoanIntegrationTest {
|
||||||
|
|
||||||
private static final String DATETIME_PATTERN = "dd MMMM yyyy";
|
private static final String DATETIME_PATTERN = "dd MMMM yyyy";
|
||||||
private static final String ACCOUNT_TYPE_INDIVIDUAL = "INDIVIDUAL";
|
private static final String ACCOUNT_TYPE_INDIVIDUAL = "INDIVIDUAL";
|
||||||
@@ -169,7 +167,8 @@ public class LoanChargePaymentWithAdvancedPaymentAllocationTest {
|
|||||||
final String jobName = "Transfer Fee For Loans From Savings";
|
final String jobName = "Transfer Fee For Loans From Savings";
|
||||||
final String startDate = "10 April 2022";
|
final String startDate = "10 April 2022";
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("2023.02.15").dateFormat("yyyy.MM.dd").locale("en"));
|
.date("2023.02.15").dateFormat("yyyy.MM.dd").locale("en"));
|
||||||
|
|
||||||
@@ -237,7 +236,8 @@ public class LoanChargePaymentWithAdvancedPaymentAllocationTest {
|
|||||||
assertEquals(250.0d, loanDetails.getRepaymentSchedule().getPeriods().get(2).getTotalOutstandingForPeriod());
|
assertEquals(250.0d, loanDetails.getRepaymentSchedule().getPeriods().get(2).getTotalOutstandingForPeriod());
|
||||||
assertEquals(LocalDate.of(2023, 1, 16), loanDetails.getRepaymentSchedule().getPeriods().get(2).getDueDate());
|
assertEquals(LocalDate.of(2023, 1, 16), loanDetails.getRepaymentSchedule().getPeriods().get(2).getDueDate());
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+15
-11
@@ -43,10 +43,11 @@ import org.apache.fineract.client.models.PostLoansLoanIdChargesChargeIdResponse;
|
|||||||
import org.apache.fineract.client.models.PostLoansLoanIdChargesResponse;
|
import org.apache.fineract.client.models.PostLoansLoanIdChargesResponse;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
||||||
@@ -55,15 +56,12 @@ import org.apache.fineract.integrationtests.common.accounting.PeriodicAccrualAcc
|
|||||||
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class LoanChargeSpecificDueDateTest extends BaseLoanIntegrationTest {
|
||||||
public class LoanChargeSpecificDueDateTest {
|
|
||||||
|
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
@@ -238,7 +236,8 @@ public class LoanChargeSpecificDueDateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testApplyAndWaiveInstallmentFee() {
|
public void testApplyAndWaiveInstallmentFee() {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
final LocalDate todaysDate = Utils.getLocalDateOfTenant();
|
final LocalDate todaysDate = Utils.getLocalDateOfTenant();
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, todaysDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, todaysDate);
|
||||||
|
|
||||||
@@ -311,7 +310,8 @@ public class LoanChargeSpecificDueDateTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testApplyAndWaiveInstallmentFeeAnotherDueDate() {
|
public void testApplyAndWaiveInstallmentFeeAnotherDueDate() {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
final LocalDate todaysDate = Utils.getLocalDateOfTenant();
|
final LocalDate todaysDate = Utils.getLocalDateOfTenant();
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, todaysDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, todaysDate);
|
||||||
|
|
||||||
@@ -450,7 +450,8 @@ public class LoanChargeSpecificDueDateTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testApplyFeeAccrualOnClosedDate() {
|
public void testApplyFeeAccrualOnClosedDate() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
final LocalDate todaysDate = Utils.getLocalDateOfTenant();
|
final LocalDate todaysDate = Utils.getLocalDateOfTenant();
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, todaysDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, todaysDate);
|
||||||
@@ -576,14 +577,16 @@ public class LoanChargeSpecificDueDateTest {
|
|||||||
assertEquals(transactionDate, journalEntries.get(0).getTransactionDate());
|
assertEquals(transactionDate, journalEntries.get(0).getTransactionDate());
|
||||||
assertEquals(transactionDate, journalEntries.get(1).getTransactionDate());
|
assertEquals(transactionDate, journalEntries.get(1).getTransactionDate());
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testApplyFeeAccrualWhenLoanOverpaid() {
|
public void testApplyFeeAccrualWhenLoanOverpaid() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
final LocalDate todaysDate = Utils.getLocalDateOfTenant();
|
final LocalDate todaysDate = Utils.getLocalDateOfTenant();
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, todaysDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, todaysDate);
|
||||||
@@ -654,7 +657,8 @@ public class LoanChargeSpecificDueDateTest {
|
|||||||
assertEquals(transactionDate, journalEntries.get(0).getTransactionDate());
|
assertEquals(transactionDate, journalEntries.get(0).getTransactionDate());
|
||||||
assertEquals(transactionDate, journalEntries.get(1).getTransactionDate());
|
assertEquals(transactionDate, journalEntries.get(1).getTransactionDate());
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-33
@@ -27,18 +27,16 @@ import io.restassured.http.ContentType;
|
|||||||
import io.restassured.specification.RequestSpecification;
|
import io.restassured.specification.RequestSpecification;
|
||||||
import io.restassured.specification.ResponseSpecification;
|
import io.restassured.specification.ResponseSpecification;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
import org.apache.fineract.client.models.AdvancedPaymentData;
|
import org.apache.fineract.client.models.AdvancedPaymentData;
|
||||||
import org.apache.fineract.client.models.PaymentAllocationOrder;
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
||||||
@@ -47,11 +45,10 @@ import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuil
|
|||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleType;
|
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleType;
|
||||||
import org.apache.fineract.portfolio.loanproduct.domain.PaymentAllocationType;
|
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
public class LoanChargeTypeInstallmentFeeErrorHandlingWithAdvancedPaymentAllocationTest {
|
public class LoanChargeTypeInstallmentFeeErrorHandlingWithAdvancedPaymentAllocationTest extends BaseLoanIntegrationTest {
|
||||||
|
|
||||||
private static LoanTransactionHelper LOAN_TRANSACTION_HELPER;
|
private static LoanTransactionHelper LOAN_TRANSACTION_HELPER;
|
||||||
private static ResponseSpecification RESPONSE_SPEC;
|
private static ResponseSpecification RESPONSE_SPEC;
|
||||||
@@ -79,7 +76,8 @@ public class LoanChargeTypeInstallmentFeeErrorHandlingWithAdvancedPaymentAllocat
|
|||||||
// Set business date
|
// Set business date
|
||||||
LocalDate businessDate = LocalDate.of(2023, 3, 15);
|
LocalDate businessDate = LocalDate.of(2023, 3, 15);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(REQUEST_SPEC, RESPONSE_SPEC, BusinessDateType.BUSINESS_DATE, businessDate);
|
BusinessDateHelper.updateBusinessDate(REQUEST_SPEC, RESPONSE_SPEC, BusinessDateType.BUSINESS_DATE, businessDate);
|
||||||
|
|
||||||
// Accounts oof periodic accrual
|
// Accounts oof periodic accrual
|
||||||
@@ -122,7 +120,8 @@ public class LoanChargeTypeInstallmentFeeErrorHandlingWithAdvancedPaymentAllocat
|
|||||||
loanChargeErrorData.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
loanChargeErrorData.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,31 +138,6 @@ public class LoanChargeTypeInstallmentFeeErrorHandlingWithAdvancedPaymentAllocat
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private AdvancedPaymentData createDefaultPaymentAllocation(String futureInstallmentAllocationRule) {
|
|
||||||
AdvancedPaymentData advancedPaymentData = new AdvancedPaymentData();
|
|
||||||
advancedPaymentData.setTransactionType("DEFAULT");
|
|
||||||
advancedPaymentData.setFutureInstallmentAllocationRule(futureInstallmentAllocationRule);
|
|
||||||
|
|
||||||
List<PaymentAllocationOrder> paymentAllocationOrders = getPaymentAllocationOrder(PaymentAllocationType.PAST_DUE_PENALTY,
|
|
||||||
PaymentAllocationType.PAST_DUE_FEE, PaymentAllocationType.PAST_DUE_PRINCIPAL, PaymentAllocationType.PAST_DUE_INTEREST,
|
|
||||||
PaymentAllocationType.DUE_PENALTY, PaymentAllocationType.DUE_FEE, PaymentAllocationType.DUE_PRINCIPAL,
|
|
||||||
PaymentAllocationType.DUE_INTEREST, PaymentAllocationType.IN_ADVANCE_PENALTY, PaymentAllocationType.IN_ADVANCE_FEE,
|
|
||||||
PaymentAllocationType.IN_ADVANCE_PRINCIPAL, PaymentAllocationType.IN_ADVANCE_INTEREST);
|
|
||||||
|
|
||||||
advancedPaymentData.setPaymentAllocationOrder(paymentAllocationOrders);
|
|
||||||
return advancedPaymentData;
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<PaymentAllocationOrder> getPaymentAllocationOrder(PaymentAllocationType... paymentAllocationTypes) {
|
|
||||||
AtomicInteger integer = new AtomicInteger(1);
|
|
||||||
return Arrays.stream(paymentAllocationTypes).map(pat -> {
|
|
||||||
PaymentAllocationOrder paymentAllocationOrder = new PaymentAllocationOrder();
|
|
||||||
paymentAllocationOrder.setPaymentAllocationRule(pat.name());
|
|
||||||
paymentAllocationOrder.setOrder(integer.getAndIncrement());
|
|
||||||
return paymentAllocationOrder;
|
|
||||||
}).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
private Integer createLoanAccount(final Integer clientID, final Integer loanProductID, final String externalId) {
|
private Integer createLoanAccount(final Integer clientID, final Integer loanProductID, final String externalId) {
|
||||||
|
|
||||||
String loanApplicationJSON = new LoanApplicationTestBuilder().withPrincipal("1000").withLoanTermFrequency("60")
|
String loanApplicationJSON = new LoanApplicationTestBuilder().withPrincipal("1000").withLoanTermFrequency("60")
|
||||||
|
|||||||
+10
-9
@@ -33,8 +33,9 @@ import org.apache.fineract.client.models.GetLoanProductsProductIdResponse;
|
|||||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||||
import org.apache.fineract.client.models.PostLoanProductsRequest;
|
import org.apache.fineract.client.models.PostLoanProductsRequest;
|
||||||
import org.apache.fineract.client.models.PostLoanProductsResponse;
|
import org.apache.fineract.client.models.PostLoanProductsResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
|
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
@@ -48,8 +49,8 @@ public class LoanDelinquencyDetailsNextPaymentDateConfigurationTest extends Base
|
|||||||
runAt("01 November 2023", () -> {
|
runAt("01 November 2023", () -> {
|
||||||
try {
|
try {
|
||||||
// update Global configuration for next payment date
|
// update Global configuration for next payment date
|
||||||
GlobalConfigurationHelper.updateLoanNextPaymentDateConfiguration(this.requestSpec, this.responseSpec,
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.NEXT_PAYMENT_DUE_DATE,
|
||||||
"next-unpaid-due-date");
|
new PutGlobalConfigurationsRequest().stringValue("next-unpaid-due-date"));
|
||||||
// Create Client
|
// Create Client
|
||||||
Long clientId = clientHelper.createClient(ClientHelper.defaultClientCreationRequest()).getClientId();
|
Long clientId = clientHelper.createClient(ClientHelper.defaultClientCreationRequest()).getClientId();
|
||||||
|
|
||||||
@@ -122,8 +123,8 @@ public class LoanDelinquencyDetailsNextPaymentDateConfigurationTest extends Base
|
|||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
// reset global config
|
// reset global config
|
||||||
GlobalConfigurationHelper.updateLoanNextPaymentDateConfiguration(this.requestSpec, this.responseSpec,
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.NEXT_PAYMENT_DUE_DATE,
|
||||||
"earliest-unpaid-date");
|
new PutGlobalConfigurationsRequest().stringValue("earliest-unpaid-date"));
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -134,8 +135,8 @@ public class LoanDelinquencyDetailsNextPaymentDateConfigurationTest extends Base
|
|||||||
runAt("01 November 2023", () -> {
|
runAt("01 November 2023", () -> {
|
||||||
try {
|
try {
|
||||||
// update Global configuration for next payment date
|
// update Global configuration for next payment date
|
||||||
GlobalConfigurationHelper.updateLoanNextPaymentDateConfiguration(this.requestSpec, this.responseSpec,
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.NEXT_PAYMENT_DUE_DATE,
|
||||||
"next-unpaid-due-date");
|
new PutGlobalConfigurationsRequest().stringValue("next-unpaid-due-date"));
|
||||||
// Create Client
|
// Create Client
|
||||||
Long clientId = clientHelper.createClient(ClientHelper.defaultClientCreationRequest()).getClientId();
|
Long clientId = clientHelper.createClient(ClientHelper.defaultClientCreationRequest()).getClientId();
|
||||||
|
|
||||||
@@ -237,8 +238,8 @@ public class LoanDelinquencyDetailsNextPaymentDateConfigurationTest extends Base
|
|||||||
.dateFormat(DATETIME_PATTERN).locale("en"));
|
.dateFormat(DATETIME_PATTERN).locale("en"));
|
||||||
} finally {
|
} finally {
|
||||||
// reset global config
|
// reset global config
|
||||||
GlobalConfigurationHelper.updateLoanNextPaymentDateConfiguration(this.requestSpec, this.responseSpec,
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.NEXT_PAYMENT_DUE_DATE,
|
||||||
"earliest-unpaid-date");
|
new PutGlobalConfigurationsRequest().stringValue("earliest-unpaid-date"));
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
+11
-11
@@ -39,11 +39,12 @@ import org.apache.fineract.client.models.GetLoansLoanIdRepaymentPeriod;
|
|||||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
@@ -52,14 +53,11 @@ import org.apache.fineract.integrationtests.common.accounting.PeriodicAccrualAcc
|
|||||||
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class LoanMultipleDisbursementRepaymentScheduleTest extends BaseLoanIntegrationTest {
|
||||||
public class LoanMultipleDisbursementRepaymentScheduleTest {
|
|
||||||
|
|
||||||
private static final DateTimeFormatter DATE_FORMATTER = new DateTimeFormatterBuilder().appendPattern("dd MMMM yyyy").toFormatter();
|
private static final DateTimeFormatter DATE_FORMATTER = new DateTimeFormatterBuilder().appendPattern("dd MMMM yyyy").toFormatter();
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
@@ -92,9 +90,10 @@ public class LoanMultipleDisbursementRepaymentScheduleTest {
|
|||||||
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
|
final Account overpaymentAccount = this.accountHelper.createLiabilityAccount();
|
||||||
|
|
||||||
// Set business date
|
// Set business date
|
||||||
LocalDate currentDate = LocalDate.of(2023, 07, 7);
|
LocalDate currentDate = LocalDate.of(2023, 7, 7);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
||||||
|
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
@@ -124,7 +123,7 @@ public class LoanMultipleDisbursementRepaymentScheduleTest {
|
|||||||
|
|
||||||
// run cob
|
// run cob
|
||||||
|
|
||||||
currentDate = LocalDate.of(2023, 07, 12);
|
currentDate = LocalDate.of(2023, 7, 12);
|
||||||
|
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
||||||
|
|
||||||
@@ -136,7 +135,7 @@ public class LoanMultipleDisbursementRepaymentScheduleTest {
|
|||||||
|
|
||||||
// make Merchant Issued Refund
|
// make Merchant Issued Refund
|
||||||
|
|
||||||
currentDate = LocalDate.of(2023, 07, 21);
|
currentDate = LocalDate.of(2023, 7, 21);
|
||||||
|
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
||||||
|
|
||||||
@@ -150,7 +149,7 @@ public class LoanMultipleDisbursementRepaymentScheduleTest {
|
|||||||
schedulerJobHelper.executeAndAwaitJob(jobName);
|
schedulerJobHelper.executeAndAwaitJob(jobName);
|
||||||
|
|
||||||
// make another disbursement
|
// make another disbursement
|
||||||
currentDate = LocalDate.of(2023, 07, 24);
|
currentDate = LocalDate.of(2023, 7, 24);
|
||||||
|
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, currentDate);
|
||||||
|
|
||||||
@@ -169,7 +168,8 @@ public class LoanMultipleDisbursementRepaymentScheduleTest {
|
|||||||
assertEquals(1, activePeriods);
|
assertEquals(1, activePeriods);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-4
@@ -32,9 +32,11 @@ import java.util.UUID;
|
|||||||
import org.apache.fineract.client.models.GetDelinquencyBucketsResponse;
|
import org.apache.fineract.client.models.GetDelinquencyBucketsResponse;
|
||||||
import org.apache.fineract.client.models.GetLoanProductsProductIdResponse;
|
import org.apache.fineract.client.models.GetLoanProductsProductIdResponse;
|
||||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.client.models.PutLoanProductsProductIdRequest;
|
import org.apache.fineract.client.models.PutLoanProductsProductIdRequest;
|
||||||
import org.apache.fineract.client.models.PutLoanProductsProductIdResponse;
|
import org.apache.fineract.client.models.PutLoanProductsProductIdResponse;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
||||||
@@ -52,6 +54,7 @@ public class LoanProductRepaymentStartDateConfigurationTest {
|
|||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
private LoanTransactionHelper loanTransactionHelper;
|
private LoanTransactionHelper loanTransactionHelper;
|
||||||
private ClientHelper clientHelper;
|
private ClientHelper clientHelper;
|
||||||
|
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@@ -61,6 +64,7 @@ public class LoanProductRepaymentStartDateConfigurationTest {
|
|||||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||||
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
this.clientHelper = new ClientHelper(this.requestSpec, this.responseSpec);
|
||||||
|
this.globalConfigurationHelper = new GlobalConfigurationHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -126,7 +130,8 @@ public class LoanProductRepaymentStartDateConfigurationTest {
|
|||||||
// Set business date
|
// Set business date
|
||||||
LocalDate businessDate = LocalDate.of(2023, 3, 3);
|
LocalDate businessDate = LocalDate.of(2023, 3, 3);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
||||||
|
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
@@ -265,7 +270,8 @@ public class LoanProductRepaymentStartDateConfigurationTest {
|
|||||||
assertEquals(500.00, loanDetails.getRepaymentSchedule().getPeriods().get(4).getTotalInstallmentAmountForPeriod());
|
assertEquals(500.00, loanDetails.getRepaymentSchedule().getPeriods().get(4).getTotalInstallmentAmountForPeriod());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -280,7 +286,8 @@ public class LoanProductRepaymentStartDateConfigurationTest {
|
|||||||
// Set business date
|
// Set business date
|
||||||
LocalDate businessDate = LocalDate.of(2023, 3, 3);
|
LocalDate businessDate = LocalDate.of(2023, 3, 3);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
||||||
|
|
||||||
// Loan ExternalId
|
// Loan ExternalId
|
||||||
@@ -422,7 +429,8 @@ public class LoanProductRepaymentStartDateConfigurationTest {
|
|||||||
assertEquals(333.34, loanDetails.getRepaymentSchedule().getPeriods().get(4).getTotalInstallmentAmountForPeriod());
|
assertEquals(333.34, loanDetails.getRepaymentSchedule().getPeriods().get(4).getTotalInstallmentAmountForPeriod());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-7
@@ -45,13 +45,14 @@ import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
|||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsTransactionIdRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsTransactionIdRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansRequest;
|
import org.apache.fineract.client.models.PostLoansRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansResponse;
|
import org.apache.fineract.client.models.PostLoansResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.client.models.PutLoanProductsProductIdRequest;
|
import org.apache.fineract.client.models.PutLoanProductsProductIdRequest;
|
||||||
import org.apache.fineract.client.models.PutLoanProductsProductIdResponse;
|
import org.apache.fineract.client.models.PutLoanProductsProductIdResponse;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
@@ -817,7 +818,8 @@ public class LoanRepaymentScheduleWithDownPaymentTest extends BaseLoanIntegratio
|
|||||||
@Test
|
@Test
|
||||||
public void testDelinquencyRangeOnDownPaymentInstallment() {
|
public void testDelinquencyRangeOnDownPaymentInstallment() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
LocalDate businessDate = LocalDate.of(2022, 9, 5);
|
LocalDate businessDate = LocalDate.of(2022, 9, 5);
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
||||||
String loanExternalIdStr = UUID.randomUUID().toString();
|
String loanExternalIdStr = UUID.randomUUID().toString();
|
||||||
@@ -871,7 +873,8 @@ public class LoanRepaymentScheduleWithDownPaymentTest extends BaseLoanIntegratio
|
|||||||
} finally {
|
} finally {
|
||||||
final LocalDate todaysDate = Utils.getLocalDateOfTenant();
|
final LocalDate todaysDate = Utils.getLocalDateOfTenant();
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, todaysDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, todaysDate);
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -991,7 +994,8 @@ public class LoanRepaymentScheduleWithDownPaymentTest extends BaseLoanIntegratio
|
|||||||
// Set business date
|
// Set business date
|
||||||
LocalDate disbursementDate = LocalDate.of(2023, 3, 3);
|
LocalDate disbursementDate = LocalDate.of(2023, 3, 3);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, disbursementDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, disbursementDate);
|
||||||
|
|
||||||
// Accounts oof periodic accrual
|
// Accounts oof periodic accrual
|
||||||
@@ -1098,7 +1102,8 @@ public class LoanRepaymentScheduleWithDownPaymentTest extends BaseLoanIntegratio
|
|||||||
new JournalEntry(50, JournalEntry.TransactionType.DEBIT));
|
new JournalEntry(50, JournalEntry.TransactionType.DEBIT));
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1110,7 +1115,8 @@ public class LoanRepaymentScheduleWithDownPaymentTest extends BaseLoanIntegratio
|
|||||||
// Set business date
|
// Set business date
|
||||||
LocalDate disbursementDate = LocalDate.of(2023, 3, 3);
|
LocalDate disbursementDate = LocalDate.of(2023, 3, 3);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, disbursementDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, disbursementDate);
|
||||||
|
|
||||||
// Accounts oof periodic accrual
|
// Accounts oof periodic accrual
|
||||||
@@ -1165,7 +1171,8 @@ public class LoanRepaymentScheduleWithDownPaymentTest extends BaseLoanIntegratio
|
|||||||
checkNoDownPaymentTransaction(loanId);
|
checkNoDownPaymentTransaction(loanId);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-9
@@ -33,26 +33,24 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.LoanRescheduleRequestHelper;
|
import org.apache.fineract.integrationtests.common.LoanRescheduleRequestHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanRescheduleRequestTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanRescheduleRequestTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.junit.jupiter.api.AfterEach;
|
import org.junit.jupiter.api.AfterEach;
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class LoanRescheduleOnDecliningBalanceLoanTest extends BaseLoanIntegrationTest {
|
||||||
public class LoanRescheduleOnDecliningBalanceLoanTest {
|
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(LoanRescheduleOnDecliningBalanceLoanTest.class);
|
private static final Logger LOG = LoggerFactory.getLogger(LoanRescheduleOnDecliningBalanceLoanTest.class);
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
@@ -285,14 +283,18 @@ public class LoanRescheduleOnDecliningBalanceLoanTest {
|
|||||||
* enables the configuration `is-interest-to-be-recovered-first-when-greater-than-emi`
|
* enables the configuration `is-interest-to-be-recovered-first-when-greater-than-emi`
|
||||||
**/
|
**/
|
||||||
private void enableConfig() {
|
private void enableConfig() {
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec, "42", true);
|
globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
|
GlobalConfigurationConstants.IS_INTEREST_TO_BE_RECOVERED_FIRST_WHEN_GREATER_THAN_EMI,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* disables the configuration `is-interest-to-be-recovered-first-when-greater-than-emi`
|
* disables the configuration `is-interest-to-be-recovered-first-when-greater-than-emi`
|
||||||
**/
|
**/
|
||||||
private void disableConfig() {
|
private void disableConfig() {
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec, "42", false);
|
globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
|
GlobalConfigurationConstants.IS_INTEREST_TO_BE_RECOVERED_FIRST_WHEN_GREATER_THAN_EMI,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -543,14 +545,18 @@ public class LoanRescheduleOnDecliningBalanceLoanTest {
|
|||||||
* enables the configuration `is-principal-compounding-disabled-for-overdue-loans`
|
* enables the configuration `is-principal-compounding-disabled-for-overdue-loans`
|
||||||
**/
|
**/
|
||||||
private void enablePrincipalCompoundingConfig() {
|
private void enablePrincipalCompoundingConfig() {
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec, "43", true);
|
globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
|
GlobalConfigurationConstants.IS_PRINCIPAL_COMPOUNDING_DISABLED_FOR_OVERDUE_LOANS,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* disables the configuration `is-principal-compounding-disabled-for-overdue-loans`
|
* disables the configuration `is-principal-compounding-disabled-for-overdue-loans`
|
||||||
**/
|
**/
|
||||||
private void disablePrincipalCompoundingConfig() {
|
private void disablePrincipalCompoundingConfig() {
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec, "43", false);
|
globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
|
GlobalConfigurationConstants.IS_PRINCIPAL_COMPOUNDING_DISABLED_FOR_OVERDUE_LOANS,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+15
-9
@@ -31,25 +31,23 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.LoanRescheduleRequestHelper;
|
import org.apache.fineract.integrationtests.common.LoanRescheduleRequestHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.WorkingDaysHelper;
|
import org.apache.fineract.integrationtests.common.WorkingDaysHelper;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanRescheduleRequestTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanRescheduleRequestTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.junit.jupiter.api.AfterEach;
|
import org.junit.jupiter.api.AfterEach;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class LoanRescheduleWithAdvancePaymentTest extends BaseLoanIntegrationTest {
|
||||||
public class LoanRescheduleWithAdvancePaymentTest {
|
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(LoanRescheduleWithAdvancePaymentTest.class);
|
private static final Logger LOG = LoggerFactory.getLogger(LoanRescheduleWithAdvancePaymentTest.class);
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
@@ -87,28 +85,36 @@ public class LoanRescheduleWithAdvancePaymentTest {
|
|||||||
* enables the configuration `is-interest-to-be-recovered-first-when-greater-than-emi`
|
* enables the configuration `is-interest-to-be-recovered-first-when-greater-than-emi`
|
||||||
**/
|
**/
|
||||||
private void enableConfig() {
|
private void enableConfig() {
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec, "42", true);
|
globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
|
GlobalConfigurationConstants.IS_INTEREST_TO_BE_RECOVERED_FIRST_WHEN_GREATER_THAN_EMI,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* disables the configuration `is-interest-to-be-recovered-first-when-greater-than-emi`
|
* disables the configuration `is-interest-to-be-recovered-first-when-greater-than-emi`
|
||||||
**/
|
**/
|
||||||
private void disableConfig() {
|
private void disableConfig() {
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec, "42", false);
|
globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
|
GlobalConfigurationConstants.IS_INTEREST_TO_BE_RECOVERED_FIRST_WHEN_GREATER_THAN_EMI,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* enables the configuration `is-principal-compounding-disabled-for-overdue-loans`
|
* enables the configuration `is-principal-compounding-disabled-for-overdue-loans`
|
||||||
**/
|
**/
|
||||||
private void enablePrincipalCompoundingConfig() {
|
private void enablePrincipalCompoundingConfig() {
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec, "43", true);
|
globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
|
GlobalConfigurationConstants.IS_PRINCIPAL_COMPOUNDING_DISABLED_FOR_OVERDUE_LOANS,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* disables the configuration `is-principal-compounding-disabled-for-overdue-loans`
|
* disables the configuration `is-principal-compounding-disabled-for-overdue-loans`
|
||||||
**/
|
**/
|
||||||
private void disablePrincipalCompoundingConfig() {
|
private void disablePrincipalCompoundingConfig() {
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec, "43", false);
|
globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
|
GlobalConfigurationConstants.IS_PRINCIPAL_COMPOUNDING_DISABLED_FOR_OVERDUE_LOANS,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+2
-6
@@ -43,7 +43,6 @@ import org.apache.fineract.integrationtests.common.CenterDomain;
|
|||||||
import org.apache.fineract.integrationtests.common.CenterHelper;
|
import org.apache.fineract.integrationtests.common.CenterHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.GroupHelper;
|
import org.apache.fineract.integrationtests.common.GroupHelper;
|
||||||
import org.apache.fineract.integrationtests.common.OfficeHelper;
|
import org.apache.fineract.integrationtests.common.OfficeHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
@@ -51,18 +50,15 @@ import org.apache.fineract.integrationtests.common.accounting.Account;
|
|||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
|
import org.apache.fineract.integrationtests.common.organisation.StaffHelper;
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class LoanReschedulingWithinCenterTest extends BaseLoanIntegrationTest {
|
||||||
public class LoanReschedulingWithinCenterTest {
|
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(LoanReschedulingWithinCenterTest.class);
|
private static final Logger LOG = LoggerFactory.getLogger(LoanReschedulingWithinCenterTest.class);
|
||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
@@ -82,7 +78,7 @@ public class LoanReschedulingWithinCenterTest {
|
|||||||
this.loanApplicationApprovalTest = new LoanApplicationApprovalTest();
|
this.loanApplicationApprovalTest = new LoanApplicationApprovalTest();
|
||||||
this.generalResponseSpec = new ResponseSpecBuilder().build();
|
this.generalResponseSpec = new ResponseSpecBuilder().build();
|
||||||
|
|
||||||
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.verifyAllDefaultGlobalConfigurations();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
|
|||||||
+7
-16
@@ -48,10 +48,11 @@ import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
|||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsTransactionIdRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsTransactionIdRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansRequest;
|
import org.apache.fineract.client.models.PostLoansRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansResponse;
|
import org.apache.fineract.client.models.PostLoansResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
||||||
@@ -60,7 +61,6 @@ import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
|||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
|
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
|
||||||
import org.apache.fineract.portfolio.charge.domain.ChargeCalculationType;
|
import org.apache.fineract.portfolio.charge.domain.ChargeCalculationType;
|
||||||
@@ -68,13 +68,11 @@ import org.apache.fineract.portfolio.charge.domain.ChargePaymentMode;
|
|||||||
import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
|
import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@SuppressWarnings({ "unchecked" })
|
@SuppressWarnings({ "unchecked" })
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class LoanSpecificDueDateChargeAfterMaturityTest extends BaseLoanIntegrationTest {
|
||||||
public class LoanSpecificDueDateChargeAfterMaturityTest {
|
|
||||||
|
|
||||||
private static final String DATETIME_PATTERN = "dd MMMM yyyy";
|
private static final String DATETIME_PATTERN = "dd MMMM yyyy";
|
||||||
private static final String ACCOUNT_TYPE_INDIVIDUAL = "INDIVIDUAL";
|
private static final String ACCOUNT_TYPE_INDIVIDUAL = "INDIVIDUAL";
|
||||||
@@ -436,7 +434,8 @@ public class LoanSpecificDueDateChargeAfterMaturityTest {
|
|||||||
@Test
|
@Test
|
||||||
public void addChargeAfterLoanMaturity() {
|
public void addChargeAfterLoanMaturity() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
BUSINESS_DATE_HELPER.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("01 September 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
.date("01 September 2023").dateFormat(DATETIME_PATTERN).locale("en"));
|
||||||
|
|
||||||
@@ -508,7 +507,8 @@ public class LoanSpecificDueDateChargeAfterMaturityTest {
|
|||||||
validateRepaymentPeriod(loanDetails, 2, 0.0, 0.0, 0.0, 10.0, 0.0, 10.0, 0.0, 0.0);
|
validateRepaymentPeriod(loanDetails, 2, 0.0, 0.0, 0.0, 10.0, 0.0, 10.0, 0.0, 0.0);
|
||||||
assertTrue(loanDetails.getStatus().getActive());
|
assertTrue(loanDetails.getStatus().getActive());
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -590,13 +590,4 @@ public class LoanSpecificDueDateChargeAfterMaturityTest {
|
|||||||
assertEquals(paidInAdvance, loanDetails.getRepaymentSchedule().getPeriods().get(index).getTotalPaidInAdvanceForPeriod());
|
assertEquals(paidInAdvance, loanDetails.getRepaymentSchedule().getPeriods().get(index).getTotalPaidInAdvanceForPeriod());
|
||||||
assertEquals(paidLate, loanDetails.getRepaymentSchedule().getPeriods().get(index).getTotalPaidLateForPeriod());
|
assertEquals(paidLate, loanDetails.getRepaymentSchedule().getPeriods().get(index).getTotalPaidLateForPeriod());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void validateLoanSummaryBalances(GetLoansLoanIdResponse loanDetails, Double totalOutstanding, Double totalRepayment,
|
|
||||||
Double principalOutstanding, Double principalPaid, Double totalOverpaid) {
|
|
||||||
assertEquals(totalOutstanding, loanDetails.getSummary().getTotalOutstanding());
|
|
||||||
assertEquals(totalRepayment, loanDetails.getSummary().getTotalRepayment());
|
|
||||||
assertEquals(principalOutstanding, loanDetails.getSummary().getPrincipalOutstanding());
|
|
||||||
assertEquals(principalPaid, loanDetails.getSummary().getPrincipalPaid());
|
|
||||||
assertEquals(totalOverpaid, loanDetails.getTotalOverpaid());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-10
@@ -48,29 +48,27 @@ import org.apache.fineract.client.models.GetLoansLoanIdTransactions;
|
|||||||
import org.apache.fineract.client.models.GetLoansLoanIdTransactionsTransactionIdResponse;
|
import org.apache.fineract.client.models.GetLoansLoanIdTransactionsTransactionIdResponse;
|
||||||
import org.apache.fineract.client.models.PaymentAllocationOrder;
|
import org.apache.fineract.client.models.PaymentAllocationOrder;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.JournalEntryHelper;
|
import org.apache.fineract.integrationtests.common.accounting.JournalEntryHelper;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
|
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
|
||||||
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleType;
|
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleType;
|
||||||
import org.apache.fineract.portfolio.loanproduct.domain.PaymentAllocationType;
|
import org.apache.fineract.portfolio.loanproduct.domain.PaymentAllocationType;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Named;
|
import org.junit.jupiter.api.Named;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
import org.junit.jupiter.params.ParameterizedTest;
|
import org.junit.jupiter.params.ParameterizedTest;
|
||||||
import org.junit.jupiter.params.provider.Arguments;
|
import org.junit.jupiter.params.provider.Arguments;
|
||||||
import org.junit.jupiter.params.provider.MethodSource;
|
import org.junit.jupiter.params.provider.MethodSource;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
|
||||||
public class LoanTransactionChargebackTest extends BaseLoanIntegrationTest {
|
public class LoanTransactionChargebackTest extends BaseLoanIntegrationTest {
|
||||||
|
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
@@ -198,7 +196,8 @@ public class LoanTransactionChargebackTest extends BaseLoanIntegrationTest {
|
|||||||
@MethodSource("loanProductFactory")
|
@MethodSource("loanProductFactory")
|
||||||
public void applyLoanTransactionChargebackInLongTermLoan(LoanProductTestBuilder loanProductTestBuilder) {
|
public void applyLoanTransactionChargebackInLongTermLoan(LoanProductTestBuilder loanProductTestBuilder) {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
LocalDate businessDate = LocalDate.of(2023, 1, 20);
|
LocalDate businessDate = LocalDate.of(2023, 1, 20);
|
||||||
todaysDate = businessDate;
|
todaysDate = businessDate;
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
||||||
@@ -251,7 +250,8 @@ public class LoanTransactionChargebackTest extends BaseLoanIntegrationTest {
|
|||||||
} finally {
|
} finally {
|
||||||
final LocalDate todaysDate = Utils.getLocalDateOfTenant();
|
final LocalDate todaysDate = Utils.getLocalDateOfTenant();
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, todaysDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, todaysDate);
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,7 +279,8 @@ public class LoanTransactionChargebackTest extends BaseLoanIntegrationTest {
|
|||||||
@MethodSource("loanProductFactory")
|
@MethodSource("loanProductFactory")
|
||||||
public void applyLoanTransactionChargebackAfterMature(LoanProductTestBuilder loanProductTestBuilder) {
|
public void applyLoanTransactionChargebackAfterMature(LoanProductTestBuilder loanProductTestBuilder) {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
final LocalDate todaysDate = Utils.getLocalDateOfTenant();
|
final LocalDate todaysDate = Utils.getLocalDateOfTenant();
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, todaysDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, todaysDate);
|
||||||
@@ -383,7 +384,8 @@ public class LoanTransactionChargebackTest extends BaseLoanIntegrationTest {
|
|||||||
getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
|
getLoansLoanIdResponse = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanId);
|
||||||
DelinquencyBucketsHelper.evaluateLoanCollectionData(getLoansLoanIdResponse, 4, Double.valueOf("800.00"));
|
DelinquencyBucketsHelper.evaluateLoanCollectionData(getLoansLoanIdResponse, 4, Double.valueOf("800.00"));
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -524,7 +526,8 @@ public class LoanTransactionChargebackTest extends BaseLoanIntegrationTest {
|
|||||||
@MethodSource("loanProductFactory")
|
@MethodSource("loanProductFactory")
|
||||||
public void applyMultipleLoanTransactionChargeback(LoanProductTestBuilder loanProductTestBuilder) {
|
public void applyMultipleLoanTransactionChargeback(LoanProductTestBuilder loanProductTestBuilder) {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
final LocalDate todaysDate = Utils.getLocalDateOfTenant();
|
final LocalDate todaysDate = Utils.getLocalDateOfTenant();
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, todaysDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, todaysDate);
|
||||||
log.info("Current Business date {}", todaysDate);
|
log.info("Current Business date {}", todaysDate);
|
||||||
@@ -586,7 +589,8 @@ public class LoanTransactionChargebackTest extends BaseLoanIntegrationTest {
|
|||||||
|
|
||||||
DelinquencyBucketsHelper.evaluateLoanCollectionData(getLoansLoanIdResponse, 0, Double.valueOf("0.00"));
|
DelinquencyBucketsHelper.evaluateLoanCollectionData(getLoansLoanIdResponse, 0, Double.valueOf("0.00"));
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-34
@@ -31,20 +31,17 @@ import java.time.LocalDate;
|
|||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.time.format.DateTimeFormatterBuilder;
|
import java.time.format.DateTimeFormatterBuilder;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
import org.apache.fineract.client.models.AdvancedPaymentData;
|
import org.apache.fineract.client.models.AdvancedPaymentData;
|
||||||
import org.apache.fineract.client.models.GetLoansLoanIdTransactionsTransactionIdResponse;
|
import org.apache.fineract.client.models.GetLoansLoanIdTransactionsTransactionIdResponse;
|
||||||
import org.apache.fineract.client.models.PaymentAllocationOrder;
|
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
||||||
@@ -53,11 +50,10 @@ import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuil
|
|||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleType;
|
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleType;
|
||||||
import org.apache.fineract.portfolio.loanproduct.domain.PaymentAllocationType;
|
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
public class LoanTransactionReprocessForAdvancedPaymentAllocationTest {
|
public class LoanTransactionReprocessForAdvancedPaymentAllocationTest extends BaseLoanIntegrationTest {
|
||||||
|
|
||||||
private static LoanTransactionHelper LOAN_TRANSACTION_HELPER;
|
private static LoanTransactionHelper LOAN_TRANSACTION_HELPER;
|
||||||
private static ResponseSpecification RESPONSE_SPEC;
|
private static ResponseSpecification RESPONSE_SPEC;
|
||||||
@@ -83,7 +79,8 @@ public class LoanTransactionReprocessForAdvancedPaymentAllocationTest {
|
|||||||
// Set business date
|
// Set business date
|
||||||
LocalDate businessDate = LocalDate.of(2023, 3, 15);
|
LocalDate businessDate = LocalDate.of(2023, 3, 15);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(REQUEST_SPEC, RESPONSE_SPEC, BusinessDateType.BUSINESS_DATE, businessDate);
|
BusinessDateHelper.updateBusinessDate(REQUEST_SPEC, RESPONSE_SPEC, BusinessDateType.BUSINESS_DATE, businessDate);
|
||||||
|
|
||||||
// Accounts oof periodic accrual
|
// Accounts oof periodic accrual
|
||||||
@@ -164,7 +161,8 @@ public class LoanTransactionReprocessForAdvancedPaymentAllocationTest {
|
|||||||
verifyTransaction(LocalDate.of(2023, 2, 20), 50.0f, 40.0f, 0.0f, 0.0f, 10.0f, loanId, "repayment");
|
verifyTransaction(LocalDate.of(2023, 2, 20), 50.0f, 40.0f, 0.0f, 0.0f, 10.0f, loanId, "repayment");
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,31 +179,6 @@ public class LoanTransactionReprocessForAdvancedPaymentAllocationTest {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private AdvancedPaymentData createDefaultPaymentAllocation(String futureInstallmentAllocationRule) {
|
|
||||||
AdvancedPaymentData advancedPaymentData = new AdvancedPaymentData();
|
|
||||||
advancedPaymentData.setTransactionType("DEFAULT");
|
|
||||||
advancedPaymentData.setFutureInstallmentAllocationRule(futureInstallmentAllocationRule);
|
|
||||||
|
|
||||||
List<PaymentAllocationOrder> paymentAllocationOrders = getPaymentAllocationOrder(PaymentAllocationType.PAST_DUE_PENALTY,
|
|
||||||
PaymentAllocationType.PAST_DUE_FEE, PaymentAllocationType.PAST_DUE_PRINCIPAL, PaymentAllocationType.PAST_DUE_INTEREST,
|
|
||||||
PaymentAllocationType.DUE_PENALTY, PaymentAllocationType.DUE_FEE, PaymentAllocationType.DUE_PRINCIPAL,
|
|
||||||
PaymentAllocationType.DUE_INTEREST, PaymentAllocationType.IN_ADVANCE_PENALTY, PaymentAllocationType.IN_ADVANCE_FEE,
|
|
||||||
PaymentAllocationType.IN_ADVANCE_PRINCIPAL, PaymentAllocationType.IN_ADVANCE_INTEREST);
|
|
||||||
|
|
||||||
advancedPaymentData.setPaymentAllocationOrder(paymentAllocationOrders);
|
|
||||||
return advancedPaymentData;
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<PaymentAllocationOrder> getPaymentAllocationOrder(PaymentAllocationType... paymentAllocationTypes) {
|
|
||||||
AtomicInteger integer = new AtomicInteger(1);
|
|
||||||
return Arrays.stream(paymentAllocationTypes).map(pat -> {
|
|
||||||
PaymentAllocationOrder paymentAllocationOrder = new PaymentAllocationOrder();
|
|
||||||
paymentAllocationOrder.setPaymentAllocationRule(pat.name());
|
|
||||||
paymentAllocationOrder.setOrder(integer.getAndIncrement());
|
|
||||||
return paymentAllocationOrder;
|
|
||||||
}).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
private Integer createLoanAccount(final Integer clientID, final Integer loanProductID, final String externalId) {
|
private Integer createLoanAccount(final Integer clientID, final Integer loanProductID, final String externalId) {
|
||||||
|
|
||||||
String loanApplicationJSON = new LoanApplicationTestBuilder().withPrincipal("1000").withLoanTermFrequency("60")
|
String loanApplicationJSON = new LoanApplicationTestBuilder().withPrincipal("1000").withLoanTermFrequency("60")
|
||||||
|
|||||||
+15
-11
@@ -41,10 +41,11 @@ import org.apache.fineract.client.models.GetLoansLoanIdTransactions;
|
|||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsTransactionIdRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsTransactionIdRequest;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
||||||
@@ -52,16 +53,13 @@ import org.apache.fineract.integrationtests.common.accounting.JournalEntryHelper
|
|||||||
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.integrationtests.common.system.CodeHelper;
|
import org.apache.fineract.integrationtests.common.system.CodeHelper;
|
||||||
import org.apache.fineract.integrationtests.inlinecob.InlineLoanCOBHelper;
|
import org.apache.fineract.integrationtests.inlinecob.InlineLoanCOBHelper;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class LoanTransactionReverseReplayTest extends BaseLoanIntegrationTest {
|
||||||
public class LoanTransactionReverseReplayTest {
|
|
||||||
|
|
||||||
private static final String DATE_PATTERN = "dd MMMM yyyy";
|
private static final String DATE_PATTERN = "dd MMMM yyyy";
|
||||||
private final BusinessDateHelper businessDateHelper = new BusinessDateHelper();
|
private final BusinessDateHelper businessDateHelper = new BusinessDateHelper();
|
||||||
@@ -97,7 +95,8 @@ public class LoanTransactionReverseReplayTest {
|
|||||||
@Test
|
@Test
|
||||||
public void loanTransactionReverseReplayWithAdditionalInstallmentAndChargesTest() {
|
public void loanTransactionReverseReplayWithAdditionalInstallmentAndChargesTest() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("04 October 2022").dateFormat(DATE_PATTERN).locale("en"));
|
.date("04 October 2022").dateFormat(DATE_PATTERN).locale("en"));
|
||||||
|
|
||||||
@@ -147,7 +146,8 @@ public class LoanTransactionReverseReplayTest {
|
|||||||
assertTrue(loansLoanIdResponse.getTransactions().get(lastTransactionIndex).getType().getAccrual());
|
assertTrue(loansLoanIdResponse.getTransactions().get(lastTransactionIndex).getType().getAccrual());
|
||||||
assertEquals(10.0, loansLoanIdResponse.getTransactions().get(lastTransactionIndex).getAmount());
|
assertEquals(10.0, loansLoanIdResponse.getTransactions().get(lastTransactionIndex).getAmount());
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,7 +160,8 @@ public class LoanTransactionReverseReplayTest {
|
|||||||
@Test
|
@Test
|
||||||
public void loanTransactionReverseReplayWithAdditionalInstallmentAndChargesScheduleDueDateTest() {
|
public void loanTransactionReverseReplayWithAdditionalInstallmentAndChargesScheduleDueDateTest() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("04 October 2022").dateFormat(DATE_PATTERN).locale("en"));
|
.date("04 October 2022").dateFormat(DATE_PATTERN).locale("en"));
|
||||||
|
|
||||||
@@ -226,14 +227,16 @@ public class LoanTransactionReverseReplayTest {
|
|||||||
assertEquals(LocalDate.of(2022, 10, 11),
|
assertEquals(LocalDate.of(2022, 10, 11),
|
||||||
loansLoanIdResponse.getRepaymentSchedule().getPeriods().get(lastPeriodIndex).getDueDate());
|
loansLoanIdResponse.getRepaymentSchedule().getPeriods().get(lastPeriodIndex).getDueDate());
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void loanTransactionReverseReplayWithChargeOffAndCBR() {
|
public void loanTransactionReverseReplayWithChargeOffAndCBR() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("04 October 2022").dateFormat(DATE_PATTERN).locale("en"));
|
.date("04 October 2022").dateFormat(DATE_PATTERN).locale("en"));
|
||||||
|
|
||||||
@@ -356,7 +359,8 @@ public class LoanTransactionReverseReplayTest {
|
|||||||
assertEquals(1, cbrExpenseJournalEntries.size());
|
assertEquals(1, cbrExpenseJournalEntries.size());
|
||||||
assertEquals(1, cbrAssetJournalEntries.size());
|
assertEquals(1, cbrAssetJournalEntries.size());
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+16
-23
@@ -30,8 +30,9 @@ import io.restassured.specification.ResponseSpecification;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.apache.fineract.client.models.GlobalConfigurationPropertyData;
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.client.models.PutPermissionsRequest;
|
import org.apache.fineract.client.models.PutPermissionsRequest;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.AuditHelper;
|
import org.apache.fineract.integrationtests.common.AuditHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CommonConstants;
|
import org.apache.fineract.integrationtests.common.CommonConstants;
|
||||||
@@ -58,6 +59,7 @@ public class MakercheckerTest {
|
|||||||
private SavingsAccountHelper savingsAccountHelper;
|
private SavingsAccountHelper savingsAccountHelper;
|
||||||
private static final String START_DATE_STRING = "03 June 2023";
|
private static final String START_DATE_STRING = "03 June 2023";
|
||||||
private static final String TRANSACTION_DATE_STRING = "05 June 2023";
|
private static final String TRANSACTION_DATE_STRING = "05 June 2023";
|
||||||
|
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@@ -70,6 +72,7 @@ public class MakercheckerTest {
|
|||||||
this.auditHelper = new AuditHelper(requestSpec, responseSpec);
|
this.auditHelper = new AuditHelper(requestSpec, responseSpec);
|
||||||
this.savingsProductHelper = new SavingsProductHelper();
|
this.savingsProductHelper = new SavingsProductHelper();
|
||||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||||
|
this.globalConfigurationHelper = new GlobalConfigurationHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -82,22 +85,11 @@ public class MakercheckerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testMakerCheckerOn() {
|
public void testMakerCheckerOn() {
|
||||||
GlobalConfigurationPropertyData mcConfig = GlobalConfigurationHelper.getGlobalConfigurationByName(requestSpec, responseSpec,
|
|
||||||
"maker-checker");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.MAKER_CHECKER,
|
||||||
Long mcConfigId = mcConfig.getId();
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
boolean mcConfigUpdate = false;
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_SAME_MAKER_CHECKER,
|
||||||
if (!Boolean.TRUE.equals(mcConfig.getEnabled())) {
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(requestSpec, responseSpec, mcConfigId, true);
|
|
||||||
mcConfigUpdate = true;
|
|
||||||
}
|
|
||||||
GlobalConfigurationPropertyData sameMcConfig = GlobalConfigurationHelper.getGlobalConfigurationByName(requestSpec, responseSpec,
|
|
||||||
"enable-same-maker-checker");
|
|
||||||
Long sameMcConfigId = mcConfig.getId();
|
|
||||||
boolean sameMcConfigUpdate = false;
|
|
||||||
if (Boolean.TRUE.equals(sameMcConfig.getEnabled())) {
|
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(requestSpec, responseSpec, sameMcConfigId, false);
|
|
||||||
sameMcConfigUpdate = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// client permission - maker-checker disabled
|
// client permission - maker-checker disabled
|
||||||
@@ -190,12 +182,13 @@ public class MakercheckerTest {
|
|||||||
CommonConstants.RESPONSE_RESOURCE_ID);
|
CommonConstants.RESPONSE_RESOURCE_ID);
|
||||||
assertNotNull(withdrawalId);
|
assertNotNull(withdrawalId);
|
||||||
} finally {
|
} finally {
|
||||||
if (mcConfigUpdate) {
|
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(requestSpec, responseSpec, mcConfigId, false);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.MAKER_CHECKER,
|
||||||
}
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
if (sameMcConfigUpdate) {
|
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(requestSpec, responseSpec, sameMcConfigId, true);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_SAME_MAKER_CHECKER,
|
||||||
}
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
PutPermissionsRequest putPermissionsRequest = new PutPermissionsRequest().putPermissionsItem("WITHDRAWAL_SAVINGSACCOUNT",
|
PutPermissionsRequest putPermissionsRequest = new PutPermissionsRequest().putPermissionsItem("WITHDRAWAL_SAVINGSACCOUNT",
|
||||||
false);
|
false);
|
||||||
rolesHelper.updatePermissions(putPermissionsRequest);
|
rolesHelper.updatePermissions(putPermissionsRequest);
|
||||||
|
|||||||
+11
-9
@@ -42,16 +42,16 @@ import org.apache.fineract.client.models.PostClientsResponse;
|
|||||||
import org.apache.fineract.client.models.PostLoansLoanIdRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansRequest;
|
import org.apache.fineract.client.models.PostLoansRequest;
|
||||||
import org.apache.fineract.client.models.PostLoansResponse;
|
import org.apache.fineract.client.models.PostLoansResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
||||||
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.impl.AdvancedPaymentScheduleTransactionProcessor;
|
import org.apache.fineract.portfolio.loanaccount.domain.transactionprocessor.impl.AdvancedPaymentScheduleTransactionProcessor;
|
||||||
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleProcessingType;
|
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleProcessingType;
|
||||||
@@ -59,11 +59,9 @@ import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanSchedul
|
|||||||
import org.apache.fineract.portfolio.loanproduct.domain.PaymentAllocationType;
|
import org.apache.fineract.portfolio.loanproduct.domain.PaymentAllocationType;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class RefundForActiveLoansWithAdvancedPaymentAllocationTest {
|
public class RefundForActiveLoansWithAdvancedPaymentAllocationTest extends BaseLoanIntegrationTest {
|
||||||
|
|
||||||
private static final String DATETIME_PATTERN = "dd MMMM yyyy";
|
private static final String DATETIME_PATTERN = "dd MMMM yyyy";
|
||||||
private static final DateTimeFormatter DATE_FORMATTER = new DateTimeFormatterBuilder().appendPattern(DATETIME_PATTERN).toFormatter();
|
private static final DateTimeFormatter DATE_FORMATTER = new DateTimeFormatterBuilder().appendPattern(DATETIME_PATTERN).toFormatter();
|
||||||
@@ -92,7 +90,8 @@ public class RefundForActiveLoansWithAdvancedPaymentAllocationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void refundForActiveLoanWithDefaultPaymentAllocationProcessingVertically() {
|
public void refundForActiveLoanWithDefaultPaymentAllocationProcessingVertically() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("2023.02.15").dateFormat("yyyy.MM.dd").locale("en"));
|
.date("2023.02.15").dateFormat("yyyy.MM.dd").locale("en"));
|
||||||
|
|
||||||
@@ -284,14 +283,16 @@ public class RefundForActiveLoansWithAdvancedPaymentAllocationTest {
|
|||||||
assertEquals(250.0f, thirdRepaymentInstallment.getTotalOutstandingForPeriod());
|
assertEquals(250.0f, thirdRepaymentInstallment.getTotalOutstandingForPeriod());
|
||||||
assertEquals(LocalDate.of(2023, 4, 1), thirdRepaymentInstallment.getDueDate());
|
assertEquals(LocalDate.of(2023, 4, 1), thirdRepaymentInstallment.getDueDate());
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void refundForActiveLoanWithDefaultPaymentAllocationProcessingHorizontally() {
|
public void refundForActiveLoanWithDefaultPaymentAllocationProcessingHorizontally() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("2023.02.15").dateFormat("yyyy.MM.dd").locale("en"));
|
.date("2023.02.15").dateFormat("yyyy.MM.dd").locale("en"));
|
||||||
|
|
||||||
@@ -484,7 +485,8 @@ public class RefundForActiveLoansWithAdvancedPaymentAllocationTest {
|
|||||||
assertEquals(250.0f, thirdRepaymentInstallment.getTotalOutstandingForPeriod());
|
assertEquals(250.0f, thirdRepaymentInstallment.getTotalOutstandingForPeriod());
|
||||||
assertEquals(LocalDate.of(2023, 4, 1), thirdRepaymentInstallment.getDueDate());
|
assertEquals(LocalDate.of(2023, 4, 1), thirdRepaymentInstallment.getDueDate());
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -66,6 +66,7 @@ public class SavingsAccountRecalculateBalanceTest {
|
|||||||
private SavingsProductHelper savingsProductHelper;
|
private SavingsProductHelper savingsProductHelper;
|
||||||
private SchedulerJobHelper scheduleJobHelper;
|
private SchedulerJobHelper scheduleJobHelper;
|
||||||
private PaymentTypeHelper paymentTypeHelper;
|
private PaymentTypeHelper paymentTypeHelper;
|
||||||
|
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@@ -75,6 +76,7 @@ public class SavingsAccountRecalculateBalanceTest {
|
|||||||
this.requestSpec.header("Fineract-Platform-TenantId", "default");
|
this.requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
this.paymentTypeHelper = new PaymentTypeHelper();
|
this.paymentTypeHelper = new PaymentTypeHelper();
|
||||||
|
this.globalConfigurationHelper = new GlobalConfigurationHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -224,7 +226,7 @@ public class SavingsAccountRecalculateBalanceTest {
|
|||||||
|
|
||||||
@AfterEach
|
@AfterEach
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.resetAllDefaultGlobalConfigurations();
|
||||||
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.verifyAllDefaultGlobalConfigurations();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-2
@@ -63,6 +63,7 @@ public class SavingsAccountTransactionDatatableIntegrationTest {
|
|||||||
private DatatableHelper datatableHelper;
|
private DatatableHelper datatableHelper;
|
||||||
private SavingsProductHelper savingsProductHelper;
|
private SavingsProductHelper savingsProductHelper;
|
||||||
private SavingsAccountHelper savingsAccountHelper;
|
private SavingsAccountHelper savingsAccountHelper;
|
||||||
|
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@@ -73,6 +74,7 @@ public class SavingsAccountTransactionDatatableIntegrationTest {
|
|||||||
this.datatableHelper = new DatatableHelper(this.requestSpec, this.responseSpec);
|
this.datatableHelper = new DatatableHelper(this.requestSpec, this.responseSpec);
|
||||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||||
this.savingsProductHelper = new SavingsProductHelper();
|
this.savingsProductHelper = new SavingsProductHelper();
|
||||||
|
this.globalConfigurationHelper = new GlobalConfigurationHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -244,7 +246,7 @@ public class SavingsAccountTransactionDatatableIntegrationTest {
|
|||||||
// Reset configuration fields
|
// Reset configuration fields
|
||||||
@AfterEach
|
@AfterEach
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.resetAllDefaultGlobalConfigurations();
|
||||||
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.verifyAllDefaultGlobalConfigurations();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-10
@@ -31,7 +31,6 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
|
|||||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import io.restassured.builder.RequestSpecBuilder;
|
import io.restassured.builder.RequestSpecBuilder;
|
||||||
@@ -56,7 +55,9 @@ import java.util.stream.Collectors;
|
|||||||
import org.apache.fineract.batch.domain.BatchRequest;
|
import org.apache.fineract.batch.domain.BatchRequest;
|
||||||
import org.apache.fineract.batch.domain.BatchResponse;
|
import org.apache.fineract.batch.domain.BatchResponse;
|
||||||
import org.apache.fineract.batch.domain.Header;
|
import org.apache.fineract.batch.domain.Header;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
||||||
import org.apache.fineract.integrationtests.common.BatchHelper;
|
import org.apache.fineract.integrationtests.common.BatchHelper;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
@@ -91,6 +92,7 @@ public class SavingsAccountTransactionTest {
|
|||||||
private SavingsProductHelper savingsProductHelper;
|
private SavingsProductHelper savingsProductHelper;
|
||||||
private SavingsAccountHelper savingsAccountHelper;
|
private SavingsAccountHelper savingsAccountHelper;
|
||||||
private DatatableHelper datatableHelper;
|
private DatatableHelper datatableHelper;
|
||||||
|
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@@ -103,13 +105,15 @@ public class SavingsAccountTransactionTest {
|
|||||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||||
this.savingsProductHelper = new SavingsProductHelper();
|
this.savingsProductHelper = new SavingsProductHelper();
|
||||||
this.datatableHelper = new DatatableHelper(this.requestSpec, this.responseSpec);
|
this.datatableHelper = new DatatableHelper(this.requestSpec, this.responseSpec);
|
||||||
|
globalConfigurationHelper = new GlobalConfigurationHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void verifySavingsTransactionSubmittedOnDateAndTransactionDate() throws JsonProcessingException {
|
public void verifySavingsTransactionSubmittedOnDateAndTransactionDate() {
|
||||||
LocalDate today = Utils.getLocalDateOfTenant();
|
LocalDate today = Utils.getLocalDateOfTenant();
|
||||||
try {
|
try {
|
||||||
enableBusinessDate(requestSpec, responseSpec, true);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, today);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, today);
|
||||||
|
|
||||||
LocalDate depositDate = Utils.getDateAsLocalDate(depositDateString);
|
LocalDate depositDate = Utils.getDateAsLocalDate(depositDateString);
|
||||||
@@ -124,7 +128,8 @@ public class SavingsAccountTransactionTest {
|
|||||||
performSavingsTransaction(savingsId, "100", depositDate, true);
|
performSavingsTransaction(savingsId, "100", depositDate, true);
|
||||||
performSavingsTransaction(savingsId, "50", withdrawDate, false);
|
performSavingsTransaction(savingsId, "50", withdrawDate, false);
|
||||||
} finally {
|
} finally {
|
||||||
enableBusinessDate(requestSpec, responseSpec, false);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -277,10 +282,6 @@ public class SavingsAccountTransactionTest {
|
|||||||
log.info("\nFinished all threads");
|
log.info("\nFinished all threads");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void enableBusinessDate(RequestSpecification requestSpec, ResponseSpecification responseSpec, boolean enable) {
|
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, enable);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void performSavingsTransaction(Integer savingsId, String amount, LocalDate transactionDate, boolean isDeposit) {
|
private void performSavingsTransaction(Integer savingsId, String amount, LocalDate transactionDate, boolean isDeposit) {
|
||||||
String transactionType = isDeposit ? "Deposit" : "Withdrawal";
|
String transactionType = isDeposit ? "Deposit" : "Withdrawal";
|
||||||
Integer transactionId = isDeposit
|
Integer transactionId = isDeposit
|
||||||
@@ -456,7 +457,7 @@ public class SavingsAccountTransactionTest {
|
|||||||
// Reset configuration fields
|
// Reset configuration fields
|
||||||
@AfterEach
|
@AfterEach
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.resetAllDefaultGlobalConfigurations();
|
||||||
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.verifyAllDefaultGlobalConfigurations();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-4
@@ -36,8 +36,10 @@ import java.util.Locale;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import org.apache.fineract.client.models.GetSavingsAccountTransactionsPageItem;
|
import org.apache.fineract.client.models.GetSavingsAccountTransactionsPageItem;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.client.models.SavingsAccountTransactionsSearchResponse;
|
import org.apache.fineract.client.models.SavingsAccountTransactionsSearchResponse;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
||||||
import org.apache.fineract.infrastructure.core.service.MathUtil;
|
import org.apache.fineract.infrastructure.core.service.MathUtil;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
@@ -76,6 +78,7 @@ public class SavingsAccountTransactionsSearchIntegrationTest {
|
|||||||
private SavingsProductHelper savingsProductHelper;
|
private SavingsProductHelper savingsProductHelper;
|
||||||
private SavingsAccountHelper savingsAccountHelper;
|
private SavingsAccountHelper savingsAccountHelper;
|
||||||
private SavingsAccountHelper savingsAccountHelperValidationError;
|
private SavingsAccountHelper savingsAccountHelperValidationError;
|
||||||
|
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@@ -87,6 +90,7 @@ public class SavingsAccountTransactionsSearchIntegrationTest {
|
|||||||
this.responseSpecForValidationError = new ResponseSpecBuilder().expectStatusCode(400).build();
|
this.responseSpecForValidationError = new ResponseSpecBuilder().expectStatusCode(400).build();
|
||||||
this.savingsAccountHelperValidationError = new SavingsAccountHelper(this.requestSpec, this.responseSpecForValidationError);
|
this.savingsAccountHelperValidationError = new SavingsAccountHelper(this.requestSpec, this.responseSpecForValidationError);
|
||||||
this.savingsProductHelper = new SavingsProductHelper();
|
this.savingsProductHelper = new SavingsProductHelper();
|
||||||
|
this.globalConfigurationHelper = new GlobalConfigurationHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -167,14 +171,16 @@ public class SavingsAccountTransactionsSearchIntegrationTest {
|
|||||||
final Integer savingsId = createSavingsAccountDailyPosting(clientID, startDate);
|
final Integer savingsId = createSavingsAccountDailyPosting(clientID, startDate);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, true);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, businessDate);
|
||||||
|
|
||||||
this.savingsAccountHelper.depositToSavingsAccount(savingsId, "100", firstDepositDate, CommonConstants.RESPONSE_RESOURCE_ID);
|
this.savingsAccountHelper.depositToSavingsAccount(savingsId, "100", firstDepositDate, CommonConstants.RESPONSE_RESOURCE_ID);
|
||||||
this.savingsAccountHelper.depositToSavingsAccount(savingsId, "300", secondDepositDate, CommonConstants.RESPONSE_RESOURCE_ID);
|
this.savingsAccountHelper.depositToSavingsAccount(savingsId, "300", secondDepositDate, CommonConstants.RESPONSE_RESOURCE_ID);
|
||||||
this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, "100", withdrawDate, CommonConstants.RESPONSE_RESOURCE_ID);
|
this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, "100", withdrawDate, CommonConstants.RESPONSE_RESOURCE_ID);
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, false);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
String submittedDate = DateUtils.format(businessDate, DEFAULT_DATE_FORMAT, DEFAULT_LOCALE);
|
String submittedDate = DateUtils.format(businessDate, DEFAULT_DATE_FORMAT, DEFAULT_LOCALE);
|
||||||
TransactionSearchRequest searchParameters = new TransactionSearchRequest()
|
TransactionSearchRequest searchParameters = new TransactionSearchRequest()
|
||||||
@@ -454,8 +460,8 @@ public class SavingsAccountTransactionsSearchIntegrationTest {
|
|||||||
// Reset configuration fields
|
// Reset configuration fields
|
||||||
@AfterEach
|
@AfterEach
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.resetAllDefaultGlobalConfigurations();
|
||||||
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.verifyAllDefaultGlobalConfigurations();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-4
@@ -32,7 +32,9 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
@@ -59,6 +61,7 @@ public class SavingsInterestPostingIntegrationTest {
|
|||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
private SavingsProductHelper savingsProductHelper;
|
private SavingsProductHelper savingsProductHelper;
|
||||||
private SavingsAccountHelper savingsAccountHelper;
|
private SavingsAccountHelper savingsAccountHelper;
|
||||||
|
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@@ -68,13 +71,15 @@ public class SavingsInterestPostingIntegrationTest {
|
|||||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||||
this.savingsProductHelper = new SavingsProductHelper();
|
this.savingsProductHelper = new SavingsProductHelper();
|
||||||
|
this.globalConfigurationHelper = new GlobalConfigurationHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSavingsDailyInterestPosting() {
|
public void testSavingsDailyInterestPosting() {
|
||||||
LocalDate today = Utils.getLocalDateOfTenant();
|
LocalDate today = Utils.getLocalDateOfTenant();
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, true);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, today);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, today);
|
||||||
// client activation, savings activation and 1st transaction date
|
// client activation, savings activation and 1st transaction date
|
||||||
final String startDate = "01 November 2021";
|
final String startDate = "01 November 2021";
|
||||||
@@ -102,7 +107,8 @@ public class SavingsInterestPostingIntegrationTest {
|
|||||||
Collectors.collectingAndThen(Collectors.toList(), list -> LocalDate.of(list.get(0), list.get(1), list.get(2))));
|
Collectors.collectingAndThen(Collectors.toList(), list -> LocalDate.of(list.get(0), list.get(1), list.get(2))));
|
||||||
assertTrue(DateUtils.isEqual(submittedOnDate, today), "Submitted On Date check for Interest Posting transaction");
|
assertTrue(DateUtils.isEqual(submittedOnDate, today), "Submitted On Date check for Interest Posting transaction");
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, false);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -129,8 +135,8 @@ public class SavingsInterestPostingIntegrationTest {
|
|||||||
// Reset configuration fields
|
// Reset configuration fields
|
||||||
@AfterEach
|
@AfterEach
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.resetAllDefaultGlobalConfigurations();
|
||||||
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.verifyAllDefaultGlobalConfigurations();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-4
@@ -32,7 +32,9 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
@@ -68,6 +70,7 @@ public class SavingsInterestPostingJobIntegrationTest {
|
|||||||
private SchedulerJobHelper scheduleJobHelper;
|
private SchedulerJobHelper scheduleJobHelper;
|
||||||
private JournalEntryHelper journalEntryHelper;
|
private JournalEntryHelper journalEntryHelper;
|
||||||
private AccountHelper accountHelper;
|
private AccountHelper accountHelper;
|
||||||
|
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@@ -78,6 +81,7 @@ public class SavingsInterestPostingJobIntegrationTest {
|
|||||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||||
this.savingsProductHelper = new SavingsProductHelper();
|
this.savingsProductHelper = new SavingsProductHelper();
|
||||||
this.scheduleJobHelper = new SchedulerJobHelper(requestSpec);
|
this.scheduleJobHelper = new SchedulerJobHelper(requestSpec);
|
||||||
|
this.globalConfigurationHelper = new GlobalConfigurationHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -149,7 +153,8 @@ public class SavingsInterestPostingJobIntegrationTest {
|
|||||||
public void testSavingsDailyInterestPostingJob() {
|
public void testSavingsDailyInterestPostingJob() {
|
||||||
LocalDate today = Utils.getLocalDateOfTenant();
|
LocalDate today = Utils.getLocalDateOfTenant();
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, true);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, today);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, today);
|
||||||
// client activation, savings activation and 1st transaction date
|
// client activation, savings activation and 1st transaction date
|
||||||
final String startDate = "10 April 2022";
|
final String startDate = "10 April 2022";
|
||||||
@@ -178,7 +183,8 @@ public class SavingsInterestPostingJobIntegrationTest {
|
|||||||
Collectors.collectingAndThen(Collectors.toList(), list -> LocalDate.of(list.get(0), list.get(1), list.get(2))));
|
Collectors.collectingAndThen(Collectors.toList(), list -> LocalDate.of(list.get(0), list.get(1), list.get(2))));
|
||||||
assertTrue(DateUtils.isEqual(submittedOnDate, today), "Submitted On Date check for Interest Posting transaction");
|
assertTrue(DateUtils.isEqual(submittedOnDate, today), "Submitted On Date check for Interest Posting transaction");
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, false);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -318,8 +324,8 @@ public class SavingsInterestPostingJobIntegrationTest {
|
|||||||
// Reset configuration fields
|
// Reset configuration fields
|
||||||
@AfterEach
|
@AfterEach
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.resetAllDefaultGlobalConfigurations();
|
||||||
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.verifyAllDefaultGlobalConfigurations();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-5
@@ -22,15 +22,15 @@ import static org.awaitility.Awaitility.await;
|
|||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
import io.restassured.builder.RequestSpecBuilder;
|
import io.restassured.builder.RequestSpecBuilder;
|
||||||
import io.restassured.builder.ResponseSpecBuilder;
|
|
||||||
import io.restassured.http.ContentType;
|
import io.restassured.http.ContentType;
|
||||||
import io.restassured.specification.RequestSpecification;
|
import io.restassured.specification.RequestSpecification;
|
||||||
import io.restassured.specification.ResponseSpecification;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.jobs.service.JobName;
|
import org.apache.fineract.infrastructure.jobs.service.JobName;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
||||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||||
@@ -47,6 +47,7 @@ public class SchedulerJobsTest {
|
|||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
private SchedulerJobHelper schedulerJobHelper;
|
private SchedulerJobHelper schedulerJobHelper;
|
||||||
private Boolean originalSchedulerStatus;
|
private Boolean originalSchedulerStatus;
|
||||||
|
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@@ -61,6 +62,7 @@ public class SchedulerJobsTest {
|
|||||||
Boolean active = (Boolean) schedulerJob.get("active");
|
Boolean active = (Boolean) schedulerJob.get("active");
|
||||||
originalJobStatus.put(jobId, active);
|
originalJobStatus.put(jobId, active);
|
||||||
}
|
}
|
||||||
|
globalConfigurationHelper = new GlobalConfigurationHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterEach
|
@AfterEach
|
||||||
@@ -135,14 +137,15 @@ public class SchedulerJobsTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTriggeringManualExecutionOfAllSchedulerJobs() {
|
public void testTriggeringManualExecutionOfAllSchedulerJobs() {
|
||||||
ResponseSpecification responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
for (String jobName : schedulerJobHelper.getAllSchedulerJobNames()) {
|
for (String jobName : schedulerJobHelper.getAllSchedulerJobNames()) {
|
||||||
schedulerJobHelper.executeAndAwaitJob(jobName);
|
schedulerJobHelper.executeAndAwaitJob(jobName);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+48
-55
@@ -56,8 +56,10 @@ import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
|||||||
import org.apache.fineract.client.models.JournalEntryTransactionItem;
|
import org.apache.fineract.client.models.JournalEntryTransactionItem;
|
||||||
import org.apache.fineract.client.models.PostClientsResponse;
|
import org.apache.fineract.client.models.PostClientsResponse;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.client.models.PutJobsJobIDRequest;
|
import org.apache.fineract.client.models.PutJobsJobIDRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessStepHelper;
|
import org.apache.fineract.integrationtests.common.BusinessStepHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
@@ -124,6 +126,7 @@ public class SchedulerJobsTestResults {
|
|||||||
private DateTimeFormatter dateFormatter = new DateTimeFormatterBuilder().appendPattern("dd MMMM yyyy").toFormatter();
|
private DateTimeFormatter dateFormatter = new DateTimeFormatterBuilder().appendPattern("dd MMMM yyyy").toFormatter();
|
||||||
private BusinessDateHelper businessDateHelper;
|
private BusinessDateHelper businessDateHelper;
|
||||||
private static BusinessStepHelper businessStepHelper;
|
private static BusinessStepHelper businessStepHelper;
|
||||||
|
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void beforeAll() {
|
public static void beforeAll() {
|
||||||
@@ -147,19 +150,21 @@ public class SchedulerJobsTestResults {
|
|||||||
clientHelper = new ClientHelper(requestSpec, responseSpec);
|
clientHelper = new ClientHelper(requestSpec, responseSpec);
|
||||||
this.businessDateHelper = new BusinessDateHelper();
|
this.businessDateHelper = new BusinessDateHelper();
|
||||||
this.systemTimeZone = TimeZone.getTimeZone(Utils.TENANT_TIME_ZONE);
|
this.systemTimeZone = TimeZone.getTimeZone(Utils.TENANT_TIME_ZONE);
|
||||||
|
globalConfigurationHelper = new GlobalConfigurationHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterEach
|
@AfterEach
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(requestSpec, responseSpec);
|
globalConfigurationHelper.resetAllDefaultGlobalConfigurations();
|
||||||
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(requestSpec, responseSpec);
|
globalConfigurationHelper.verifyAllDefaultGlobalConfigurations();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testApplyAnnualFeeForSavingsJobOutcome() throws InterruptedException {
|
public void testApplyAnnualFeeForSavingsJobOutcome() throws InterruptedException {
|
||||||
Integer savingsId = null;
|
Integer savingsId = null;
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
LocalDate submittedDate = LocalDate.of(2022, 9, 28);
|
LocalDate submittedDate = LocalDate.of(2022, 9, 28);
|
||||||
String submittedDateString = "28 September 2022";
|
String submittedDateString = "28 September 2022";
|
||||||
@@ -211,7 +216,8 @@ public class SchedulerJobsTestResults {
|
|||||||
.isEquivalentAccordingToCompareTo(expectedDueDate);
|
.isEquivalentAccordingToCompareTo(expectedDueDate);
|
||||||
} finally {
|
} finally {
|
||||||
savingsAccountHelper.closeSavingsAccountOnDate(savingsId, "true", "11 November 2022");
|
savingsAccountHelper.closeSavingsAccountOnDate(savingsId, "true", "11 November 2022");
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -343,24 +349,10 @@ public class SchedulerJobsTestResults {
|
|||||||
JsonPath.from(loanDetails).get("netDisbursalAmount").toString());
|
JsonPath.from(loanDetails).get("netDisbursalAmount").toString());
|
||||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||||
|
|
||||||
// Retrieving All Global Configuration details
|
|
||||||
final ArrayList<HashMap> globalConfig = GlobalConfigurationHelper.getAllGlobalConfigurations(requestSpec, responseSpec);
|
|
||||||
Assertions.assertNotNull(globalConfig);
|
|
||||||
|
|
||||||
// Updating Value for reschedule-repayments-on-holidays Global
|
// Updating Value for reschedule-repayments-on-holidays Global
|
||||||
// Configuration
|
// Configuration
|
||||||
Integer configId = (Integer) globalConfig.get(3).get("id");
|
String configName = GlobalConfigurationConstants.RESCHEDULE_REPAYMENTS_ON_HOLIDAYS;
|
||||||
Assertions.assertNotNull(configId);
|
globalConfigurationHelper.updateGlobalConfiguration(configName, new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
HashMap configData = GlobalConfigurationHelper.getGlobalConfigurationById(requestSpec, responseSpec, configId.toString());
|
|
||||||
Assertions.assertNotNull(configData);
|
|
||||||
|
|
||||||
Boolean enabled = (Boolean) globalConfig.get(3).get("enabled");
|
|
||||||
|
|
||||||
if (!enabled) {
|
|
||||||
enabled = true;
|
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(requestSpec, responseSpec, configId, enabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
holidayId = HolidayHelper.activateHolidays(requestSpec, responseSpec, holidayId.toString());
|
holidayId = HolidayHelper.activateHolidays(requestSpec, responseSpec, holidayId.toString());
|
||||||
Assertions.assertNotNull(holidayId);
|
Assertions.assertNotNull(holidayId);
|
||||||
@@ -457,24 +449,8 @@ public class SchedulerJobsTestResults {
|
|||||||
JsonPath.from(loanDetails).get("netDisbursalAmount").toString());
|
JsonPath.from(loanDetails).get("netDisbursalAmount").toString());
|
||||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||||
|
|
||||||
// Retrieving All Global Configuration details
|
String configName = GlobalConfigurationConstants.RESCHEDULE_REPAYMENTS_ON_HOLIDAYS;
|
||||||
final ArrayList<HashMap> globalConfig = GlobalConfigurationHelper.getAllGlobalConfigurations(requestSpec, responseSpec);
|
globalConfigurationHelper.updateGlobalConfiguration(configName, new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
Assertions.assertNotNull(globalConfig);
|
|
||||||
|
|
||||||
// Updating Value for reschedule-repayments-on-holidays Global
|
|
||||||
// Configuration
|
|
||||||
Integer configId = (Integer) globalConfig.get(3).get("id");
|
|
||||||
Assertions.assertNotNull(configId);
|
|
||||||
|
|
||||||
HashMap configData = GlobalConfigurationHelper.getGlobalConfigurationById(requestSpec, responseSpec, configId.toString());
|
|
||||||
Assertions.assertNotNull(configData);
|
|
||||||
|
|
||||||
Boolean enabled = (Boolean) globalConfig.get(3).get("enabled");
|
|
||||||
|
|
||||||
if (!enabled) {
|
|
||||||
enabled = true;
|
|
||||||
GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(requestSpec, responseSpec, configId, enabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
holidayId = HolidayHelper.activateHolidays(requestSpec, responseSpec, holidayId.toString());
|
holidayId = HolidayHelper.activateHolidays(requestSpec, responseSpec, holidayId.toString());
|
||||||
Assertions.assertNotNull(holidayId);
|
Assertions.assertNotNull(holidayId);
|
||||||
@@ -877,7 +853,8 @@ public class SchedulerJobsTestResults {
|
|||||||
@Test
|
@Test
|
||||||
public void testLoanCOBJobOutcome() {
|
public void testLoanCOBJobOutcome() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
|
this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
|
||||||
this.loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
this.loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||||
|
|
||||||
@@ -937,14 +914,16 @@ public class SchedulerJobsTestResults {
|
|||||||
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLoanCOBJobOutcomeWhileAddingFeeOnDisbursementDate() {
|
public void testLoanCOBJobOutcomeWhileAddingFeeOnDisbursementDate() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.COB_DATE, LocalDate.of(2020, 6, 2));
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.COB_DATE, LocalDate.of(2020, 6, 2));
|
||||||
this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
|
this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
|
||||||
@@ -1003,14 +982,16 @@ public class SchedulerJobsTestResults {
|
|||||||
assertEquals(LocalDate.of(2020, 6, 2), journalEntries.get(1).getTransactionDate());
|
assertEquals(LocalDate.of(2020, 6, 2), journalEntries.get(1).getTransactionDate());
|
||||||
assertEquals(LocalDate.of(2020, 6, 2), journalEntries.get(0).getTransactionDate());
|
assertEquals(LocalDate.of(2020, 6, 2), journalEntries.get(0).getTransactionDate());
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLoanCOBRunsOnlyOnLoansOneDayBehind() {
|
public void testLoanCOBRunsOnlyOnLoansOneDayBehind() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||||
|
|
||||||
@@ -1058,17 +1039,20 @@ public class SchedulerJobsTestResults {
|
|||||||
loan = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanID);
|
loan = loanTransactionHelper.getLoan(requestSpec, responseSpec, loanID);
|
||||||
Assertions.assertEquals(LocalDate.of(2020, 7, 3), loan.getLastClosedBusinessDate());
|
Assertions.assertEquals(LocalDate.of(2020, 7, 3), loan.getLastClosedBusinessDate());
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLoanCOBApplyPenaltyOnDue() {
|
public void testLoanCOBApplyPenaltyOnDue() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.COB_DATE, LocalDate.of(2019, 2, 2));
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.COB_DATE, LocalDate.of(2019, 2, 2));
|
||||||
// set penalty wait period to 0
|
// set penalty wait period to 0
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "0");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(0L));
|
||||||
this.loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
this.loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||||
|
|
||||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec);
|
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec);
|
||||||
@@ -1118,18 +1102,22 @@ public class SchedulerJobsTestResults {
|
|||||||
Assertions.assertEquals(4, ((List) transactions.get(2).get("date")).get(1));
|
Assertions.assertEquals(4, ((List) transactions.get(2).get("date")).get(1));
|
||||||
Assertions.assertEquals(2, ((List) transactions.get(2).get("date")).get(2));
|
Assertions.assertEquals(2, ((List) transactions.get(2).get("date")).get(2));
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "2");
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(2L));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLoanCOBApplyPenaltyOnDue1DayGracePeriod() {
|
public void testLoanCOBApplyPenaltyOnDue1DayGracePeriod() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.COB_DATE, LocalDate.of(2020, 2, 2));
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.COB_DATE, LocalDate.of(2020, 2, 2));
|
||||||
// set penalty wait period to 0
|
// set penalty wait period to 0
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "0");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(0L));
|
||||||
this.loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
this.loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||||
|
|
||||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec);
|
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec);
|
||||||
@@ -1158,7 +1146,8 @@ public class SchedulerJobsTestResults {
|
|||||||
JsonPath.from(loanDetails2).get("netDisbursalAmount").toString());
|
JsonPath.from(loanDetails2).get("netDisbursalAmount").toString());
|
||||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||||
|
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "1");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(1L));
|
||||||
LocalDate dateToFastForward = LocalDate.of(2020, 5, 2);
|
LocalDate dateToFastForward = LocalDate.of(2020, 5, 2);
|
||||||
String jobName = "Loan COB";
|
String jobName = "Loan COB";
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.COB_DATE, dateToFastForward);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.COB_DATE, dateToFastForward);
|
||||||
@@ -1180,8 +1169,10 @@ public class SchedulerJobsTestResults {
|
|||||||
Assertions.assertEquals(5, ((List) transactions.get(2).get("date")).get(1));
|
Assertions.assertEquals(5, ((List) transactions.get(2).get("date")).get(1));
|
||||||
Assertions.assertEquals(2, ((List) transactions.get(2).get("date")).get(2));
|
Assertions.assertEquals(2, ((List) transactions.get(2).get("date")).get(2));
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "2");
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(2L));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1356,7 +1347,8 @@ public class SchedulerJobsTestResults {
|
|||||||
public void businessDateIsCorrectForCronJob() throws InterruptedException {
|
public void businessDateIsCorrectForCronJob() throws InterruptedException {
|
||||||
this.loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
this.loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
businessDateHelper.updateBusinessDate(new BusinessDateRequest().type(BusinessDateType.BUSINESS_DATE.getName())
|
||||||
.date("2022.09.04").dateFormat("yyyy.MM.dd").locale("en"));
|
.date("2022.09.04").dateFormat("yyyy.MM.dd").locale("en"));
|
||||||
|
|
||||||
@@ -1400,7 +1392,8 @@ public class SchedulerJobsTestResults {
|
|||||||
GetLoansLoanIdResponse loanDetails = this.loanTransactionHelper.getLoanDetails((long) loanId);
|
GetLoansLoanIdResponse loanDetails = this.loanTransactionHelper.getLoanDetails((long) loanId);
|
||||||
assertEquals(LocalDate.of(2022, 9, 5), loanDetails.getTransactions().get(1).getDate());
|
assertEquals(LocalDate.of(2022, 9, 5), loanDetails.getTransactions().get(1).getDate());
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
this.schedulerJobHelper.updateSchedulerJob(16L, new PutJobsJobIDRequest().cronExpression("0 2 0 1/1 * ? *"));
|
this.schedulerJobHelper.updateSchedulerJob(16L, new PutJobsJobIDRequest().cronExpression("0 2 0 1/1 * ? *"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-22
@@ -30,6 +30,9 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsResponse;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.CalendarHelper;
|
import org.apache.fineract.integrationtests.common.CalendarHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
||||||
@@ -58,7 +61,6 @@ public class SkipRepaymentOnMonthFirstTest {
|
|||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
private GlobalConfigurationHelper globalConfigurationHelper;
|
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||||
private LoanTransactionHelper loanTransactionHelper;
|
private LoanTransactionHelper loanTransactionHelper;
|
||||||
private CalendarHelper calendarHelper;
|
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@@ -66,39 +68,26 @@ public class SkipRepaymentOnMonthFirstTest {
|
|||||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
|
this.globalConfigurationHelper = new GlobalConfigurationHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterEach
|
@AfterEach
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.resetAllDefaultGlobalConfigurations();
|
||||||
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
globalConfigurationHelper.verifyAllDefaultGlobalConfigurations();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testSkippingRepaymentOnFirstDayOfMonth() {
|
public void testSkippingRepaymentOnFirstDayOfMonth() {
|
||||||
this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec);
|
|
||||||
|
|
||||||
// Retrieving All Global Configuration details
|
|
||||||
final ArrayList<HashMap> globalConfig = GlobalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
|
|
||||||
Assertions.assertNotNull(globalConfig);
|
|
||||||
|
|
||||||
String configName = "skip-repayment-on-first-day-of-month";
|
|
||||||
boolean newBooleanValue = true;
|
boolean newBooleanValue = true;
|
||||||
|
PutGlobalConfigurationsResponse response = globalConfigurationHelper.updateGlobalConfiguration(
|
||||||
for (Integer configIndex = 0; configIndex < globalConfig.size(); configIndex++) {
|
GlobalConfigurationConstants.SKIP_REPAYMENT_ON_FIRST_DAY_OF_MONTH,
|
||||||
if (globalConfig.get(configIndex).get("name").equals(configName)) {
|
new PutGlobalConfigurationsRequest().enabled(newBooleanValue));
|
||||||
String configId = globalConfig.get(configIndex).get("id").toString();
|
Assertions.assertNotNull(response);
|
||||||
Integer updateConfigId = GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec,
|
|
||||||
this.responseSpec, configId.toString(), newBooleanValue);
|
|
||||||
Assertions.assertNotNull(updateConfigId);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void checkRepaymentSkipOnFirstDayOfMonth() {
|
public void checkRepaymentSkipOnFirstDayOfMonth() {
|
||||||
|
testSkippingRepaymentOnFirstDayOfMonth();
|
||||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||||
|
|
||||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||||
|
|||||||
+5
-35
@@ -32,10 +32,8 @@ import java.time.LocalDate;
|
|||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.time.format.DateTimeFormatterBuilder;
|
import java.time.format.DateTimeFormatterBuilder;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
import org.apache.fineract.client.models.AdvancedPaymentData;
|
import org.apache.fineract.client.models.AdvancedPaymentData;
|
||||||
import org.apache.fineract.client.models.AllowAttributeOverrides;
|
import org.apache.fineract.client.models.AllowAttributeOverrides;
|
||||||
import org.apache.fineract.client.models.ChargeData;
|
import org.apache.fineract.client.models.ChargeData;
|
||||||
@@ -44,17 +42,17 @@ import org.apache.fineract.client.models.GetLoanFeeToIncomeAccountMappings;
|
|||||||
import org.apache.fineract.client.models.GetLoanPaymentChannelToFundSourceMappings;
|
import org.apache.fineract.client.models.GetLoanPaymentChannelToFundSourceMappings;
|
||||||
import org.apache.fineract.client.models.GetLoanProductsProductIdResponse;
|
import org.apache.fineract.client.models.GetLoanProductsProductIdResponse;
|
||||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||||
import org.apache.fineract.client.models.PaymentAllocationOrder;
|
|
||||||
import org.apache.fineract.client.models.PostLoanProductsRequest;
|
import org.apache.fineract.client.models.PostLoanProductsRequest;
|
||||||
import org.apache.fineract.client.models.PostLoanProductsResponse;
|
import org.apache.fineract.client.models.PostLoanProductsResponse;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsResponse;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsTransactionIdRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsTransactionIdRequest;
|
||||||
import org.apache.fineract.client.models.PostPaymentTypesRequest;
|
import org.apache.fineract.client.models.PostPaymentTypesRequest;
|
||||||
import org.apache.fineract.client.models.PostPaymentTypesResponse;
|
import org.apache.fineract.client.models.PostPaymentTypesResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.PaymentTypeHelper;
|
import org.apache.fineract.integrationtests.common.PaymentTypeHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
@@ -64,19 +62,15 @@ import org.apache.fineract.integrationtests.common.funds.FundsHelper;
|
|||||||
import org.apache.fineract.integrationtests.common.funds.FundsResourceHandler;
|
import org.apache.fineract.integrationtests.common.funds.FundsResourceHandler;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductHelper;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
|
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
|
||||||
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleProcessingType;
|
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleProcessingType;
|
||||||
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleType;
|
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleType;
|
||||||
import org.apache.fineract.portfolio.loanproduct.domain.PaymentAllocationType;
|
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
|
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class UndoRepaymentWithDownPaymentIntegrationTest extends BaseLoanIntegrationTest {
|
||||||
public class UndoRepaymentWithDownPaymentIntegrationTest {
|
|
||||||
|
|
||||||
private static final DateTimeFormatter DATE_FORMATTER = new DateTimeFormatterBuilder().appendPattern("dd MMMM yyyy").toFormatter();
|
private static final DateTimeFormatter DATE_FORMATTER = new DateTimeFormatterBuilder().appendPattern("dd MMMM yyyy").toFormatter();
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
@@ -147,7 +141,8 @@ public class UndoRepaymentWithDownPaymentIntegrationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void undoRepaymentWithDownPaymentAndAdvancedPaymentAllocationTest() {
|
public void undoRepaymentWithDownPaymentAndAdvancedPaymentAllocationTest() {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
String loanExternalIdStr = UUID.randomUUID().toString();
|
String loanExternalIdStr = UUID.randomUUID().toString();
|
||||||
|
|
||||||
@@ -365,29 +360,4 @@ public class UndoRepaymentWithDownPaymentIntegrationTest {
|
|||||||
|
|
||||||
return Long.valueOf(fundId);
|
return Long.valueOf(fundId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private AdvancedPaymentData createDefaultPaymentAllocation(String futureInstallmentAllocationRule) {
|
|
||||||
AdvancedPaymentData advancedPaymentData = new AdvancedPaymentData();
|
|
||||||
advancedPaymentData.setTransactionType("DEFAULT");
|
|
||||||
advancedPaymentData.setFutureInstallmentAllocationRule(futureInstallmentAllocationRule);
|
|
||||||
|
|
||||||
List<PaymentAllocationOrder> paymentAllocationOrders = getPaymentAllocationOrder(PaymentAllocationType.PAST_DUE_PENALTY,
|
|
||||||
PaymentAllocationType.PAST_DUE_FEE, PaymentAllocationType.PAST_DUE_PRINCIPAL, PaymentAllocationType.PAST_DUE_INTEREST,
|
|
||||||
PaymentAllocationType.DUE_PENALTY, PaymentAllocationType.DUE_FEE, PaymentAllocationType.DUE_PRINCIPAL,
|
|
||||||
PaymentAllocationType.DUE_INTEREST, PaymentAllocationType.IN_ADVANCE_PENALTY, PaymentAllocationType.IN_ADVANCE_FEE,
|
|
||||||
PaymentAllocationType.IN_ADVANCE_PRINCIPAL, PaymentAllocationType.IN_ADVANCE_INTEREST);
|
|
||||||
|
|
||||||
advancedPaymentData.setPaymentAllocationOrder(paymentAllocationOrders);
|
|
||||||
return advancedPaymentData;
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<PaymentAllocationOrder> getPaymentAllocationOrder(PaymentAllocationType... paymentAllocationTypes) {
|
|
||||||
AtomicInteger integer = new AtomicInteger(1);
|
|
||||||
return Arrays.stream(paymentAllocationTypes).map(pat -> {
|
|
||||||
PaymentAllocationOrder paymentAllocationOrder = new PaymentAllocationOrder();
|
|
||||||
paymentAllocationOrder.setPaymentAllocationRule(pat.name());
|
|
||||||
paymentAllocationOrder.setOrder(integer.getAndIncrement());
|
|
||||||
return paymentAllocationOrder;
|
|
||||||
}).toList();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-12
@@ -42,11 +42,13 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.fineract.accounting.common.AccountingConstants;
|
import org.apache.fineract.accounting.common.AccountingConstants;
|
||||||
import org.apache.fineract.client.models.GetFinancialActivityAccountsResponse;
|
import org.apache.fineract.client.models.GetFinancialActivityAccountsResponse;
|
||||||
import org.apache.fineract.client.models.PostFinancialActivityAccountsRequest;
|
import org.apache.fineract.client.models.PostFinancialActivityAccountsRequest;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
|
import org.apache.fineract.integrationtests.BaseLoanIntegrationTest;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessStepHelper;
|
import org.apache.fineract.integrationtests.common.BusinessStepHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
import org.apache.fineract.integrationtests.common.accounting.AccountHelper;
|
||||||
@@ -56,18 +58,15 @@ import org.apache.fineract.integrationtests.common.loans.CobHelper;
|
|||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class CobPartitioningTest extends BaseLoanIntegrationTest {
|
||||||
public class CobPartitioningTest {
|
|
||||||
|
|
||||||
public static final int N = 10;
|
public static final int N = 10;
|
||||||
private static ResponseSpecification RESPONSE_SPEC;
|
private static ResponseSpecification RESPONSE_SPEC;
|
||||||
@@ -119,8 +118,7 @@ public class CobPartitioningTest {
|
|||||||
public void testLoanCOBPartitioningQuery() throws InterruptedException {
|
public void testLoanCOBPartitioningQuery() throws InterruptedException {
|
||||||
try {
|
try {
|
||||||
ExecutorService executorService = Executors.newFixedThreadPool(10);
|
ExecutorService executorService = Executors.newFixedThreadPool(10);
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
setInitialBusinessDate("2020-03-02");
|
setInitialBusinessDate("2020-03-02");
|
||||||
|
|
||||||
List<Integer> loanIds = new CopyOnWriteArrayList<>();
|
List<Integer> loanIds = new CopyOnWriteArrayList<>();
|
||||||
@@ -192,9 +190,11 @@ public class CobPartitioningTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setInitialBusinessDate(String date) {
|
private void setInitialBusinessDate(String date) {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(REQUEST_SPEC, RESPONSE_SPEC, BUSINESS_DATE, LocalDate.parse(date));
|
BusinessDateHelper.updateBusinessDate(REQUEST_SPEC, RESPONSE_SPEC, BUSINESS_DATE, LocalDate.parse(date));
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(REQUEST_SPEC, RESPONSE_SPEC, "10", "0");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(0L));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cleanUpAndRestoreBusinessDate() {
|
private void cleanUpAndRestoreBusinessDate() {
|
||||||
@@ -203,9 +203,9 @@ public class CobPartitioningTest {
|
|||||||
REQUEST_SPEC.header("Fineract-Platform-TenantId", "default");
|
REQUEST_SPEC.header("Fineract-Platform-TenantId", "default");
|
||||||
RESPONSE_SPEC = new ResponseSpecBuilder().expectStatusCode(200).build();
|
RESPONSE_SPEC = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
BusinessDateHelper.updateBusinessDate(REQUEST_SPEC, RESPONSE_SPEC, BUSINESS_DATE, TODAYS_DATE);
|
BusinessDateHelper.updateBusinessDate(REQUEST_SPEC, RESPONSE_SPEC, BUSINESS_DATE, TODAYS_DATE);
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, false);
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
+152
-361
@@ -22,63 +22,46 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
|||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import io.restassured.specification.RequestSpecification;
|
|
||||||
import io.restassured.specification.ResponseSpecification;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.fineract.client.models.GetGlobalConfigurationsResponse;
|
||||||
import org.apache.fineract.client.models.GlobalConfigurationPropertyData;
|
import org.apache.fineract.client.models.GlobalConfigurationPropertyData;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsResponse;
|
||||||
import org.apache.fineract.client.util.JSON;
|
import org.apache.fineract.client.util.JSON;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
|
import org.apache.fineract.integrationtests.client.IntegrationTest;
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
|
|
||||||
@SuppressWarnings({ "unused", "rawtypes" })
|
@SuppressWarnings({ "unused", "rawtypes" })
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class GlobalConfigurationHelper {
|
public class GlobalConfigurationHelper extends IntegrationTest {
|
||||||
|
|
||||||
private static final Gson GSON = new JSON().getGson();
|
private static final Gson GSON = new JSON().getGson();
|
||||||
private final RequestSpecification requestSpec;
|
|
||||||
private final ResponseSpecification responseSpec;
|
|
||||||
|
|
||||||
public static final String ENABLE_AUTOGENERATED_EXTERNAL_ID = "enable-auto-generated-external-id";
|
public GetGlobalConfigurationsResponse getAllGlobalConfigurations() {
|
||||||
|
|
||||||
public static ArrayList<HashMap> getAllGlobalConfigurations(final RequestSpecification requestSpec,
|
|
||||||
final ResponseSpecification responseSpec) {
|
|
||||||
final String GET_ALL_GLOBAL_CONFIG_URL = "/fineract-provider/api/v1/configurations?" + Utils.TENANT_IDENTIFIER;
|
|
||||||
log.info("------------------------ RETRIEVING ALL GLOBAL CONFIGURATIONS -------------------------");
|
log.info("------------------------ RETRIEVING ALL GLOBAL CONFIGURATIONS -------------------------");
|
||||||
final HashMap<String, ArrayList<HashMap>> response = Utils.performServerGet(requestSpec, responseSpec, GET_ALL_GLOBAL_CONFIG_URL,
|
return ok(fineract().globalConfigurations.retrieveConfiguration(false));
|
||||||
"");
|
|
||||||
return response.get("globalConfiguration");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HashMap getGlobalConfigurationById(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
public GlobalConfigurationPropertyData getGlobalConfigurationByName(final String configName) {
|
||||||
final String configId) {
|
|
||||||
final String GET_GLOBAL_CONFIG_BY_ID_URL = "/fineract-provider/api/v1/configurations/" + configId + "?" + Utils.TENANT_IDENTIFIER;
|
|
||||||
log.info("------------------------ RETRIEVING GLOBAL CONFIGURATION BY ID -------------------------");
|
|
||||||
return Utils.performServerGet(requestSpec, responseSpec, GET_GLOBAL_CONFIG_BY_ID_URL, "");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static GlobalConfigurationPropertyData getGlobalConfigurationByName(final RequestSpecification requestSpec,
|
|
||||||
final ResponseSpecification responseSpec, final String name) {
|
|
||||||
final String GET_GLOBAL_CONFIG_BY_NAME_URL = "/fineract-provider/api/v1/configurations/name/" + name + "?"
|
|
||||||
+ Utils.TENANT_IDENTIFIER;
|
|
||||||
log.info("------------------------ RETRIEVING GLOBAL CONFIGURATION BY NAME -------------------------");
|
log.info("------------------------ RETRIEVING GLOBAL CONFIGURATION BY NAME -------------------------");
|
||||||
String response = Utils.performServerGet(requestSpec, responseSpec, GET_GLOBAL_CONFIG_BY_NAME_URL);
|
return ok(fineract().globalConfigurations.retrieveOneByName(configName));
|
||||||
return GSON.fromJson(response, GlobalConfigurationPropertyData.class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: This is quite a bad pattern and adds a lot of time to individual test executions
|
// TODO: This is quite a bad pattern and adds a lot of time to individual test executions
|
||||||
public static void resetAllDefaultGlobalConfigurations(final RequestSpecification requestSpec,
|
public void resetAllDefaultGlobalConfigurations() {
|
||||||
final ResponseSpecification responseSpec) {
|
|
||||||
|
|
||||||
ArrayList<HashMap> actualGlobalConfigurations = getAllGlobalConfigurations(requestSpec, responseSpec);
|
GetGlobalConfigurationsResponse actualGlobalConfigurations = getAllGlobalConfigurations();
|
||||||
final ArrayList<HashMap> defaults = getAllDefaultGlobalConfigurations();
|
final ArrayList<HashMap> defaults = getAllDefaultGlobalConfigurations();
|
||||||
int changedNo = 0;
|
int changedNo = 0;
|
||||||
for (int i = 0; i < actualGlobalConfigurations.size(); i++) {
|
for (int i = 0; i < actualGlobalConfigurations.getGlobalConfiguration().size(); i++) {
|
||||||
|
|
||||||
HashMap defaultGlobalConfiguration = defaults.get(i);
|
HashMap defaultGlobalConfiguration = defaults.get(i);
|
||||||
HashMap actualGlobalConfiguration = actualGlobalConfigurations.get(i);
|
GlobalConfigurationPropertyData actualGlobalConfiguration = actualGlobalConfigurations.getGlobalConfiguration().get(i);
|
||||||
|
|
||||||
if (!isMatching(defaultGlobalConfiguration, actualGlobalConfiguration)) {
|
if (!isMatching(defaultGlobalConfiguration, actualGlobalConfiguration)) {
|
||||||
|
|
||||||
@@ -95,12 +78,11 @@ public class GlobalConfigurationHelper {
|
|||||||
// integration test suite.
|
// integration test suite.
|
||||||
// If any other column is modified by the integration test suite in
|
// If any other column is modified by the integration test suite in
|
||||||
// the future, it needs to be reset here.
|
// the future, it needs to be reset here.
|
||||||
final Integer configDefaultId = (Integer) defaultGlobalConfiguration.get("id");
|
final String configName = (String) defaultGlobalConfiguration.get("name");
|
||||||
final String configDefaultValue = String.valueOf(defaultGlobalConfiguration.get("value"));
|
final Long configDefaultValue = (Long) defaultGlobalConfiguration.get("value");
|
||||||
|
|
||||||
updateValueForGlobalConfiguration(requestSpec, responseSpec, configDefaultId.toString(), configDefaultValue);
|
updateGlobalConfiguration(configName, new PutGlobalConfigurationsRequest().value(configDefaultValue)
|
||||||
updateEnabledFlagForGlobalConfiguration(requestSpec, responseSpec, configDefaultId.toString(),
|
.enabled((Boolean) defaultGlobalConfiguration.get("enabled")));
|
||||||
(Boolean) defaultGlobalConfiguration.get("enabled"));
|
|
||||||
changedNo++;
|
changedNo++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -108,33 +90,30 @@ public class GlobalConfigurationHelper {
|
|||||||
changedNo);
|
changedNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isMatching(HashMap o1, HashMap o2) {
|
private static boolean isMatching(HashMap o1, GlobalConfigurationPropertyData o2) {
|
||||||
return o1.get("id").equals(o2.get("id")) && o1.get("name").equals(o2.get("name")) && o1.get("value").equals(o2.get("value"))
|
return o1.get("name").equals(o2.getName()) && o1.get("value").equals(o2.getValue()) && o1.get("enabled").equals(o2.getEnabled())
|
||||||
&& o1.get("enabled").equals(o2.get("enabled")) && o1.get("trapDoor").equals(o2.get("trapDoor"));
|
&& o1.get("trapDoor").equals(o2.getTrapDoor());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void verifyAllDefaultGlobalConfigurations(final RequestSpecification requestSpec,
|
public void verifyAllDefaultGlobalConfigurations() {
|
||||||
final ResponseSpecification responseSpec) {
|
|
||||||
|
|
||||||
ArrayList<HashMap> expectedGlobalConfigurations = getAllDefaultGlobalConfigurations();
|
ArrayList<HashMap> expectedGlobalConfigurations = getAllDefaultGlobalConfigurations();
|
||||||
ArrayList<HashMap> actualGlobalConfigurations = getAllGlobalConfigurations(requestSpec, responseSpec);
|
GetGlobalConfigurationsResponse actualGlobalConfigurations = getAllGlobalConfigurations();
|
||||||
|
|
||||||
Assertions.assertEquals(55, expectedGlobalConfigurations.size());
|
Assertions.assertEquals(55, expectedGlobalConfigurations.size());
|
||||||
Assertions.assertEquals(55, actualGlobalConfigurations.size());
|
Assertions.assertEquals(55, actualGlobalConfigurations.getGlobalConfiguration().size());
|
||||||
|
|
||||||
for (int i = 0; i < expectedGlobalConfigurations.size(); i++) {
|
for (int i = 0; i < expectedGlobalConfigurations.size(); i++) {
|
||||||
|
|
||||||
HashMap expectedGlobalConfiguration = expectedGlobalConfigurations.get(i);
|
HashMap expectedGlobalConfiguration = expectedGlobalConfigurations.get(i);
|
||||||
HashMap actualGlobalConfiguration = actualGlobalConfigurations.get(i);
|
GlobalConfigurationPropertyData actualGlobalConfiguration = actualGlobalConfigurations.getGlobalConfiguration().get(i);
|
||||||
|
|
||||||
Assertions.assertEquals(expectedGlobalConfiguration.get("id"), actualGlobalConfiguration.get("id"));
|
final String assertionFailedMessage = "Assertion failed for configName:<" + expectedGlobalConfiguration.get("name") + ">";
|
||||||
final String assertionFailedMessage = "Assertion failed for configID:<" + expectedGlobalConfiguration.get("id") + ">";
|
Assertions.assertEquals(expectedGlobalConfiguration.get("name"), actualGlobalConfiguration.getName(), assertionFailedMessage);
|
||||||
Assertions.assertEquals(expectedGlobalConfiguration.get("name"), actualGlobalConfiguration.get("name"), assertionFailedMessage);
|
Assertions.assertEquals(expectedGlobalConfiguration.get("value"), actualGlobalConfiguration.getValue(), assertionFailedMessage);
|
||||||
Assertions.assertEquals(expectedGlobalConfiguration.get("value"), actualGlobalConfiguration.get("value"),
|
Assertions.assertEquals(expectedGlobalConfiguration.get("enabled"), actualGlobalConfiguration.getEnabled(),
|
||||||
assertionFailedMessage);
|
assertionFailedMessage);
|
||||||
Assertions.assertEquals(expectedGlobalConfiguration.get("enabled"), actualGlobalConfiguration.get("enabled"),
|
Assertions.assertEquals(expectedGlobalConfiguration.get("trapDoor"), actualGlobalConfiguration.getTrapDoor(),
|
||||||
assertionFailedMessage);
|
|
||||||
Assertions.assertEquals(expectedGlobalConfiguration.get("trapDoor"), actualGlobalConfiguration.get("trapDoor"),
|
|
||||||
assertionFailedMessage);
|
assertionFailedMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -153,447 +132,397 @@ public class GlobalConfigurationHelper {
|
|||||||
ArrayList<HashMap> defaults = new ArrayList<>();
|
ArrayList<HashMap> defaults = new ArrayList<>();
|
||||||
|
|
||||||
HashMap<String, Object> makerCheckerDefault = new HashMap<>();
|
HashMap<String, Object> makerCheckerDefault = new HashMap<>();
|
||||||
makerCheckerDefault.put("id", 1);
|
makerCheckerDefault.put("name", GlobalConfigurationConstants.MAKER_CHECKER);
|
||||||
makerCheckerDefault.put("name", "maker-checker");
|
makerCheckerDefault.put("value", 0L);
|
||||||
makerCheckerDefault.put("value", 0);
|
|
||||||
makerCheckerDefault.put("enabled", false);
|
makerCheckerDefault.put("enabled", false);
|
||||||
makerCheckerDefault.put("trapDoor", false);
|
makerCheckerDefault.put("trapDoor", false);
|
||||||
defaults.add(makerCheckerDefault);
|
defaults.add(makerCheckerDefault);
|
||||||
|
|
||||||
HashMap<String, Object> amazonS3Default = new HashMap<>();
|
HashMap<String, Object> amazonS3Default = new HashMap<>();
|
||||||
amazonS3Default.put("id", 4);
|
amazonS3Default.put("name", GlobalConfigurationConstants.AMAZON_S3);
|
||||||
amazonS3Default.put("name", "amazon-S3");
|
amazonS3Default.put("value", 0L);
|
||||||
amazonS3Default.put("value", 0);
|
|
||||||
amazonS3Default.put("enabled", false);
|
amazonS3Default.put("enabled", false);
|
||||||
amazonS3Default.put("trapDoor", false);
|
amazonS3Default.put("trapDoor", false);
|
||||||
defaults.add(amazonS3Default);
|
defaults.add(amazonS3Default);
|
||||||
|
|
||||||
HashMap<String, Object> rescheduleFuturePaymentsDefault = new HashMap<>();
|
HashMap<String, Object> rescheduleFuturePaymentsDefault = new HashMap<>();
|
||||||
rescheduleFuturePaymentsDefault.put("id", 5);
|
rescheduleFuturePaymentsDefault.put("name", GlobalConfigurationConstants.RESCHEDULE_FUTURE_REPAYMENTS);
|
||||||
rescheduleFuturePaymentsDefault.put("name", "reschedule-future-repayments");
|
rescheduleFuturePaymentsDefault.put("value", 0L);
|
||||||
rescheduleFuturePaymentsDefault.put("value", 0);
|
|
||||||
rescheduleFuturePaymentsDefault.put("enabled", true);
|
rescheduleFuturePaymentsDefault.put("enabled", true);
|
||||||
rescheduleFuturePaymentsDefault.put("trapDoor", false);
|
rescheduleFuturePaymentsDefault.put("trapDoor", false);
|
||||||
defaults.add(rescheduleFuturePaymentsDefault);
|
defaults.add(rescheduleFuturePaymentsDefault);
|
||||||
|
|
||||||
HashMap<String, Object> rescheduleRepaymentsOnHolidaysDefault = new HashMap<>();
|
HashMap<String, Object> rescheduleRepaymentsOnHolidaysDefault = new HashMap<>();
|
||||||
rescheduleRepaymentsOnHolidaysDefault.put("id", 6);
|
rescheduleRepaymentsOnHolidaysDefault.put("id", 6);
|
||||||
rescheduleRepaymentsOnHolidaysDefault.put("name", "reschedule-repayments-on-holidays");
|
rescheduleRepaymentsOnHolidaysDefault.put("name", GlobalConfigurationConstants.RESCHEDULE_REPAYMENTS_ON_HOLIDAYS);
|
||||||
rescheduleRepaymentsOnHolidaysDefault.put("value", 0);
|
rescheduleRepaymentsOnHolidaysDefault.put("value", 0L);
|
||||||
rescheduleRepaymentsOnHolidaysDefault.put("enabled", false);
|
rescheduleRepaymentsOnHolidaysDefault.put("enabled", false);
|
||||||
rescheduleRepaymentsOnHolidaysDefault.put("trapDoor", false);
|
rescheduleRepaymentsOnHolidaysDefault.put("trapDoor", false);
|
||||||
defaults.add(rescheduleRepaymentsOnHolidaysDefault);
|
defaults.add(rescheduleRepaymentsOnHolidaysDefault);
|
||||||
|
|
||||||
HashMap<String, Object> allowTransactionsOnHolidayDefault = new HashMap<>();
|
HashMap<String, Object> allowTransactionsOnHolidayDefault = new HashMap<>();
|
||||||
allowTransactionsOnHolidayDefault.put("id", 7);
|
allowTransactionsOnHolidayDefault.put("name", GlobalConfigurationConstants.ALLOW_TRANSACTIONS_ON_HOLIDAY);
|
||||||
allowTransactionsOnHolidayDefault.put("name", "allow-transactions-on-holiday");
|
allowTransactionsOnHolidayDefault.put("value", 0L);
|
||||||
allowTransactionsOnHolidayDefault.put("value", 0);
|
|
||||||
allowTransactionsOnHolidayDefault.put("enabled", false);
|
allowTransactionsOnHolidayDefault.put("enabled", false);
|
||||||
allowTransactionsOnHolidayDefault.put("trapDoor", false);
|
allowTransactionsOnHolidayDefault.put("trapDoor", false);
|
||||||
defaults.add(allowTransactionsOnHolidayDefault);
|
defaults.add(allowTransactionsOnHolidayDefault);
|
||||||
|
|
||||||
HashMap<String, Object> allowTransactionsOnNonWorkingDayDefault = new HashMap<>();
|
HashMap<String, Object> allowTransactionsOnNonWorkingDayDefault = new HashMap<>();
|
||||||
allowTransactionsOnNonWorkingDayDefault.put("id", 8);
|
allowTransactionsOnNonWorkingDayDefault.put("name", GlobalConfigurationConstants.ALLOW_TRANSACTIONS_ON_NON_WORKING_DAY);
|
||||||
allowTransactionsOnNonWorkingDayDefault.put("name", "allow-transactions-on-non_workingday");
|
allowTransactionsOnNonWorkingDayDefault.put("value", 0L);
|
||||||
allowTransactionsOnNonWorkingDayDefault.put("value", 0);
|
|
||||||
allowTransactionsOnNonWorkingDayDefault.put("enabled", false);
|
allowTransactionsOnNonWorkingDayDefault.put("enabled", false);
|
||||||
allowTransactionsOnNonWorkingDayDefault.put("trapDoor", false);
|
allowTransactionsOnNonWorkingDayDefault.put("trapDoor", false);
|
||||||
defaults.add(allowTransactionsOnNonWorkingDayDefault);
|
defaults.add(allowTransactionsOnNonWorkingDayDefault);
|
||||||
|
|
||||||
HashMap<String, Object> constraintApproachForDataTablesDefault = new HashMap<>();
|
HashMap<String, Object> constraintApproachForDataTablesDefault = new HashMap<>();
|
||||||
constraintApproachForDataTablesDefault.put("id", 9);
|
constraintApproachForDataTablesDefault.put("name", GlobalConfigurationConstants.CONSTRAINT_APPROACH_FOR_DATATABLES);
|
||||||
constraintApproachForDataTablesDefault.put("name", "constraint_approach_for_datatables");
|
constraintApproachForDataTablesDefault.put("value", 0L);
|
||||||
constraintApproachForDataTablesDefault.put("value", 0);
|
|
||||||
constraintApproachForDataTablesDefault.put("enabled", false);
|
constraintApproachForDataTablesDefault.put("enabled", false);
|
||||||
constraintApproachForDataTablesDefault.put("trapDoor", false);
|
constraintApproachForDataTablesDefault.put("trapDoor", false);
|
||||||
defaults.add(constraintApproachForDataTablesDefault);
|
defaults.add(constraintApproachForDataTablesDefault);
|
||||||
|
|
||||||
HashMap<String, Object> penaltyWaitPeriodDefault = new HashMap<>();
|
HashMap<String, Object> penaltyWaitPeriodDefault = new HashMap<>();
|
||||||
penaltyWaitPeriodDefault.put("id", 10);
|
penaltyWaitPeriodDefault.put("name", GlobalConfigurationConstants.PENALTY_WAIT_PERIOD);
|
||||||
penaltyWaitPeriodDefault.put("name", "penalty-wait-period");
|
penaltyWaitPeriodDefault.put("value", 2L);
|
||||||
penaltyWaitPeriodDefault.put("value", 2);
|
|
||||||
penaltyWaitPeriodDefault.put("enabled", true);
|
penaltyWaitPeriodDefault.put("enabled", true);
|
||||||
penaltyWaitPeriodDefault.put("trapDoor", false);
|
penaltyWaitPeriodDefault.put("trapDoor", false);
|
||||||
defaults.add(penaltyWaitPeriodDefault);
|
defaults.add(penaltyWaitPeriodDefault);
|
||||||
|
|
||||||
HashMap<String, Object> forcePasswordResetDaysDefault = new HashMap<>();
|
HashMap<String, Object> forcePasswordResetDaysDefault = new HashMap<>();
|
||||||
forcePasswordResetDaysDefault.put("id", 11);
|
forcePasswordResetDaysDefault.put("name", GlobalConfigurationConstants.FORCE_PASSWORD_RESET_DAYS);
|
||||||
forcePasswordResetDaysDefault.put("name", "force-password-reset-days");
|
forcePasswordResetDaysDefault.put("value", 0L);
|
||||||
forcePasswordResetDaysDefault.put("value", 0);
|
|
||||||
forcePasswordResetDaysDefault.put("enabled", false);
|
forcePasswordResetDaysDefault.put("enabled", false);
|
||||||
forcePasswordResetDaysDefault.put("trapDoor", false);
|
forcePasswordResetDaysDefault.put("trapDoor", false);
|
||||||
defaults.add(forcePasswordResetDaysDefault);
|
defaults.add(forcePasswordResetDaysDefault);
|
||||||
|
|
||||||
HashMap<String, Object> graceOnPenaltyPostingDefault = new HashMap<>();
|
HashMap<String, Object> graceOnPenaltyPostingDefault = new HashMap<>();
|
||||||
graceOnPenaltyPostingDefault.put("id", 12);
|
graceOnPenaltyPostingDefault.put("name", GlobalConfigurationConstants.GRACE_ON_PENALTY_POSTING);
|
||||||
graceOnPenaltyPostingDefault.put("name", "grace-on-penalty-posting");
|
graceOnPenaltyPostingDefault.put("value", 0L);
|
||||||
graceOnPenaltyPostingDefault.put("value", 0);
|
|
||||||
graceOnPenaltyPostingDefault.put("enabled", true);
|
graceOnPenaltyPostingDefault.put("enabled", true);
|
||||||
graceOnPenaltyPostingDefault.put("trapDoor", false);
|
graceOnPenaltyPostingDefault.put("trapDoor", false);
|
||||||
defaults.add(graceOnPenaltyPostingDefault);
|
defaults.add(graceOnPenaltyPostingDefault);
|
||||||
|
|
||||||
HashMap<String, Object> savingsInterestPostingCurrentPeriodEndDefault = new HashMap<>();
|
HashMap<String, Object> savingsInterestPostingCurrentPeriodEndDefault = new HashMap<>();
|
||||||
savingsInterestPostingCurrentPeriodEndDefault.put("id", 15);
|
savingsInterestPostingCurrentPeriodEndDefault.put("name", GlobalConfigurationConstants.SAVINGS_INTEREST_POSTING_CURRENT_PERIOD_END);
|
||||||
savingsInterestPostingCurrentPeriodEndDefault.put("name", "savings-interest-posting-current-period-end");
|
savingsInterestPostingCurrentPeriodEndDefault.put("value", 0L);
|
||||||
savingsInterestPostingCurrentPeriodEndDefault.put("value", 0);
|
|
||||||
savingsInterestPostingCurrentPeriodEndDefault.put("enabled", false);
|
savingsInterestPostingCurrentPeriodEndDefault.put("enabled", false);
|
||||||
savingsInterestPostingCurrentPeriodEndDefault.put("trapDoor", false);
|
savingsInterestPostingCurrentPeriodEndDefault.put("trapDoor", false);
|
||||||
defaults.add(savingsInterestPostingCurrentPeriodEndDefault);
|
defaults.add(savingsInterestPostingCurrentPeriodEndDefault);
|
||||||
|
|
||||||
HashMap<String, Object> financialYearBeginningMonthDefault = new HashMap<>();
|
HashMap<String, Object> financialYearBeginningMonthDefault = new HashMap<>();
|
||||||
financialYearBeginningMonthDefault.put("id", 16);
|
financialYearBeginningMonthDefault.put("name", GlobalConfigurationConstants.FINANCIAL_YEAR_BEGINNING_MONTH);
|
||||||
financialYearBeginningMonthDefault.put("name", "financial-year-beginning-month");
|
financialYearBeginningMonthDefault.put("value", 1L);
|
||||||
financialYearBeginningMonthDefault.put("value", 1);
|
|
||||||
financialYearBeginningMonthDefault.put("enabled", true);
|
financialYearBeginningMonthDefault.put("enabled", true);
|
||||||
financialYearBeginningMonthDefault.put("trapDoor", false);
|
financialYearBeginningMonthDefault.put("trapDoor", false);
|
||||||
defaults.add(financialYearBeginningMonthDefault);
|
defaults.add(financialYearBeginningMonthDefault);
|
||||||
|
|
||||||
HashMap<String, Object> minClientsInGroupDefault = new HashMap<>();
|
HashMap<String, Object> minClientsInGroupDefault = new HashMap<>();
|
||||||
minClientsInGroupDefault.put("id", 17);
|
minClientsInGroupDefault.put("name", GlobalConfigurationConstants.MIN_CLIENTS_IN_GROUP);
|
||||||
minClientsInGroupDefault.put("name", "min-clients-in-group");
|
minClientsInGroupDefault.put("value", 5L);
|
||||||
minClientsInGroupDefault.put("value", 5);
|
|
||||||
minClientsInGroupDefault.put("enabled", false);
|
minClientsInGroupDefault.put("enabled", false);
|
||||||
minClientsInGroupDefault.put("trapDoor", false);
|
minClientsInGroupDefault.put("trapDoor", false);
|
||||||
defaults.add(minClientsInGroupDefault);
|
defaults.add(minClientsInGroupDefault);
|
||||||
|
|
||||||
HashMap<String, Object> maxClientsInGroupDefault = new HashMap<>();
|
HashMap<String, Object> maxClientsInGroupDefault = new HashMap<>();
|
||||||
maxClientsInGroupDefault.put("id", 18);
|
maxClientsInGroupDefault.put("name", GlobalConfigurationConstants.MAX_CLIENTS_IN_GROUP);
|
||||||
maxClientsInGroupDefault.put("name", "max-clients-in-group");
|
maxClientsInGroupDefault.put("value", 5L);
|
||||||
maxClientsInGroupDefault.put("value", 5);
|
|
||||||
maxClientsInGroupDefault.put("enabled", false);
|
maxClientsInGroupDefault.put("enabled", false);
|
||||||
maxClientsInGroupDefault.put("trapDoor", false);
|
maxClientsInGroupDefault.put("trapDoor", false);
|
||||||
defaults.add(maxClientsInGroupDefault);
|
defaults.add(maxClientsInGroupDefault);
|
||||||
|
|
||||||
HashMap<String, Object> meetingsMandatoryForJlgLoansDefault = new HashMap<>();
|
HashMap<String, Object> meetingsMandatoryForJlgLoansDefault = new HashMap<>();
|
||||||
meetingsMandatoryForJlgLoansDefault.put("id", 19);
|
meetingsMandatoryForJlgLoansDefault.put("name", GlobalConfigurationConstants.MEETINGS_MANDATORY_FOR_JLG_LOANS);
|
||||||
meetingsMandatoryForJlgLoansDefault.put("name", "meetings-mandatory-for-jlg-loans");
|
meetingsMandatoryForJlgLoansDefault.put("value", 0L);
|
||||||
meetingsMandatoryForJlgLoansDefault.put("value", 0);
|
|
||||||
meetingsMandatoryForJlgLoansDefault.put("enabled", false);
|
meetingsMandatoryForJlgLoansDefault.put("enabled", false);
|
||||||
meetingsMandatoryForJlgLoansDefault.put("trapDoor", false);
|
meetingsMandatoryForJlgLoansDefault.put("trapDoor", false);
|
||||||
defaults.add(meetingsMandatoryForJlgLoansDefault);
|
defaults.add(meetingsMandatoryForJlgLoansDefault);
|
||||||
|
|
||||||
HashMap<String, Object> officeSpecificProductsEnabledDefault = new HashMap<>();
|
HashMap<String, Object> officeSpecificProductsEnabledDefault = new HashMap<>();
|
||||||
officeSpecificProductsEnabledDefault.put("id", 20);
|
officeSpecificProductsEnabledDefault.put("name", GlobalConfigurationConstants.OFFICE_SPECIFIC_PRODUCTS_ENABLED);
|
||||||
officeSpecificProductsEnabledDefault.put("name", "office-specific-products-enabled");
|
officeSpecificProductsEnabledDefault.put("value", 0L);
|
||||||
officeSpecificProductsEnabledDefault.put("value", 0);
|
|
||||||
officeSpecificProductsEnabledDefault.put("enabled", false);
|
officeSpecificProductsEnabledDefault.put("enabled", false);
|
||||||
officeSpecificProductsEnabledDefault.put("trapDoor", false);
|
officeSpecificProductsEnabledDefault.put("trapDoor", false);
|
||||||
defaults.add(officeSpecificProductsEnabledDefault);
|
defaults.add(officeSpecificProductsEnabledDefault);
|
||||||
|
|
||||||
HashMap<String, Object> restrictProductsToUserOfficeDefault = new HashMap<>();
|
HashMap<String, Object> restrictProductsToUserOfficeDefault = new HashMap<>();
|
||||||
restrictProductsToUserOfficeDefault.put("id", 21);
|
restrictProductsToUserOfficeDefault.put("name", GlobalConfigurationConstants.RESTRICT_PRODUCTS_TO_USER_OFFICE);
|
||||||
restrictProductsToUserOfficeDefault.put("name", "restrict-products-to-user-office");
|
restrictProductsToUserOfficeDefault.put("value", 0L);
|
||||||
restrictProductsToUserOfficeDefault.put("value", 0);
|
|
||||||
restrictProductsToUserOfficeDefault.put("enabled", false);
|
restrictProductsToUserOfficeDefault.put("enabled", false);
|
||||||
restrictProductsToUserOfficeDefault.put("trapDoor", false);
|
restrictProductsToUserOfficeDefault.put("trapDoor", false);
|
||||||
defaults.add(restrictProductsToUserOfficeDefault);
|
defaults.add(restrictProductsToUserOfficeDefault);
|
||||||
|
|
||||||
HashMap<String, Object> officeOpeningBalancesContraAccountDefault = new HashMap<>();
|
HashMap<String, Object> officeOpeningBalancesContraAccountDefault = new HashMap<>();
|
||||||
officeOpeningBalancesContraAccountDefault.put("id", 22);
|
officeOpeningBalancesContraAccountDefault.put("name", GlobalConfigurationConstants.OFFICE_OPENING_BALANCES_CONTRA_ACCOUNT);
|
||||||
officeOpeningBalancesContraAccountDefault.put("name", "office-opening-balances-contra-account");
|
officeOpeningBalancesContraAccountDefault.put("value", 0L);
|
||||||
officeOpeningBalancesContraAccountDefault.put("value", 0);
|
|
||||||
officeOpeningBalancesContraAccountDefault.put("enabled", true);
|
officeOpeningBalancesContraAccountDefault.put("enabled", true);
|
||||||
officeOpeningBalancesContraAccountDefault.put("trapDoor", false);
|
officeOpeningBalancesContraAccountDefault.put("trapDoor", false);
|
||||||
defaults.add(officeOpeningBalancesContraAccountDefault);
|
defaults.add(officeOpeningBalancesContraAccountDefault);
|
||||||
|
|
||||||
HashMap<String, Object> roundingModeDefault = new HashMap<>();
|
HashMap<String, Object> roundingModeDefault = new HashMap<>();
|
||||||
roundingModeDefault.put("id", 23);
|
roundingModeDefault.put("name", GlobalConfigurationConstants.ROUNDING_MODE);
|
||||||
roundingModeDefault.put("name", "rounding-mode");
|
roundingModeDefault.put("value", 6L);
|
||||||
roundingModeDefault.put("value", 6);
|
|
||||||
roundingModeDefault.put("enabled", true);
|
roundingModeDefault.put("enabled", true);
|
||||||
roundingModeDefault.put("trapDoor", true);
|
roundingModeDefault.put("trapDoor", true);
|
||||||
defaults.add(roundingModeDefault);
|
defaults.add(roundingModeDefault);
|
||||||
|
|
||||||
HashMap<String, Object> backDatePenaltiesEnabledDefault = new HashMap<>();
|
HashMap<String, Object> backDatePenaltiesEnabledDefault = new HashMap<>();
|
||||||
backDatePenaltiesEnabledDefault.put("id", 24);
|
backDatePenaltiesEnabledDefault.put("name", GlobalConfigurationConstants.BACKDATE_PENALTIES_ENABLED);
|
||||||
backDatePenaltiesEnabledDefault.put("name", "backdate-penalties-enabled");
|
backDatePenaltiesEnabledDefault.put("value", 0L);
|
||||||
backDatePenaltiesEnabledDefault.put("value", 0);
|
|
||||||
backDatePenaltiesEnabledDefault.put("enabled", true);
|
backDatePenaltiesEnabledDefault.put("enabled", true);
|
||||||
backDatePenaltiesEnabledDefault.put("trapDoor", false);
|
backDatePenaltiesEnabledDefault.put("trapDoor", false);
|
||||||
defaults.add(backDatePenaltiesEnabledDefault);
|
defaults.add(backDatePenaltiesEnabledDefault);
|
||||||
|
|
||||||
HashMap<String, Object> organisationStartDateDefault = new HashMap<>();
|
HashMap<String, Object> organisationStartDateDefault = new HashMap<>();
|
||||||
organisationStartDateDefault.put("id", 25);
|
organisationStartDateDefault.put("name", GlobalConfigurationConstants.ORGANISATION_START_DATE);
|
||||||
organisationStartDateDefault.put("name", "organisation-start-date");
|
organisationStartDateDefault.put("value", 0L);
|
||||||
organisationStartDateDefault.put("value", 0);
|
|
||||||
organisationStartDateDefault.put("enabled", false);
|
organisationStartDateDefault.put("enabled", false);
|
||||||
organisationStartDateDefault.put("trapDoor", false);
|
organisationStartDateDefault.put("trapDoor", false);
|
||||||
defaults.add(organisationStartDateDefault);
|
defaults.add(organisationStartDateDefault);
|
||||||
|
|
||||||
HashMap<String, Object> paymentTypeApplicableForDisbursementChargesDefault = new HashMap<>();
|
HashMap<String, Object> paymentTypeApplicableForDisbursementChargesDefault = new HashMap<>();
|
||||||
paymentTypeApplicableForDisbursementChargesDefault.put("id", 26);
|
paymentTypeApplicableForDisbursementChargesDefault.put("name",
|
||||||
paymentTypeApplicableForDisbursementChargesDefault.put("name", "paymenttype-applicable-for-disbursement-charges");
|
GlobalConfigurationConstants.PAYMENT_TYPE_APPLICABLE_FOR_DISBURSEMENT_CHARGES);
|
||||||
paymentTypeApplicableForDisbursementChargesDefault.put("value", 0);
|
paymentTypeApplicableForDisbursementChargesDefault.put("value", 0L);
|
||||||
paymentTypeApplicableForDisbursementChargesDefault.put("enabled", false);
|
paymentTypeApplicableForDisbursementChargesDefault.put("enabled", false);
|
||||||
paymentTypeApplicableForDisbursementChargesDefault.put("trapDoor", false);
|
paymentTypeApplicableForDisbursementChargesDefault.put("trapDoor", false);
|
||||||
defaults.add(paymentTypeApplicableForDisbursementChargesDefault);
|
defaults.add(paymentTypeApplicableForDisbursementChargesDefault);
|
||||||
|
|
||||||
HashMap<String, Object> interestChargedFromDateSameAsDisbursalDateDefault = new HashMap<>();
|
HashMap<String, Object> interestChargedFromDateSameAsDisbursalDateDefault = new HashMap<>();
|
||||||
interestChargedFromDateSameAsDisbursalDateDefault.put("id", 27);
|
interestChargedFromDateSameAsDisbursalDateDefault.put("name",
|
||||||
interestChargedFromDateSameAsDisbursalDateDefault.put("name", "interest-charged-from-date-same-as-disbursal-date");
|
GlobalConfigurationConstants.INTEREST_CHARGED_FROM_DATE_SAME_AS_DISBURSAL_DATE);
|
||||||
interestChargedFromDateSameAsDisbursalDateDefault.put("value", 0);
|
interestChargedFromDateSameAsDisbursalDateDefault.put("value", 0L);
|
||||||
interestChargedFromDateSameAsDisbursalDateDefault.put("enabled", false);
|
interestChargedFromDateSameAsDisbursalDateDefault.put("enabled", false);
|
||||||
interestChargedFromDateSameAsDisbursalDateDefault.put("trapDoor", false);
|
interestChargedFromDateSameAsDisbursalDateDefault.put("trapDoor", false);
|
||||||
defaults.add(interestChargedFromDateSameAsDisbursalDateDefault);
|
defaults.add(interestChargedFromDateSameAsDisbursalDateDefault);
|
||||||
|
|
||||||
HashMap<String, Object> skipRepaymentOnFirstDayOfMonthDefault = new HashMap<>();
|
HashMap<String, Object> skipRepaymentOnFirstDayOfMonthDefault = new HashMap<>();
|
||||||
skipRepaymentOnFirstDayOfMonthDefault.put("id", 28);
|
skipRepaymentOnFirstDayOfMonthDefault.put("name", GlobalConfigurationConstants.SKIP_REPAYMENT_ON_FIRST_DAY_OF_MONTH);
|
||||||
skipRepaymentOnFirstDayOfMonthDefault.put("name", "skip-repayment-on-first-day-of-month");
|
skipRepaymentOnFirstDayOfMonthDefault.put("value", 14L);
|
||||||
skipRepaymentOnFirstDayOfMonthDefault.put("value", 14);
|
|
||||||
skipRepaymentOnFirstDayOfMonthDefault.put("enabled", false);
|
skipRepaymentOnFirstDayOfMonthDefault.put("enabled", false);
|
||||||
skipRepaymentOnFirstDayOfMonthDefault.put("trapDoor", false);
|
skipRepaymentOnFirstDayOfMonthDefault.put("trapDoor", false);
|
||||||
defaults.add(skipRepaymentOnFirstDayOfMonthDefault);
|
defaults.add(skipRepaymentOnFirstDayOfMonthDefault);
|
||||||
|
|
||||||
HashMap<String, Object> changeEmiIfRepaymentDateSameAsDisbursementDateDefault = new HashMap<>();
|
HashMap<String, Object> changeEmiIfRepaymentDateSameAsDisbursementDateDefault = new HashMap<>();
|
||||||
changeEmiIfRepaymentDateSameAsDisbursementDateDefault.put("id", 29);
|
changeEmiIfRepaymentDateSameAsDisbursementDateDefault.put("name",
|
||||||
changeEmiIfRepaymentDateSameAsDisbursementDateDefault.put("name", "change-emi-if-repaymentdate-same-as-disbursementdate");
|
GlobalConfigurationConstants.CHANGE_EMI_IF_REPAYMENT_DATE_SAME_AS_DISBURSEMENT_DATE);
|
||||||
changeEmiIfRepaymentDateSameAsDisbursementDateDefault.put("value", 0);
|
changeEmiIfRepaymentDateSameAsDisbursementDateDefault.put("value", 0L);
|
||||||
changeEmiIfRepaymentDateSameAsDisbursementDateDefault.put("enabled", true);
|
changeEmiIfRepaymentDateSameAsDisbursementDateDefault.put("enabled", true);
|
||||||
changeEmiIfRepaymentDateSameAsDisbursementDateDefault.put("trapDoor", false);
|
changeEmiIfRepaymentDateSameAsDisbursementDateDefault.put("trapDoor", false);
|
||||||
defaults.add(changeEmiIfRepaymentDateSameAsDisbursementDateDefault);
|
defaults.add(changeEmiIfRepaymentDateSameAsDisbursementDateDefault);
|
||||||
|
|
||||||
HashMap<String, Object> dailyTptLimitDefault = new HashMap<>();
|
HashMap<String, Object> dailyTptLimitDefault = new HashMap<>();
|
||||||
dailyTptLimitDefault.put("id", 30);
|
dailyTptLimitDefault.put("name", GlobalConfigurationConstants.DAILY_TPT_LIMIT);
|
||||||
dailyTptLimitDefault.put("name", "daily-tpt-limit");
|
dailyTptLimitDefault.put("value", 0L);
|
||||||
dailyTptLimitDefault.put("value", 0);
|
|
||||||
dailyTptLimitDefault.put("enabled", false);
|
dailyTptLimitDefault.put("enabled", false);
|
||||||
dailyTptLimitDefault.put("trapDoor", false);
|
dailyTptLimitDefault.put("trapDoor", false);
|
||||||
defaults.add(dailyTptLimitDefault);
|
defaults.add(dailyTptLimitDefault);
|
||||||
|
|
||||||
HashMap<String, Object> enableAddressDefault = new HashMap<>();
|
HashMap<String, Object> enableAddressDefault = new HashMap<>();
|
||||||
enableAddressDefault.put("id", 31);
|
enableAddressDefault.put("name", GlobalConfigurationConstants.ENABLE_ADDRESS);
|
||||||
enableAddressDefault.put("name", "Enable-Address");
|
enableAddressDefault.put("value", 0L);
|
||||||
enableAddressDefault.put("value", 0);
|
|
||||||
enableAddressDefault.put("enabled", false);
|
enableAddressDefault.put("enabled", false);
|
||||||
enableAddressDefault.put("trapDoor", false);
|
enableAddressDefault.put("trapDoor", false);
|
||||||
defaults.add(enableAddressDefault);
|
defaults.add(enableAddressDefault);
|
||||||
|
|
||||||
HashMap<String, Object> enableSubRatesDefault = new HashMap<>();
|
HashMap<String, Object> enableSubRatesDefault = new HashMap<>();
|
||||||
enableSubRatesDefault.put("id", 32);
|
enableSubRatesDefault.put("name", GlobalConfigurationConstants.SUB_RATES);
|
||||||
enableSubRatesDefault.put("name", "sub-rates");
|
enableSubRatesDefault.put("value", 0L);
|
||||||
enableSubRatesDefault.put("value", 0);
|
|
||||||
enableSubRatesDefault.put("enabled", false);
|
enableSubRatesDefault.put("enabled", false);
|
||||||
enableSubRatesDefault.put("trapDoor", false);
|
enableSubRatesDefault.put("trapDoor", false);
|
||||||
defaults.add(enableSubRatesDefault);
|
defaults.add(enableSubRatesDefault);
|
||||||
|
|
||||||
HashMap<String, Object> isFirstPaydayAllowedOnHoliday = new HashMap<>();
|
HashMap<String, Object> isFirstPaydayAllowedOnHoliday = new HashMap<>();
|
||||||
isFirstPaydayAllowedOnHoliday.put("id", 33);
|
isFirstPaydayAllowedOnHoliday.put("name", GlobalConfigurationConstants.LOAN_RESCHEDULE_IS_FIRST_PAYDAY_ALLOWED_ON_HOLIDAY);
|
||||||
isFirstPaydayAllowedOnHoliday.put("name", "loan-reschedule-is-first-payday-allowed-on-holiday");
|
isFirstPaydayAllowedOnHoliday.put("value", 0L);
|
||||||
isFirstPaydayAllowedOnHoliday.put("value", 0);
|
|
||||||
isFirstPaydayAllowedOnHoliday.put("enabled", false);
|
isFirstPaydayAllowedOnHoliday.put("enabled", false);
|
||||||
isFirstPaydayAllowedOnHoliday.put("trapDoor", false);
|
isFirstPaydayAllowedOnHoliday.put("trapDoor", false);
|
||||||
defaults.add(isFirstPaydayAllowedOnHoliday);
|
defaults.add(isFirstPaydayAllowedOnHoliday);
|
||||||
|
|
||||||
HashMap<String, Object> isAccountMappedForPayment = new HashMap<>();
|
HashMap<String, Object> isAccountMappedForPayment = new HashMap<>();
|
||||||
isAccountMappedForPayment.put("id", 35);
|
isAccountMappedForPayment.put("name", GlobalConfigurationConstants.ACCOUNT_MAPPING_FOR_PAYMENT_TYPE);
|
||||||
isAccountMappedForPayment.put("name", "account-mapping-for-payment-type");
|
isAccountMappedForPayment.put("value", 0L);
|
||||||
isAccountMappedForPayment.put("value", 0);
|
|
||||||
isAccountMappedForPayment.put("enabled", true);
|
isAccountMappedForPayment.put("enabled", true);
|
||||||
isAccountMappedForPayment.put("trapDoor", false);
|
isAccountMappedForPayment.put("trapDoor", false);
|
||||||
isAccountMappedForPayment.put("string_value", "Asset");
|
isAccountMappedForPayment.put("string_value", "Asset");
|
||||||
defaults.add(isAccountMappedForPayment);
|
defaults.add(isAccountMappedForPayment);
|
||||||
|
|
||||||
HashMap<String, Object> isAccountMappedForCharge = new HashMap<>();
|
HashMap<String, Object> isAccountMappedForCharge = new HashMap<>();
|
||||||
isAccountMappedForCharge.put("id", 36);
|
isAccountMappedForCharge.put("name", GlobalConfigurationConstants.ACCOUNT_MAPPING_FOR_CHARGE);
|
||||||
isAccountMappedForCharge.put("name", "account-mapping-for-charge");
|
isAccountMappedForCharge.put("value", 0L);
|
||||||
isAccountMappedForCharge.put("value", 0);
|
|
||||||
isAccountMappedForCharge.put("enabled", true);
|
isAccountMappedForCharge.put("enabled", true);
|
||||||
isAccountMappedForCharge.put("trapDoor", false);
|
isAccountMappedForCharge.put("trapDoor", false);
|
||||||
isAccountMappedForCharge.put("string_value", "Income");
|
isAccountMappedForCharge.put("string_value", "Income");
|
||||||
defaults.add(isAccountMappedForCharge);
|
defaults.add(isAccountMappedForCharge);
|
||||||
|
|
||||||
HashMap<String, Object> isNextDayFixedDepositInterestTransferEnabledForPeriodEnd = new HashMap<>();
|
HashMap<String, Object> isNextDayFixedDepositInterestTransferEnabledForPeriodEnd = new HashMap<>();
|
||||||
isNextDayFixedDepositInterestTransferEnabledForPeriodEnd.put("id", 37);
|
|
||||||
isNextDayFixedDepositInterestTransferEnabledForPeriodEnd.put("name",
|
isNextDayFixedDepositInterestTransferEnabledForPeriodEnd.put("name",
|
||||||
"fixed-deposit-transfer-interest-next-day-for-period-end-posting");
|
GlobalConfigurationConstants.FIXED_DEPOSIT_TRANSFER_INTEREST_NEXT_DAY_FOR_PERIOD_END_POSTING);
|
||||||
isNextDayFixedDepositInterestTransferEnabledForPeriodEnd.put("value", 0);
|
isNextDayFixedDepositInterestTransferEnabledForPeriodEnd.put("value", 0L);
|
||||||
isNextDayFixedDepositInterestTransferEnabledForPeriodEnd.put("enabled", false);
|
isNextDayFixedDepositInterestTransferEnabledForPeriodEnd.put("enabled", false);
|
||||||
isNextDayFixedDepositInterestTransferEnabledForPeriodEnd.put("trapDoor", false);
|
isNextDayFixedDepositInterestTransferEnabledForPeriodEnd.put("trapDoor", false);
|
||||||
defaults.add(isNextDayFixedDepositInterestTransferEnabledForPeriodEnd);
|
defaults.add(isNextDayFixedDepositInterestTransferEnabledForPeriodEnd);
|
||||||
|
|
||||||
HashMap<String, Object> isAllowedBackDatedTransactionsBeforeInterestPostingDate = new HashMap<>();
|
HashMap<String, Object> isAllowedBackDatedTransactionsBeforeInterestPostingDate = new HashMap<>();
|
||||||
isAllowedBackDatedTransactionsBeforeInterestPostingDate.put("id", 38);
|
isAllowedBackDatedTransactionsBeforeInterestPostingDate.put("name",
|
||||||
isAllowedBackDatedTransactionsBeforeInterestPostingDate.put("name", "allow-backdated-transaction-before-interest-posting");
|
GlobalConfigurationConstants.ALLOW_BACKDATED_TRANSACTION_BEFORE_INTEREST_POSTING);
|
||||||
isAllowedBackDatedTransactionsBeforeInterestPostingDate.put("value", 0);
|
isAllowedBackDatedTransactionsBeforeInterestPostingDate.put("value", 0L);
|
||||||
isAllowedBackDatedTransactionsBeforeInterestPostingDate.put("enabled", true);
|
isAllowedBackDatedTransactionsBeforeInterestPostingDate.put("enabled", true);
|
||||||
isAllowedBackDatedTransactionsBeforeInterestPostingDate.put("trapDoor", false);
|
isAllowedBackDatedTransactionsBeforeInterestPostingDate.put("trapDoor", false);
|
||||||
defaults.add(isAllowedBackDatedTransactionsBeforeInterestPostingDate);
|
defaults.add(isAllowedBackDatedTransactionsBeforeInterestPostingDate);
|
||||||
|
|
||||||
HashMap<String, Object> isAllowedBackDatedTransactionsBeforeInterestPostingDateForDays = new HashMap<>();
|
HashMap<String, Object> isAllowedBackDatedTransactionsBeforeInterestPostingDateForDays = new HashMap<>();
|
||||||
isAllowedBackDatedTransactionsBeforeInterestPostingDateForDays.put("id", 39);
|
|
||||||
isAllowedBackDatedTransactionsBeforeInterestPostingDateForDays.put("name",
|
isAllowedBackDatedTransactionsBeforeInterestPostingDateForDays.put("name",
|
||||||
"allow-backdated-transaction-before-interest-posting-date-for-days");
|
GlobalConfigurationConstants.ALLOW_BACKDATED_TRANSACTION_BEFORE_INTEREST_POSTING_DATE_FOR_DAYS);
|
||||||
isAllowedBackDatedTransactionsBeforeInterestPostingDateForDays.put("value", 0);
|
isAllowedBackDatedTransactionsBeforeInterestPostingDateForDays.put("value", 0L);
|
||||||
isAllowedBackDatedTransactionsBeforeInterestPostingDateForDays.put("enabled", false);
|
isAllowedBackDatedTransactionsBeforeInterestPostingDateForDays.put("enabled", false);
|
||||||
isAllowedBackDatedTransactionsBeforeInterestPostingDateForDays.put("trapDoor", false);
|
isAllowedBackDatedTransactionsBeforeInterestPostingDateForDays.put("trapDoor", false);
|
||||||
defaults.add(isAllowedBackDatedTransactionsBeforeInterestPostingDateForDays);
|
defaults.add(isAllowedBackDatedTransactionsBeforeInterestPostingDateForDays);
|
||||||
|
|
||||||
HashMap<String, Object> isClientAccountNumberLengthModify = new HashMap<>();
|
HashMap<String, Object> isClientAccountNumberLengthModify = new HashMap<>();
|
||||||
isClientAccountNumberLengthModify.put("id", 40);
|
isClientAccountNumberLengthModify.put("name", GlobalConfigurationConstants.CUSTOM_ACCOUNT_NUMBER_LENGTH);
|
||||||
isClientAccountNumberLengthModify.put("name", "custom-account-number-length");
|
isClientAccountNumberLengthModify.put("value", 0L);
|
||||||
isClientAccountNumberLengthModify.put("value", 0);
|
|
||||||
isClientAccountNumberLengthModify.put("enabled", false);
|
isClientAccountNumberLengthModify.put("enabled", false);
|
||||||
isClientAccountNumberLengthModify.put("trapDoor", false);
|
isClientAccountNumberLengthModify.put("trapDoor", false);
|
||||||
defaults.add(isClientAccountNumberLengthModify);
|
defaults.add(isClientAccountNumberLengthModify);
|
||||||
|
|
||||||
HashMap<String, Object> isAccountNumberRandomGenerated = new HashMap<>();
|
HashMap<String, Object> isAccountNumberRandomGenerated = new HashMap<>();
|
||||||
isAccountNumberRandomGenerated.put("id", 41);
|
isAccountNumberRandomGenerated.put("name", GlobalConfigurationConstants.RANDOM_ACCOUNT_NUMBER);
|
||||||
isAccountNumberRandomGenerated.put("name", "random-account-number");
|
isAccountNumberRandomGenerated.put("value", 0L);
|
||||||
isAccountNumberRandomGenerated.put("value", 0);
|
|
||||||
isAccountNumberRandomGenerated.put("enabled", false);
|
isAccountNumberRandomGenerated.put("enabled", false);
|
||||||
isAccountNumberRandomGenerated.put("trapDoor", false);
|
isAccountNumberRandomGenerated.put("trapDoor", false);
|
||||||
defaults.add(isAccountNumberRandomGenerated);
|
defaults.add(isAccountNumberRandomGenerated);
|
||||||
|
|
||||||
HashMap<String, Object> isInterestAppropriationEnabled = new HashMap<>();
|
HashMap<String, Object> isInterestAppropriationEnabled = new HashMap<>();
|
||||||
isInterestAppropriationEnabled.put("id", 42);
|
isInterestAppropriationEnabled.put("name", GlobalConfigurationConstants.IS_INTEREST_TO_BE_RECOVERED_FIRST_WHEN_GREATER_THAN_EMI);
|
||||||
isInterestAppropriationEnabled.put("name", "is-interest-to-be-recovered-first-when-greater-than-emi");
|
isInterestAppropriationEnabled.put("value", 0L);
|
||||||
isInterestAppropriationEnabled.put("value", 0);
|
|
||||||
isInterestAppropriationEnabled.put("enabled", false);
|
isInterestAppropriationEnabled.put("enabled", false);
|
||||||
isInterestAppropriationEnabled.put("trapDoor", false);
|
isInterestAppropriationEnabled.put("trapDoor", false);
|
||||||
defaults.add(isInterestAppropriationEnabled);
|
defaults.add(isInterestAppropriationEnabled);
|
||||||
|
|
||||||
HashMap<String, Object> isPrincipalCompoundingDisabled = new HashMap<>();
|
HashMap<String, Object> isPrincipalCompoundingDisabled = new HashMap<>();
|
||||||
isPrincipalCompoundingDisabled.put("id", 43);
|
isPrincipalCompoundingDisabled.put("name", GlobalConfigurationConstants.IS_PRINCIPAL_COMPOUNDING_DISABLED_FOR_OVERDUE_LOANS);
|
||||||
isPrincipalCompoundingDisabled.put("name", "is-principal-compounding-disabled-for-overdue-loans");
|
isPrincipalCompoundingDisabled.put("value", 0L);
|
||||||
isPrincipalCompoundingDisabled.put("value", 0);
|
|
||||||
isPrincipalCompoundingDisabled.put("enabled", false);
|
isPrincipalCompoundingDisabled.put("enabled", false);
|
||||||
isPrincipalCompoundingDisabled.put("trapDoor", false);
|
isPrincipalCompoundingDisabled.put("trapDoor", false);
|
||||||
defaults.add(isPrincipalCompoundingDisabled);
|
defaults.add(isPrincipalCompoundingDisabled);
|
||||||
|
|
||||||
HashMap<String, Object> isBusinessDateEnabled = new HashMap<>();
|
HashMap<String, Object> isBusinessDateEnabled = new HashMap<>();
|
||||||
isBusinessDateEnabled.put("id", 44);
|
isBusinessDateEnabled.put("name", GlobalConfigurationConstants.ENABLE_BUSINESS_DATE);
|
||||||
isBusinessDateEnabled.put("name", "enable_business_date");
|
isBusinessDateEnabled.put("value", 0L);
|
||||||
isBusinessDateEnabled.put("value", 0);
|
|
||||||
isBusinessDateEnabled.put("enabled", false);
|
isBusinessDateEnabled.put("enabled", false);
|
||||||
isBusinessDateEnabled.put("trapDoor", false);
|
isBusinessDateEnabled.put("trapDoor", false);
|
||||||
defaults.add(isBusinessDateEnabled);
|
defaults.add(isBusinessDateEnabled);
|
||||||
|
|
||||||
HashMap<String, Object> isAutomaticCOBDateAdjustmentEnabled = new HashMap<>();
|
HashMap<String, Object> isAutomaticCOBDateAdjustmentEnabled = new HashMap<>();
|
||||||
isAutomaticCOBDateAdjustmentEnabled.put("id", 45);
|
isAutomaticCOBDateAdjustmentEnabled.put("name", GlobalConfigurationConstants.ENABLE_AUTOMATIC_COB_DATE_ADJUSTMENT);
|
||||||
isAutomaticCOBDateAdjustmentEnabled.put("name", "enable_automatic_cob_date_adjustment");
|
isAutomaticCOBDateAdjustmentEnabled.put("value", 0L);
|
||||||
isAutomaticCOBDateAdjustmentEnabled.put("value", 0);
|
|
||||||
isAutomaticCOBDateAdjustmentEnabled.put("enabled", true);
|
isAutomaticCOBDateAdjustmentEnabled.put("enabled", true);
|
||||||
isAutomaticCOBDateAdjustmentEnabled.put("trapDoor", false);
|
isAutomaticCOBDateAdjustmentEnabled.put("trapDoor", false);
|
||||||
defaults.add(isAutomaticCOBDateAdjustmentEnabled);
|
defaults.add(isAutomaticCOBDateAdjustmentEnabled);
|
||||||
|
|
||||||
HashMap<String, Object> isReversalTransactionAllowed = new HashMap<>();
|
HashMap<String, Object> isReversalTransactionAllowed = new HashMap<>();
|
||||||
isReversalTransactionAllowed.put("id", 46);
|
isReversalTransactionAllowed.put("name", GlobalConfigurationConstants.ENABLE_POST_REVERSAL_TXNS_FOR_REVERSE_TRANSACTIONS);
|
||||||
isReversalTransactionAllowed.put("name", "enable-post-reversal-txns-for-reverse-transactions");
|
isReversalTransactionAllowed.put("value", 0L);
|
||||||
isReversalTransactionAllowed.put("value", 0);
|
|
||||||
isReversalTransactionAllowed.put("enabled", false);
|
isReversalTransactionAllowed.put("enabled", false);
|
||||||
isReversalTransactionAllowed.put("trapDoor", false);
|
isReversalTransactionAllowed.put("trapDoor", false);
|
||||||
defaults.add(isReversalTransactionAllowed);
|
defaults.add(isReversalTransactionAllowed);
|
||||||
|
|
||||||
HashMap<String, Object> purgeExternalEventsOlderThanDaysDefault = new HashMap<>();
|
HashMap<String, Object> purgeExternalEventsOlderThanDaysDefault = new HashMap<>();
|
||||||
purgeExternalEventsOlderThanDaysDefault.put("id", 47);
|
purgeExternalEventsOlderThanDaysDefault.put("name", GlobalConfigurationConstants.PURGE_EXTERNAL_EVENTS_OLDER_THAN_DAYS);
|
||||||
purgeExternalEventsOlderThanDaysDefault.put("name", "purge-external-events-older-than-days");
|
purgeExternalEventsOlderThanDaysDefault.put("value", 30L);
|
||||||
purgeExternalEventsOlderThanDaysDefault.put("value", 30);
|
|
||||||
purgeExternalEventsOlderThanDaysDefault.put("enabled", false);
|
purgeExternalEventsOlderThanDaysDefault.put("enabled", false);
|
||||||
purgeExternalEventsOlderThanDaysDefault.put("trapDoor", false);
|
purgeExternalEventsOlderThanDaysDefault.put("trapDoor", false);
|
||||||
defaults.add(purgeExternalEventsOlderThanDaysDefault);
|
defaults.add(purgeExternalEventsOlderThanDaysDefault);
|
||||||
|
|
||||||
HashMap<String, Object> loanRepaymentDueDaysDefault = new HashMap<>();
|
HashMap<String, Object> loanRepaymentDueDaysDefault = new HashMap<>();
|
||||||
loanRepaymentDueDaysDefault.put("id", 48);
|
loanRepaymentDueDaysDefault.put("name", GlobalConfigurationConstants.DAYS_BEFORE_REPAYMENT_IS_DUE);
|
||||||
loanRepaymentDueDaysDefault.put("name", "days-before-repayment-is-due");
|
loanRepaymentDueDaysDefault.put("value", 1L);
|
||||||
loanRepaymentDueDaysDefault.put("value", 1);
|
|
||||||
loanRepaymentDueDaysDefault.put("enabled", false);
|
loanRepaymentDueDaysDefault.put("enabled", false);
|
||||||
loanRepaymentDueDaysDefault.put("trapDoor", false);
|
loanRepaymentDueDaysDefault.put("trapDoor", false);
|
||||||
defaults.add(loanRepaymentDueDaysDefault);
|
defaults.add(loanRepaymentDueDaysDefault);
|
||||||
|
|
||||||
HashMap<String, Object> loanRepaymentOverdueDaysDefault = new HashMap<>();
|
HashMap<String, Object> loanRepaymentOverdueDaysDefault = new HashMap<>();
|
||||||
loanRepaymentOverdueDaysDefault.put("id", 49);
|
loanRepaymentOverdueDaysDefault.put("name", GlobalConfigurationConstants.DAYS_AFTER_REPAYMENT_IS_OVERDUE);
|
||||||
loanRepaymentOverdueDaysDefault.put("name", "days-after-repayment-is-overdue");
|
loanRepaymentOverdueDaysDefault.put("value", 1L);
|
||||||
loanRepaymentOverdueDaysDefault.put("value", 1);
|
|
||||||
loanRepaymentOverdueDaysDefault.put("enabled", false);
|
loanRepaymentOverdueDaysDefault.put("enabled", false);
|
||||||
loanRepaymentOverdueDaysDefault.put("trapDoor", false);
|
loanRepaymentOverdueDaysDefault.put("trapDoor", false);
|
||||||
defaults.add(loanRepaymentOverdueDaysDefault);
|
defaults.add(loanRepaymentOverdueDaysDefault);
|
||||||
|
|
||||||
HashMap<String, Object> isAutomaticExternalIdGenerationEnabled = new HashMap<>();
|
HashMap<String, Object> isAutomaticExternalIdGenerationEnabled = new HashMap<>();
|
||||||
isAutomaticExternalIdGenerationEnabled.put("id", 50);
|
isAutomaticExternalIdGenerationEnabled.put("name", GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID);
|
||||||
isAutomaticExternalIdGenerationEnabled.put("name", "enable-auto-generated-external-id");
|
isAutomaticExternalIdGenerationEnabled.put("value", 0L);
|
||||||
isAutomaticExternalIdGenerationEnabled.put("value", 0);
|
|
||||||
isAutomaticExternalIdGenerationEnabled.put("enabled", false);
|
isAutomaticExternalIdGenerationEnabled.put("enabled", false);
|
||||||
isAutomaticExternalIdGenerationEnabled.put("trapDoor", false);
|
isAutomaticExternalIdGenerationEnabled.put("trapDoor", false);
|
||||||
defaults.add(isAutomaticExternalIdGenerationEnabled);
|
defaults.add(isAutomaticExternalIdGenerationEnabled);
|
||||||
|
|
||||||
HashMap<String, Object> purgeProcessCommandDaysDefault = new HashMap<>();
|
HashMap<String, Object> purgeProcessCommandDaysDefault = new HashMap<>();
|
||||||
purgeProcessCommandDaysDefault.put("id", 51);
|
purgeProcessCommandDaysDefault.put("name", GlobalConfigurationConstants.PURGE_PROCESSED_COMMANDS_OLDER_THAN_DAYS);
|
||||||
purgeProcessCommandDaysDefault.put("name", "purge-processed-commands-older-than-days");
|
purgeProcessCommandDaysDefault.put("value", 30L);
|
||||||
purgeProcessCommandDaysDefault.put("value", 30);
|
|
||||||
purgeProcessCommandDaysDefault.put("enabled", false);
|
purgeProcessCommandDaysDefault.put("enabled", false);
|
||||||
purgeProcessCommandDaysDefault.put("trapDoor", false);
|
purgeProcessCommandDaysDefault.put("trapDoor", false);
|
||||||
defaults.add(purgeProcessCommandDaysDefault);
|
defaults.add(purgeProcessCommandDaysDefault);
|
||||||
|
|
||||||
HashMap<String, Object> isCOBBulkEventEnabled = new HashMap<>();
|
HashMap<String, Object> isCOBBulkEventEnabled = new HashMap<>();
|
||||||
isCOBBulkEventEnabled.put("id", 52);
|
isCOBBulkEventEnabled.put("name", GlobalConfigurationConstants.ENABLE_COB_BULK_EVENT);
|
||||||
isCOBBulkEventEnabled.put("name", "enable-cob-bulk-event");
|
isCOBBulkEventEnabled.put("value", 0L);
|
||||||
isCOBBulkEventEnabled.put("value", 0);
|
|
||||||
isCOBBulkEventEnabled.put("enabled", false);
|
isCOBBulkEventEnabled.put("enabled", false);
|
||||||
isCOBBulkEventEnabled.put("trapDoor", false);
|
isCOBBulkEventEnabled.put("trapDoor", false);
|
||||||
defaults.add(isCOBBulkEventEnabled);
|
defaults.add(isCOBBulkEventEnabled);
|
||||||
|
|
||||||
HashMap<String, Object> externalEventBatchSize = new HashMap<>();
|
HashMap<String, Object> externalEventBatchSize = new HashMap<>();
|
||||||
externalEventBatchSize.put("id", 53);
|
externalEventBatchSize.put("name", GlobalConfigurationConstants.EXTERNAL_EVENT_BATCH_SIZE);
|
||||||
externalEventBatchSize.put("name", "external-event-batch-size");
|
externalEventBatchSize.put("value", 1000L);
|
||||||
externalEventBatchSize.put("value", 1000);
|
|
||||||
externalEventBatchSize.put("enabled", false);
|
externalEventBatchSize.put("enabled", false);
|
||||||
externalEventBatchSize.put("trapDoor", false);
|
externalEventBatchSize.put("trapDoor", false);
|
||||||
defaults.add(externalEventBatchSize);
|
defaults.add(externalEventBatchSize);
|
||||||
|
|
||||||
HashMap<String, Object> reportExportS3FolderName = new HashMap<>();
|
HashMap<String, Object> reportExportS3FolderName = new HashMap<>();
|
||||||
reportExportS3FolderName.put("id", 54);
|
reportExportS3FolderName.put("name", GlobalConfigurationConstants.REPORT_EXPORT_S3_FOLDER_NAME);
|
||||||
reportExportS3FolderName.put("name", "report-export-s3-folder-name");
|
reportExportS3FolderName.put("value", 0L);
|
||||||
reportExportS3FolderName.put("value", 0);
|
|
||||||
reportExportS3FolderName.put("enabled", true);
|
reportExportS3FolderName.put("enabled", true);
|
||||||
reportExportS3FolderName.put("trapDoor", false);
|
reportExportS3FolderName.put("trapDoor", false);
|
||||||
defaults.add(reportExportS3FolderName);
|
defaults.add(reportExportS3FolderName);
|
||||||
|
|
||||||
HashMap<String, Object> loanArrearsDelinquencyDisplayData = new HashMap<>();
|
HashMap<String, Object> loanArrearsDelinquencyDisplayData = new HashMap<>();
|
||||||
loanArrearsDelinquencyDisplayData.put("id", 55);
|
loanArrearsDelinquencyDisplayData.put("name", GlobalConfigurationConstants.LOAN_ARREARS_DELINQUENCY_DISPLAY_DATA);
|
||||||
loanArrearsDelinquencyDisplayData.put("name", "loan-arrears-delinquency-display-data");
|
loanArrearsDelinquencyDisplayData.put("value", 0L);
|
||||||
loanArrearsDelinquencyDisplayData.put("value", 0);
|
|
||||||
loanArrearsDelinquencyDisplayData.put("enabled", true);
|
loanArrearsDelinquencyDisplayData.put("enabled", true);
|
||||||
loanArrearsDelinquencyDisplayData.put("trapDoor", false);
|
loanArrearsDelinquencyDisplayData.put("trapDoor", false);
|
||||||
defaults.add(loanArrearsDelinquencyDisplayData);
|
defaults.add(loanArrearsDelinquencyDisplayData);
|
||||||
|
|
||||||
HashMap<String, Object> accrualForChargeDate = new HashMap<>();
|
HashMap<String, Object> accrualForChargeDate = new HashMap<>();
|
||||||
accrualForChargeDate.put("id", 56);
|
accrualForChargeDate.put("name", GlobalConfigurationConstants.CHARGE_ACCRUAL_DATE);
|
||||||
accrualForChargeDate.put("name", "charge-accrual-date");
|
accrualForChargeDate.put("value", 0L);
|
||||||
accrualForChargeDate.put("value", 0);
|
|
||||||
accrualForChargeDate.put("enabled", true);
|
accrualForChargeDate.put("enabled", true);
|
||||||
accrualForChargeDate.put("trapDoor", false);
|
accrualForChargeDate.put("trapDoor", false);
|
||||||
accrualForChargeDate.put("string_value", "due-date");
|
accrualForChargeDate.put("string_value", "due-date");
|
||||||
defaults.add(accrualForChargeDate);
|
defaults.add(accrualForChargeDate);
|
||||||
|
|
||||||
HashMap<String, Object> assetExternalizationOfNonActiveLoans = new HashMap<>();
|
HashMap<String, Object> assetExternalizationOfNonActiveLoans = new HashMap<>();
|
||||||
assetExternalizationOfNonActiveLoans.put("id", 57);
|
assetExternalizationOfNonActiveLoans.put("name", GlobalConfigurationConstants.ASSET_EXTERNALIZATION_OF_NON_ACTIVE_LOANS);
|
||||||
assetExternalizationOfNonActiveLoans.put("name", "asset-externalization-of-non-active-loans");
|
assetExternalizationOfNonActiveLoans.put("value", 0L);
|
||||||
assetExternalizationOfNonActiveLoans.put("value", 0);
|
|
||||||
assetExternalizationOfNonActiveLoans.put("enabled", true);
|
assetExternalizationOfNonActiveLoans.put("enabled", true);
|
||||||
assetExternalizationOfNonActiveLoans.put("trapDoor", false);
|
assetExternalizationOfNonActiveLoans.put("trapDoor", false);
|
||||||
defaults.add(assetExternalizationOfNonActiveLoans);
|
defaults.add(assetExternalizationOfNonActiveLoans);
|
||||||
|
|
||||||
HashMap<String, Object> enableSameMakerChecker = new HashMap<>();
|
HashMap<String, Object> enableSameMakerChecker = new HashMap<>();
|
||||||
enableSameMakerChecker.put("id", 58);
|
enableSameMakerChecker.put("name", GlobalConfigurationConstants.ENABLE_SAME_MAKER_CHECKER);
|
||||||
enableSameMakerChecker.put("name", "enable-same-maker-checker");
|
enableSameMakerChecker.put("value", 0L);
|
||||||
enableSameMakerChecker.put("value", 0);
|
|
||||||
enableSameMakerChecker.put("enabled", false);
|
enableSameMakerChecker.put("enabled", false);
|
||||||
enableSameMakerChecker.put("trapDoor", false);
|
enableSameMakerChecker.put("trapDoor", false);
|
||||||
defaults.add(enableSameMakerChecker);
|
defaults.add(enableSameMakerChecker);
|
||||||
|
|
||||||
HashMap<String, Object> nextPaymentDateConfigForLoan = new HashMap<>();
|
HashMap<String, Object> nextPaymentDateConfigForLoan = new HashMap<>();
|
||||||
nextPaymentDateConfigForLoan.put("id", 59);
|
nextPaymentDateConfigForLoan.put("name", GlobalConfigurationConstants.NEXT_PAYMENT_DUE_DATE);
|
||||||
nextPaymentDateConfigForLoan.put("name", "next-payment-due-date");
|
nextPaymentDateConfigForLoan.put("value", 0L);
|
||||||
nextPaymentDateConfigForLoan.put("value", 0);
|
|
||||||
nextPaymentDateConfigForLoan.put("enabled", true);
|
nextPaymentDateConfigForLoan.put("enabled", true);
|
||||||
nextPaymentDateConfigForLoan.put("trapDoor", false);
|
nextPaymentDateConfigForLoan.put("trapDoor", false);
|
||||||
nextPaymentDateConfigForLoan.put("string_value", "earliest-unpaid-date");
|
nextPaymentDateConfigForLoan.put("string_value", "earliest-unpaid-date");
|
||||||
defaults.add(nextPaymentDateConfigForLoan);
|
defaults.add(nextPaymentDateConfigForLoan);
|
||||||
|
|
||||||
HashMap<String, Object> enablePaymentHubIntegrationConfig = new HashMap<>();
|
HashMap<String, Object> enablePaymentHubIntegrationConfig = new HashMap<>();
|
||||||
enablePaymentHubIntegrationConfig.put("id", 60);
|
enablePaymentHubIntegrationConfig.put("name", GlobalConfigurationConstants.ENABLE_PAYMENT_HUB_INTEGRATION);
|
||||||
enablePaymentHubIntegrationConfig.put("name", "enable-payment-hub-integration");
|
enablePaymentHubIntegrationConfig.put("value", 0L);
|
||||||
enablePaymentHubIntegrationConfig.put("value", 0);
|
|
||||||
enablePaymentHubIntegrationConfig.put("enabled", false);
|
enablePaymentHubIntegrationConfig.put("enabled", false);
|
||||||
enablePaymentHubIntegrationConfig.put("trapDoor", false);
|
enablePaymentHubIntegrationConfig.put("trapDoor", false);
|
||||||
enablePaymentHubIntegrationConfig.put("string_value", "enable payment hub integration");
|
enablePaymentHubIntegrationConfig.put("string_value", "enable payment hub integration");
|
||||||
@@ -602,159 +531,21 @@ public class GlobalConfigurationHelper {
|
|||||||
return defaults;
|
return defaults;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Integer updateValueForGlobalConfiguration(final RequestSpecification requestSpec,
|
public PutGlobalConfigurationsResponse updateGlobalConfiguration(final String configName, PutGlobalConfigurationsRequest request) {
|
||||||
final ResponseSpecification responseSpec, final String configId, final String value) {
|
|
||||||
final String GLOBAL_CONFIG_UPDATE_URL = "/fineract-provider/api/v1/configurations/" + configId + "?" + Utils.TENANT_IDENTIFIER;
|
|
||||||
log.info("---------------------------------UPDATE VALUE FOR GLOBAL CONFIG---------------------------------------------");
|
log.info("---------------------------------UPDATE VALUE FOR GLOBAL CONFIG---------------------------------------------");
|
||||||
return Utils.performServerPut(requestSpec, responseSpec, GLOBAL_CONFIG_UPDATE_URL, updateGlobalConfigUpdateValueAsJSON(value),
|
return ok(fineract().globalConfigurations.updateConfigurationByName(configName, request));
|
||||||
"resourceId");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Integer updateValueForGlobalConfiguration(final RequestSpecification requestSpec,
|
public void updateGlobalConfigurationInternal(final String configName, final Long value) {
|
||||||
final ResponseSpecification responseSpec, final String configId, final int value) {
|
|
||||||
return updateValueForGlobalConfiguration(requestSpec, responseSpec, configId, Integer.toString(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Integer updateEnabledFlagForGlobalConfiguration(final RequestSpecification requestSpec,
|
|
||||||
final ResponseSpecification responseSpec, final long configId, final boolean enabled) {
|
|
||||||
final String GLOBAL_CONFIG_UPDATE_URL = "/fineract-provider/api/v1/configurations/" + configId + "?" + Utils.TENANT_IDENTIFIER;
|
|
||||||
log.info("---------------------------------UPDATE GLOBAL CONFIG FOR ENABLED FLAG---------------------------------------------");
|
|
||||||
return Utils.performServerPut(requestSpec, responseSpec, GLOBAL_CONFIG_UPDATE_URL,
|
|
||||||
updateGlobalConfigUpdateEnabledFlagAsJSON(enabled), "resourceId");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void updateValueForGlobalConfigurationInternal(final RequestSpecification requestSpec,
|
|
||||||
final ResponseSpecification responseSpec, final String configId, final int value) {
|
|
||||||
final String GLOBAL_CONFIG_UPDATE_URL = "/fineract-provider/api/v1/internal/configurations/" + configId + "/value/" + value + "?"
|
|
||||||
+ Utils.TENANT_IDENTIFIER;
|
|
||||||
log.info("---------------------------UPDATE VALUE FOR GLOBAL CONFIG (internal) ---------------------------------------");
|
log.info("---------------------------UPDATE VALUE FOR GLOBAL CONFIG (internal) ---------------------------------------");
|
||||||
Utils.performServerPost(requestSpec, responseSpec, GLOBAL_CONFIG_UPDATE_URL, Utils.emptyJson());
|
ok(fineract().legacy.updateGlobalConfiguration(configName, value));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated because it's using configId as a String
|
public void manageConfigurations(final String configurationName, final boolean enabled) {
|
||||||
@Deprecated
|
GlobalConfigurationPropertyData configuration = getGlobalConfigurationByName(configurationName);
|
||||||
public static Integer updateEnabledFlagForGlobalConfiguration(final RequestSpecification requestSpec,
|
|
||||||
final ResponseSpecification responseSpec, final String configId, final boolean enabled) {
|
|
||||||
final String GLOBAL_CONFIG_UPDATE_URL = "/fineract-provider/api/v1/configurations/" + configId + "?" + Utils.TENANT_IDENTIFIER;
|
|
||||||
log.info("---------------------------------UPDATE GLOBAL CONFIG FOR ENABLED FLAG---------------------------------------------");
|
|
||||||
return Utils.performServerPut(requestSpec, responseSpec, GLOBAL_CONFIG_UPDATE_URL,
|
|
||||||
updateGlobalConfigUpdateEnabledFlagAsJSON(enabled), "resourceId");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ArrayList getGlobalConfigurationIsCacheEnabled(final RequestSpecification requestSpec,
|
|
||||||
final ResponseSpecification responseSpec) {
|
|
||||||
final String GET_IS_CACHE_GLOBAL_CONFIG_URL = "/fineract-provider/api/v1/caches?" + Utils.TENANT_IDENTIFIER;
|
|
||||||
log.info("------------------------ RETRIEVING IS CACHE ENABLED GLOBAL CONFIGURATION -------------------------");
|
|
||||||
final ArrayList<HashMap> response = Utils.performServerGet(requestSpec, responseSpec, GET_IS_CACHE_GLOBAL_CONFIG_URL, "");
|
|
||||||
return response;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static HashMap updateIsCacheEnabledForGlobalConfiguration(final RequestSpecification requestSpec,
|
|
||||||
final ResponseSpecification responseSpec, final String cacheType) {
|
|
||||||
final String IS_CACHE_GLOBAL_CONFIG_UPDATE_URL = "/fineract-provider/api/v1/caches?" + Utils.TENANT_IDENTIFIER;
|
|
||||||
log.info("------------------UPDATE GLOBAL CONFIG FOR IS CACHE ENABLED----------------------");
|
|
||||||
return Utils.performServerPut(requestSpec, responseSpec, IS_CACHE_GLOBAL_CONFIG_UPDATE_URL,
|
|
||||||
updateIsCacheEnabledGlobalConfigUpdateAsJSON(cacheType), "changes");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Object updatePasswordResetDaysForGlobalConfiguration(final RequestSpecification requestSpec,
|
|
||||||
final ResponseSpecification responseSpec, final Integer configId, final String value, final String enabled,
|
|
||||||
final String jsonAttributeToGetBack) {
|
|
||||||
final String UPDATE_URL = "/fineract-provider/api/v1/configurations/" + configId + "?" + Utils.TENANT_IDENTIFIER;
|
|
||||||
log.info("------------------UPDATE GLOBAL CONFIG FOR FORCE PASSWORD RESET DAYS----------------------");
|
|
||||||
return Utils.performServerPut(requestSpec, responseSpec, UPDATE_URL, updatePasswordResetDaysGlobalConfigAsJSON(value, enabled),
|
|
||||||
jsonAttributeToGetBack);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String updateGlobalConfigUpdateValueAsJSON(final String value) {
|
|
||||||
final HashMap<String, String> map = new HashMap<>();
|
|
||||||
map.put("value", value);
|
|
||||||
log.info("map : {}", map);
|
|
||||||
return GSON.toJson(map);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String updatePasswordResetDaysGlobalConfigAsJSON(final String value, final String enabled) {
|
|
||||||
final HashMap<String, String> map = new HashMap<>();
|
|
||||||
if (value != null) {
|
|
||||||
map.put("value", value);
|
|
||||||
}
|
|
||||||
map.put("enabled", enabled);
|
|
||||||
log.info("map : {}", map);
|
|
||||||
return new Gson().toJson(map);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String updateGlobalConfigUpdateEnabledFlagAsJSON(final Boolean enabled) {
|
|
||||||
final HashMap<String, Boolean> map = new HashMap<String, Boolean>();
|
|
||||||
map.put("enabled", enabled);
|
|
||||||
log.info("map : {}", map);
|
|
||||||
return new Gson().toJson(map);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String updateIsCacheEnabledGlobalConfigUpdateAsJSON(final String cacheType) {
|
|
||||||
final HashMap<String, String> map = new HashMap<>();
|
|
||||||
map.put("cacheType", cacheType);
|
|
||||||
log.info("map : {}", map);
|
|
||||||
return new Gson().toJson(map);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Integer updateIsBusinessDateEnabled(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
|
||||||
final boolean enabled) {
|
|
||||||
long configId = 44;
|
|
||||||
return updateEnabledFlagForGlobalConfiguration(requestSpec, responseSpec, configId, enabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void manageConfigurations(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
|
||||||
final String configurationName, final boolean enabled) {
|
|
||||||
GlobalConfigurationPropertyData configuration = getGlobalConfigurationByName(requestSpec, responseSpec, configurationName);
|
|
||||||
assertNotNull(configuration);
|
assertNotNull(configuration);
|
||||||
updateEnabledFlagForGlobalConfiguration(requestSpec, responseSpec, configuration.getId(), enabled);
|
updateGlobalConfiguration(configurationName, new PutGlobalConfigurationsRequest().enabled(enabled));
|
||||||
GlobalConfigurationPropertyData updatedConfiguration = getGlobalConfigurationByName(requestSpec, responseSpec, configurationName);
|
GlobalConfigurationPropertyData updatedConfiguration = getGlobalConfigurationByName(configurationName);
|
||||||
assertEquals(updatedConfiguration.getEnabled(), enabled);
|
assertEquals(updatedConfiguration.getEnabled(), enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Integer updateIsAutomaticExternalIdGenerationEnabled(final RequestSpecification requestSpec,
|
|
||||||
final ResponseSpecification responseSpec, final boolean enabled) {
|
|
||||||
long configId = 50;
|
|
||||||
return updateEnabledFlagForGlobalConfiguration(requestSpec, responseSpec, configId, enabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Integer updateChargeAccrualDateConfiguration(final RequestSpecification requestSpec,
|
|
||||||
final ResponseSpecification responseSpec, final String stringValue) {
|
|
||||||
long configId = 56;
|
|
||||||
final HashMap<String, String> map = new HashMap<>();
|
|
||||||
map.put("stringValue", stringValue);
|
|
||||||
log.info("map : {}", map);
|
|
||||||
final String configValue = GSON.toJson(map);
|
|
||||||
final String GLOBAL_CONFIG_UPDATE_URL = "/fineract-provider/api/v1/configurations/" + configId + "?" + Utils.TENANT_IDENTIFIER;
|
|
||||||
log.info("---------------------------------UPDATE VALUE FOR GLOBAL CONFIG---------------------------------------------");
|
|
||||||
return Utils.performServerPut(requestSpec, responseSpec, GLOBAL_CONFIG_UPDATE_URL, configValue, "resourceId");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Integer updateLoanNextPaymentDateConfiguration(final RequestSpecification requestSpec,
|
|
||||||
final ResponseSpecification responseSpec, final String stringValue) {
|
|
||||||
long configId = 59;
|
|
||||||
final HashMap<String, String> map = new HashMap<>();
|
|
||||||
map.put("stringValue", stringValue);
|
|
||||||
log.info("map : {}", map);
|
|
||||||
final String configValue = GSON.toJson(map);
|
|
||||||
final String GLOBAL_CONFIG_UPDATE_URL = "/fineract-provider/api/v1/configurations/" + configId + "?" + Utils.TENANT_IDENTIFIER;
|
|
||||||
log.info("---------------------------------UPDATE VALUE FOR GLOBAL CONFIG---------------------------------------------");
|
|
||||||
return Utils.performServerPut(requestSpec, responseSpec, GLOBAL_CONFIG_UPDATE_URL, configValue, "resourceId");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Integer updateEnablePaymentHubIntegrationConfiguration(final RequestSpecification requestSpec,
|
|
||||||
final ResponseSpecification responseSpec, final String stringValue) {
|
|
||||||
long configId = 60;
|
|
||||||
final HashMap<String, String> map = new HashMap<>();
|
|
||||||
map.put("stringValue", stringValue);
|
|
||||||
log.info("map : {}", map);
|
|
||||||
final String configValue = GSON.toJson(map);
|
|
||||||
final String GLOBAL_CONFIG_UPDATE_URL = "/fineract-provider/api/v1/configurations/" + configId + "?" + Utils.TENANT_IDENTIFIER;
|
|
||||||
log.info("---------------------------------UPDATE VALUE FOR GLOBAL CONFIG---------------------------------------------");
|
|
||||||
return Utils.performServerPut(requestSpec, responseSpec, GLOBAL_CONFIG_UPDATE_URL, configValue, "resourceId");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+32
@@ -0,0 +1,32 @@
|
|||||||
|
/**
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing,
|
||||||
|
* software distributed under the License is distributed on an
|
||||||
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
* KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
package org.apache.fineract.integrationtests.common.report;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Map;
|
||||||
|
import okhttp3.ResponseBody;
|
||||||
|
import org.apache.fineract.integrationtests.client.IntegrationTest;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
public class ReportHelper extends IntegrationTest {
|
||||||
|
|
||||||
|
public Response<ResponseBody> runReport(String reportName, Map<String, String> reportParameters) throws IOException {
|
||||||
|
return fineract().reportsRun.runReportGetFile("Transaction Summary Report with Asset Owner", reportParameters, false).execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
+12
-4
@@ -61,10 +61,12 @@ import org.apache.fineract.client.models.GetDataTablesResponse;
|
|||||||
import org.apache.fineract.client.models.PagedLocalRequestAdvancedQueryData;
|
import org.apache.fineract.client.models.PagedLocalRequestAdvancedQueryData;
|
||||||
import org.apache.fineract.client.models.PagedLocalRequestAdvancedQueryRequest;
|
import org.apache.fineract.client.models.PagedLocalRequestAdvancedQueryRequest;
|
||||||
import org.apache.fineract.client.models.PostDataTablesResponse;
|
import org.apache.fineract.client.models.PostDataTablesResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.client.models.ResultsetColumnHeaderData;
|
import org.apache.fineract.client.models.ResultsetColumnHeaderData;
|
||||||
import org.apache.fineract.client.models.SortOrder;
|
import org.apache.fineract.client.models.SortOrder;
|
||||||
import org.apache.fineract.client.models.TableQueryData;
|
import org.apache.fineract.client.models.TableQueryData;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
import org.apache.fineract.infrastructure.core.service.DateUtils;
|
||||||
import org.apache.fineract.infrastructure.dataqueries.data.EntityTables;
|
import org.apache.fineract.infrastructure.dataqueries.data.EntityTables;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
@@ -106,6 +108,7 @@ public class DatatableAdvancedQueryTest {
|
|||||||
private DatatableHelper datatableHelper;
|
private DatatableHelper datatableHelper;
|
||||||
private SavingsProductHelper savingsProductHelper;
|
private SavingsProductHelper savingsProductHelper;
|
||||||
private SavingsAccountHelper savingsAccountHelper;
|
private SavingsAccountHelper savingsAccountHelper;
|
||||||
|
private GlobalConfigurationHelper globalConfigurationHelper;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@@ -116,6 +119,7 @@ public class DatatableAdvancedQueryTest {
|
|||||||
datatableHelper = new DatatableHelper(requestSpec, responseSpec);
|
datatableHelper = new DatatableHelper(requestSpec, responseSpec);
|
||||||
savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
|
savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
|
||||||
savingsProductHelper = new SavingsProductHelper();
|
savingsProductHelper = new SavingsProductHelper();
|
||||||
|
globalConfigurationHelper = new GlobalConfigurationHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -126,7 +130,8 @@ public class DatatableAdvancedQueryTest {
|
|||||||
LocalDate yesterday = today.minus(1, ChronoUnit.DAYS);
|
LocalDate yesterday = today.minus(1, ChronoUnit.DAYS);
|
||||||
String yesterdayS = DateUtils.format(yesterday, SAVINGS_DATE_FORMAT);
|
String yesterdayS = DateUtils.format(yesterday, SAVINGS_DATE_FORMAT);
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, true);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, today);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, today);
|
||||||
|
|
||||||
final Integer clientId = ClientHelper.createClient(requestSpec, responseSpec, yesterdayS);
|
final Integer clientId = ClientHelper.createClient(requestSpec, responseSpec, yesterdayS);
|
||||||
@@ -197,7 +202,8 @@ public class DatatableAdvancedQueryTest {
|
|||||||
deleteDatatable(datatable, transactionIdD1, transactionIdD2, transactionIdW1);
|
deleteDatatable(datatable, transactionIdD1, transactionIdD2, transactionIdW1);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, false);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,7 +216,8 @@ public class DatatableAdvancedQueryTest {
|
|||||||
LocalDate yesterday = today.minus(1, ChronoUnit.DAYS);
|
LocalDate yesterday = today.minus(1, ChronoUnit.DAYS);
|
||||||
String yesterdayS = DateUtils.format(yesterday, SAVINGS_DATE_FORMAT);
|
String yesterdayS = DateUtils.format(yesterday, SAVINGS_DATE_FORMAT);
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, true);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, today);
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, today);
|
||||||
|
|
||||||
final Integer clientId = ClientHelper.createClient(requestSpec, responseSpec, yesterdayS);
|
final Integer clientId = ClientHelper.createClient(requestSpec, responseSpec, yesterdayS);
|
||||||
@@ -298,7 +305,8 @@ public class DatatableAdvancedQueryTest {
|
|||||||
deleteDatatable(datatable, transactionIdD1, transactionIdD2, transactionIdW1);
|
deleteDatatable(datatable, transactionIdD1, transactionIdD2, transactionIdW1);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, false);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+38
-22
@@ -42,19 +42,20 @@ import org.apache.fineract.client.models.GetDelinquencyTagHistoryResponse;
|
|||||||
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
import org.apache.fineract.client.models.GetLoansLoanIdResponse;
|
||||||
import org.apache.fineract.client.models.PostDelinquencyBucketResponse;
|
import org.apache.fineract.client.models.PostDelinquencyBucketResponse;
|
||||||
import org.apache.fineract.client.models.PostDelinquencyRangeResponse;
|
import org.apache.fineract.client.models.PostDelinquencyRangeResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
import org.apache.fineract.infrastructure.businessdate.domain.BusinessDateType;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
|
import org.apache.fineract.integrationtests.BaseLoanIntegrationTest;
|
||||||
import org.apache.fineract.integrationtests.common.BatchHelper;
|
import org.apache.fineract.integrationtests.common.BatchHelper;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanAccountLockHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanAccountLockHelper;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
|
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
|
||||||
import org.apache.fineract.integrationtests.common.products.DelinquencyRangesHelper;
|
import org.apache.fineract.integrationtests.common.products.DelinquencyRangesHelper;
|
||||||
@@ -63,11 +64,9 @@ import org.apache.http.HttpStatus;
|
|||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class InlineLoanCOBTest extends BaseLoanIntegrationTest {
|
||||||
public class InlineLoanCOBTest {
|
|
||||||
|
|
||||||
private ResponseSpecification responseSpec;
|
private ResponseSpecification responseSpec;
|
||||||
private RequestSpecification requestSpec;
|
private RequestSpecification requestSpec;
|
||||||
@@ -88,10 +87,12 @@ public class InlineLoanCOBTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testInlineCOB() {
|
public void testInlineCOB() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "0");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(0L));
|
||||||
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||||
|
|
||||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec);
|
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec);
|
||||||
@@ -141,14 +142,16 @@ public class InlineLoanCOBTest {
|
|||||||
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||||
requestSpec.header("Fineract-Platform-TenantId", "default");
|
requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||||
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInlineCOBCatchUpLoans() {
|
public void testInlineCOBCatchUpLoans() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||||
|
|
||||||
@@ -236,17 +239,20 @@ public class InlineLoanCOBTest {
|
|||||||
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||||
requestSpec.header("Fineract-Platform-TenantId", "default");
|
requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||||
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInlineCOBOnRepaymentWithSoftLockedLoan() {
|
public void testInlineCOBOnRepaymentWithSoftLockedLoan() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
|
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "0");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(0L));
|
||||||
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||||
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
||||||
|
|
||||||
@@ -295,16 +301,19 @@ public class InlineLoanCOBTest {
|
|||||||
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||||
requestSpec.header("Fineract-Platform-TenantId", "default");
|
requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||||
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInlineCOBCatchUpOnRepaymentWithNotLockedLoan() {
|
public void testInlineCOBCatchUpOnRepaymentWithNotLockedLoan() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "0");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(0L));
|
||||||
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||||
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
||||||
|
|
||||||
@@ -352,16 +361,19 @@ public class InlineLoanCOBTest {
|
|||||||
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||||
requestSpec.header("Fineract-Platform-TenantId", "default");
|
requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||||
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInlineCOBOnBatchAPIWithOldRelativeUrls() {
|
public void testInlineCOBOnBatchAPIWithOldRelativeUrls() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "0");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(0L));
|
||||||
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||||
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
||||||
|
|
||||||
@@ -419,16 +431,19 @@ public class InlineLoanCOBTest {
|
|||||||
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||||
requestSpec.header("Fineract-Platform-TenantId", "default");
|
requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||||
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInlineCOBOnBatchAPI() {
|
public void testInlineCOBOnBatchAPI() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
BusinessDateHelper.updateBusinessDate(requestSpec, responseSpec, BusinessDateType.BUSINESS_DATE, LocalDate.of(2020, 3, 2));
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec, "10", "0");
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.PENALTY_WAIT_PERIOD,
|
||||||
|
new PutGlobalConfigurationsRequest().value(0L));
|
||||||
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||||
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
loanAccountLockHelper = new LoanAccountLockHelper(requestSpec, new ResponseSpecBuilder().expectStatusCode(202).build());
|
||||||
|
|
||||||
@@ -486,7 +501,8 @@ public class InlineLoanCOBTest {
|
|||||||
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||||
requestSpec.header("Fineract-Platform-TenantId", "default");
|
requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||||
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(requestSpec, responseSpec, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-12
@@ -52,12 +52,14 @@ import org.apache.fineract.client.models.PageExternalTransferData;
|
|||||||
import org.apache.fineract.client.models.PostFinancialActivityAccountsRequest;
|
import org.apache.fineract.client.models.PostFinancialActivityAccountsRequest;
|
||||||
import org.apache.fineract.client.models.PostInitiateTransferRequest;
|
import org.apache.fineract.client.models.PostInitiateTransferRequest;
|
||||||
import org.apache.fineract.client.models.PostInitiateTransferResponse;
|
import org.apache.fineract.client.models.PostInitiateTransferResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
|
import org.apache.fineract.integrationtests.BaseLoanIntegrationTest;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessStepHelper;
|
import org.apache.fineract.integrationtests.common.BusinessStepHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ExternalAssetOwnerHelper;
|
import org.apache.fineract.integrationtests.common.ExternalAssetOwnerHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
@@ -67,17 +69,14 @@ import org.apache.fineract.integrationtests.common.charges.ChargesHelper;
|
|||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
@ExtendWith(LoanTestLifecycleExtension.class)
|
public class ExternalAssetOwnerTransferCancelTest extends BaseLoanIntegrationTest {
|
||||||
public class ExternalAssetOwnerTransferCancelTest {
|
|
||||||
|
|
||||||
public String ownerExternalId;
|
public String ownerExternalId;
|
||||||
private static ResponseSpecification RESPONSE_SPEC;
|
private static ResponseSpecification RESPONSE_SPEC;
|
||||||
@@ -133,8 +132,7 @@ public class ExternalAssetOwnerTransferCancelTest {
|
|||||||
@Test
|
@Test
|
||||||
public void successCancelSale() {
|
public void successCancelSale() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
setInitialBusinessDate("2020-03-02");
|
setInitialBusinessDate("2020-03-02");
|
||||||
Integer clientID = createClient();
|
Integer clientID = createClient();
|
||||||
Integer loanID = createLoanForClient(clientID);
|
Integer loanID = createLoanForClient(clientID);
|
||||||
@@ -176,8 +174,7 @@ public class ExternalAssetOwnerTransferCancelTest {
|
|||||||
@Test
|
@Test
|
||||||
public void saleAndBuybackOnTheSameDay() {
|
public void saleAndBuybackOnTheSameDay() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
setInitialBusinessDate("2020-03-02");
|
setInitialBusinessDate("2020-03-02");
|
||||||
Integer clientID = createClient();
|
Integer clientID = createClient();
|
||||||
Integer loanID = createLoanForClient(clientID);
|
Integer loanID = createLoanForClient(clientID);
|
||||||
@@ -276,9 +273,9 @@ public class ExternalAssetOwnerTransferCancelTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setInitialBusinessDate(String date) {
|
private void setInitialBusinessDate(String date) {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(REQUEST_SPEC, RESPONSE_SPEC, BUSINESS_DATE, LocalDate.parse(date));
|
BusinessDateHelper.updateBusinessDate(REQUEST_SPEC, RESPONSE_SPEC, BUSINESS_DATE, LocalDate.parse(date));
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(REQUEST_SPEC, RESPONSE_SPEC, "10", "0");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cleanUpAndRestoreBusinessDate() {
|
private void cleanUpAndRestoreBusinessDate() {
|
||||||
@@ -287,7 +284,8 @@ public class ExternalAssetOwnerTransferCancelTest {
|
|||||||
REQUEST_SPEC.header("Fineract-Platform-TenantId", "default");
|
REQUEST_SPEC.header("Fineract-Platform-TenantId", "default");
|
||||||
RESPONSE_SPEC = new ResponseSpecBuilder().expectStatusCode(200).build();
|
RESPONSE_SPEC = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
BusinessDateHelper.updateBusinessDate(REQUEST_SPEC, RESPONSE_SPEC, BUSINESS_DATE, TODAYS_DATE);
|
BusinessDateHelper.updateBusinessDate(REQUEST_SPEC, RESPONSE_SPEC, BUSINESS_DATE, TODAYS_DATE);
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
+11
-9
@@ -48,12 +48,14 @@ import org.apache.fineract.client.models.ExternalTransferData;
|
|||||||
import org.apache.fineract.client.models.PageExternalTransferData;
|
import org.apache.fineract.client.models.PageExternalTransferData;
|
||||||
import org.apache.fineract.client.models.PostInitiateTransferRequest;
|
import org.apache.fineract.client.models.PostInitiateTransferRequest;
|
||||||
import org.apache.fineract.client.models.PostInitiateTransferResponse;
|
import org.apache.fineract.client.models.PostInitiateTransferResponse;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
|
import org.apache.fineract.integrationtests.BaseLoanIntegrationTest;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessStepHelper;
|
import org.apache.fineract.integrationtests.common.BusinessStepHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ExternalAssetOwnerHelper;
|
import org.apache.fineract.integrationtests.common.ExternalAssetOwnerHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.accounting.Account;
|
import org.apache.fineract.integrationtests.common.accounting.Account;
|
||||||
@@ -69,7 +71,7 @@ import org.junit.jupiter.api.Assertions;
|
|||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ExternalAssetOwnerTransferTest {
|
public class ExternalAssetOwnerTransferTest extends BaseLoanIntegrationTest {
|
||||||
|
|
||||||
protected static ResponseSpecification RESPONSE_SPEC;
|
protected static ResponseSpecification RESPONSE_SPEC;
|
||||||
protected static RequestSpecification REQUEST_SPEC;
|
protected static RequestSpecification REQUEST_SPEC;
|
||||||
@@ -156,10 +158,10 @@ public class ExternalAssetOwnerTransferTest {
|
|||||||
assertNotNull(penalty1LoanChargeId);
|
assertNotNull(penalty1LoanChargeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setInitialBusinessDate(String date) {
|
protected void setInitialBusinessDate(LocalDate date) {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
BusinessDateHelper.updateBusinessDate(REQUEST_SPEC, RESPONSE_SPEC, BUSINESS_DATE, LocalDate.parse(date));
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(REQUEST_SPEC, RESPONSE_SPEC, "10", "0");
|
BusinessDateHelper.updateBusinessDate(REQUEST_SPEC, RESPONSE_SPEC, BUSINESS_DATE, date);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void cleanUpAndRestoreBusinessDate() {
|
protected void cleanUpAndRestoreBusinessDate() {
|
||||||
@@ -168,9 +170,9 @@ public class ExternalAssetOwnerTransferTest {
|
|||||||
REQUEST_SPEC.header("Fineract-Platform-TenantId", "default");
|
REQUEST_SPEC.header("Fineract-Platform-TenantId", "default");
|
||||||
RESPONSE_SPEC = new ResponseSpecBuilder().expectStatusCode(200).build();
|
RESPONSE_SPEC = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
BusinessDateHelper.updateBusinessDate(REQUEST_SPEC, RESPONSE_SPEC, BUSINESS_DATE, TODAYS_DATE);
|
BusinessDateHelper.updateBusinessDate(REQUEST_SPEC, RESPONSE_SPEC, BUSINESS_DATE, TODAYS_DATE);
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, false);
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
+29
-40
@@ -64,15 +64,16 @@ import org.apache.fineract.client.models.PostFinancialActivityAccountsRequest;
|
|||||||
import org.apache.fineract.client.models.PostInitiateTransferRequest;
|
import org.apache.fineract.client.models.PostInitiateTransferRequest;
|
||||||
import org.apache.fineract.client.models.PostInitiateTransferResponse;
|
import org.apache.fineract.client.models.PostInitiateTransferResponse;
|
||||||
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
import org.apache.fineract.client.models.PostLoansLoanIdTransactionsRequest;
|
||||||
|
import org.apache.fineract.client.models.PutGlobalConfigurationsRequest;
|
||||||
import org.apache.fineract.client.util.CallFailedRuntimeException;
|
import org.apache.fineract.client.util.CallFailedRuntimeException;
|
||||||
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.infrastructure.event.external.service.validation.ExternalEventDTO;
|
import org.apache.fineract.infrastructure.event.external.service.validation.ExternalEventDTO;
|
||||||
import org.apache.fineract.integrationtests.client.IntegrationTest;
|
import org.apache.fineract.integrationtests.BaseLoanIntegrationTest;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
import org.apache.fineract.integrationtests.common.BusinessDateHelper;
|
||||||
import org.apache.fineract.integrationtests.common.BusinessStepHelper;
|
import org.apache.fineract.integrationtests.common.BusinessStepHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ClientHelper;
|
import org.apache.fineract.integrationtests.common.ClientHelper;
|
||||||
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
import org.apache.fineract.integrationtests.common.CollateralManagementHelper;
|
||||||
import org.apache.fineract.integrationtests.common.ExternalAssetOwnerHelper;
|
import org.apache.fineract.integrationtests.common.ExternalAssetOwnerHelper;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
|
||||||
import org.apache.fineract.integrationtests.common.OfficeHelper;
|
import org.apache.fineract.integrationtests.common.OfficeHelper;
|
||||||
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
import org.apache.fineract.integrationtests.common.SchedulerJobHelper;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
@@ -85,8 +86,8 @@ import org.apache.fineract.integrationtests.common.externalevents.ExternalEvents
|
|||||||
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
|
||||||
|
import org.apache.fineract.integrationtests.common.report.ReportHelper;
|
||||||
import org.hamcrest.Matchers;
|
import org.hamcrest.Matchers;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
@@ -95,8 +96,8 @@ import org.junit.jupiter.api.Test;
|
|||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
@ExtendWith({ LoanTestLifecycleExtension.class, ExternalEventsExtension.class })
|
@ExtendWith({ ExternalEventsExtension.class })
|
||||||
public class InitiateExternalAssetOwnerTransferTest extends IntegrationTest {
|
public class InitiateExternalAssetOwnerTransferTest extends BaseLoanIntegrationTest {
|
||||||
|
|
||||||
private static ResponseSpecification RESPONSE_SPEC;
|
private static ResponseSpecification RESPONSE_SPEC;
|
||||||
private static RequestSpecification REQUEST_SPEC;
|
private static RequestSpecification REQUEST_SPEC;
|
||||||
@@ -113,6 +114,7 @@ public class InitiateExternalAssetOwnerTransferTest extends IntegrationTest {
|
|||||||
private static OfficeHelper OFFICE_HELPER;
|
private static OfficeHelper OFFICE_HELPER;
|
||||||
private static LocalDate TODAYS_DATE;
|
private static LocalDate TODAYS_DATE;
|
||||||
public String ownerExternalId;
|
public String ownerExternalId;
|
||||||
|
private static ReportHelper reportHelper;
|
||||||
private final DateTimeFormatter dateFormatter = new DateTimeFormatterBuilder().appendPattern("dd MMMM yyyy").toFormatter();
|
private final DateTimeFormatter dateFormatter = new DateTimeFormatterBuilder().appendPattern("dd MMMM yyyy").toFormatter();
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
@@ -141,6 +143,7 @@ public class InitiateExternalAssetOwnerTransferTest extends IntegrationTest {
|
|||||||
OVERPAYMENT_ACCOUNT = accountHelper.createLiabilityAccount();
|
OVERPAYMENT_ACCOUNT = accountHelper.createLiabilityAccount();
|
||||||
|
|
||||||
setProperFinancialActivity(TRANSFER_ACCOUNT);
|
setProperFinancialActivity(TRANSFER_ACCOUNT);
|
||||||
|
reportHelper = new ReportHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void setProperFinancialActivity(Account transferAccount) {
|
private static void setProperFinancialActivity(Account transferAccount) {
|
||||||
@@ -154,8 +157,7 @@ public class InitiateExternalAssetOwnerTransferTest extends IntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void saleActiveLoanToExternalAssetOwnerWithCancelAndBuybackADayLater() {
|
public void saleActiveLoanToExternalAssetOwnerWithCancelAndBuybackADayLater() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
setInitialBusinessDate("2020-03-02");
|
setInitialBusinessDate("2020-03-02");
|
||||||
|
|
||||||
ExternalEventHelper.deleteAllExternalEvents(REQUEST_SPEC, new ResponseSpecBuilder().expectStatusCode(Matchers.is(204)).build());
|
ExternalEventHelper.deleteAllExternalEvents(REQUEST_SPEC, new ResponseSpecBuilder().expectStatusCode(Matchers.is(204)).build());
|
||||||
@@ -354,8 +356,7 @@ public class InitiateExternalAssetOwnerTransferTest extends IntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void saleActiveLoanToExternalAssetOwnerAndBuybackADayLater() {
|
public void saleActiveLoanToExternalAssetOwnerAndBuybackADayLater() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
setInitialBusinessDate("2020-03-02");
|
setInitialBusinessDate("2020-03-02");
|
||||||
Integer clientID = createClient();
|
Integer clientID = createClient();
|
||||||
Integer loanID = createLoanForClient(clientID);
|
Integer loanID = createLoanForClient(clientID);
|
||||||
@@ -487,8 +488,7 @@ public class InitiateExternalAssetOwnerTransferTest extends IntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void saleOverpaidLoanToExternalAssetOwnerAndBuybackADayLater() {
|
public void saleOverpaidLoanToExternalAssetOwnerAndBuybackADayLater() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
setInitialBusinessDate("2020-03-02");
|
setInitialBusinessDate("2020-03-02");
|
||||||
Integer clientID = createClient();
|
Integer clientID = createClient();
|
||||||
Integer loanID = createLoanForClient(clientID);
|
Integer loanID = createLoanForClient(clientID);
|
||||||
@@ -604,8 +604,7 @@ public class InitiateExternalAssetOwnerTransferTest extends IntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void saleIsNotAllowedWhenTransferIsAlreadyPending() {
|
public void saleIsNotAllowedWhenTransferIsAlreadyPending() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
setInitialBusinessDate("2020-03-02");
|
setInitialBusinessDate("2020-03-02");
|
||||||
Integer clientID = createClient();
|
Integer clientID = createClient();
|
||||||
Integer loanID = createLoanForClient(clientID);
|
Integer loanID = createLoanForClient(clientID);
|
||||||
@@ -623,8 +622,7 @@ public class InitiateExternalAssetOwnerTransferTest extends IntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void saleIsNotAllowedWhenLoanIsNotActive() {
|
public void saleIsNotAllowedWhenLoanIsNotActive() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
setInitialBusinessDate("2020-03-02");
|
setInitialBusinessDate("2020-03-02");
|
||||||
Integer clientID = createClient();
|
Integer clientID = createClient();
|
||||||
Integer loanID = createLoanForClient(clientID);
|
Integer loanID = createLoanForClient(clientID);
|
||||||
@@ -644,8 +642,7 @@ public class InitiateExternalAssetOwnerTransferTest extends IntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void saleIsDeclinedWhenLoanIsCancelled() {
|
public void saleIsDeclinedWhenLoanIsCancelled() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
setInitialBusinessDate("2020-03-02");
|
setInitialBusinessDate("2020-03-02");
|
||||||
Integer clientID = createClient();
|
Integer clientID = createClient();
|
||||||
Integer loanID = createLoanForClient(clientID);
|
Integer loanID = createLoanForClient(clientID);
|
||||||
@@ -668,8 +665,7 @@ public class InitiateExternalAssetOwnerTransferTest extends IntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void buybackIsExecutedWhenLoanIsCancelled() {
|
public void buybackIsExecutedWhenLoanIsCancelled() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
setInitialBusinessDate("2020-03-02");
|
setInitialBusinessDate("2020-03-02");
|
||||||
Integer clientID = createClient();
|
Integer clientID = createClient();
|
||||||
Integer loanID = createLoanForClient(clientID);
|
Integer loanID = createLoanForClient(clientID);
|
||||||
@@ -700,8 +696,7 @@ public class InitiateExternalAssetOwnerTransferTest extends IntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void buybackAndSaleIsCancelledWhenLoanIsCancelled() {
|
public void buybackAndSaleIsCancelledWhenLoanIsCancelled() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
setInitialBusinessDate("2020-03-02");
|
setInitialBusinessDate("2020-03-02");
|
||||||
Integer clientID = createClient();
|
Integer clientID = createClient();
|
||||||
Integer loanID = createLoanForClient(clientID);
|
Integer loanID = createLoanForClient(clientID);
|
||||||
@@ -728,8 +723,7 @@ public class InitiateExternalAssetOwnerTransferTest extends IntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void sameDayBuybackAndSaleIsCancelledWhenLoanIsCancelled() {
|
public void sameDayBuybackAndSaleIsCancelledWhenLoanIsCancelled() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
setInitialBusinessDate("2020-03-02");
|
setInitialBusinessDate("2020-03-02");
|
||||||
Integer clientID = createClient();
|
Integer clientID = createClient();
|
||||||
Integer loanID = createLoanForClient(clientID);
|
Integer loanID = createLoanForClient(clientID);
|
||||||
@@ -756,8 +750,7 @@ public class InitiateExternalAssetOwnerTransferTest extends IntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void saleAndBuybackOnTheSameDay() {
|
public void saleAndBuybackOnTheSameDay() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
setInitialBusinessDate("2020-03-02");
|
setInitialBusinessDate("2020-03-02");
|
||||||
Integer clientID = createClient();
|
Integer clientID = createClient();
|
||||||
Integer loanID = createLoanForClient(clientID);
|
Integer loanID = createLoanForClient(clientID);
|
||||||
@@ -807,8 +800,7 @@ public class InitiateExternalAssetOwnerTransferTest extends IntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void saleAndBuybackMultipleTimes() {
|
public void saleAndBuybackMultipleTimes() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
setInitialBusinessDate("2020-03-02");
|
setInitialBusinessDate("2020-03-02");
|
||||||
Integer clientID = createClient();
|
Integer clientID = createClient();
|
||||||
Integer loanID = createLoanForClient(clientID);
|
Integer loanID = createLoanForClient(clientID);
|
||||||
@@ -842,8 +834,7 @@ public class InitiateExternalAssetOwnerTransferTest extends IntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void buybackExceptionHandling() {
|
public void buybackExceptionHandling() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
setInitialBusinessDate("2020-03-02");
|
setInitialBusinessDate("2020-03-02");
|
||||||
|
|
||||||
CallFailedRuntimeException exception = assertThrows(CallFailedRuntimeException.class, () -> createBuybackTransfer(1, null));
|
CallFailedRuntimeException exception = assertThrows(CallFailedRuntimeException.class, () -> createBuybackTransfer(1, null));
|
||||||
@@ -893,8 +884,7 @@ public class InitiateExternalAssetOwnerTransferTest extends IntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void saleExceptionHandling() {
|
public void saleExceptionHandling() {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
setInitialBusinessDate("2020-03-02");
|
setInitialBusinessDate("2020-03-02");
|
||||||
Integer clientID = createClient();
|
Integer clientID = createClient();
|
||||||
Integer loanID = createLoanForClient(clientID);
|
Integer loanID = createLoanForClient(clientID);
|
||||||
@@ -943,8 +933,7 @@ public class InitiateExternalAssetOwnerTransferTest extends IntegrationTest {
|
|||||||
@Test
|
@Test
|
||||||
public void transactionSummaryReportWithAssetOwner() throws IOException {
|
public void transactionSummaryReportWithAssetOwner() throws IOException {
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
|
||||||
setInitialBusinessDate("2020-03-02");
|
setInitialBusinessDate("2020-03-02");
|
||||||
|
|
||||||
ExternalEventHelper.deleteAllExternalEvents(REQUEST_SPEC, new ResponseSpecBuilder().expectStatusCode(Matchers.is(204)).build());
|
ExternalEventHelper.deleteAllExternalEvents(REQUEST_SPEC, new ResponseSpecBuilder().expectStatusCode(Matchers.is(204)).build());
|
||||||
@@ -1029,8 +1018,8 @@ public class InitiateExternalAssetOwnerTransferTest extends IntegrationTest {
|
|||||||
getAndValidateThereIsNoActiveMapping(saleTransferResponse.getResourceExternalId());
|
getAndValidateThereIsNoActiveMapping(saleTransferResponse.getResourceExternalId());
|
||||||
retrieveResponse = EXTERNAL_ASSET_OWNER_HELPER.retrieveTransfersByLoanId(loanID.longValue());
|
retrieveResponse = EXTERNAL_ASSET_OWNER_HELPER.retrieveTransfersByLoanId(loanID.longValue());
|
||||||
|
|
||||||
final var reportResult = fineract().reportsRun.runReportGetFile("Transaction Summary Report with Asset Owner",
|
final var reportResult = reportHelper.runReport("Transaction Summary Report with Asset Owner",
|
||||||
Map.of("R_endDate", "2020-03-03", "R_officeId", officeId.toString(), "output-type", "CSV"), false).execute();
|
Map.of("R_endDate", "2020-03-03", "R_officeId", officeId.toString(), "output-type", "CSV"));
|
||||||
|
|
||||||
assertNotNull(reportResult.body());
|
assertNotNull(reportResult.body());
|
||||||
final var csvContent = reportResult.body().string();
|
final var csvContent = reportResult.body().string();
|
||||||
@@ -1225,9 +1214,9 @@ public class InitiateExternalAssetOwnerTransferTest extends IntegrationTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setInitialBusinessDate(String date) {
|
private void setInitialBusinessDate(String date) {
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, Boolean.TRUE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
|
new PutGlobalConfigurationsRequest().enabled(true));
|
||||||
BusinessDateHelper.updateBusinessDate(REQUEST_SPEC, RESPONSE_SPEC, BUSINESS_DATE, LocalDate.parse(date));
|
BusinessDateHelper.updateBusinessDate(REQUEST_SPEC, RESPONSE_SPEC, BUSINESS_DATE, LocalDate.parse(date));
|
||||||
GlobalConfigurationHelper.updateValueForGlobalConfiguration(REQUEST_SPEC, RESPONSE_SPEC, "10", "0");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cleanUpAndRestoreBusinessDate() {
|
private void cleanUpAndRestoreBusinessDate() {
|
||||||
@@ -1236,9 +1225,9 @@ public class InitiateExternalAssetOwnerTransferTest extends IntegrationTest {
|
|||||||
REQUEST_SPEC.header("Fineract-Platform-TenantId", "default");
|
REQUEST_SPEC.header("Fineract-Platform-TenantId", "default");
|
||||||
RESPONSE_SPEC = new ResponseSpecBuilder().expectStatusCode(200).build();
|
RESPONSE_SPEC = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||||
BusinessDateHelper.updateBusinessDate(REQUEST_SPEC, RESPONSE_SPEC, BUSINESS_DATE, TODAYS_DATE);
|
BusinessDateHelper.updateBusinessDate(REQUEST_SPEC, RESPONSE_SPEC, BUSINESS_DATE, TODAYS_DATE);
|
||||||
GlobalConfigurationHelper.updateIsBusinessDateEnabled(REQUEST_SPEC, RESPONSE_SPEC, Boolean.FALSE);
|
globalConfigurationHelper.updateGlobalConfiguration(GlobalConfigurationConstants.ENABLE_BUSINESS_DATE,
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
new PutGlobalConfigurationsRequest().enabled(false));
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, false);
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
+3
-4
@@ -31,7 +31,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.fineract.client.models.PageExternalTransferData;
|
import org.apache.fineract.client.models.PageExternalTransferData;
|
||||||
import org.apache.fineract.client.models.PagedRequestExternalAssetOwnerSearchRequest;
|
import org.apache.fineract.client.models.PagedRequestExternalAssetOwnerSearchRequest;
|
||||||
import org.apache.fineract.client.models.PostInitiateTransferResponse;
|
import org.apache.fineract.client.models.PostInitiateTransferResponse;
|
||||||
import org.apache.fineract.integrationtests.common.GlobalConfigurationHelper;
|
import org.apache.fineract.infrastructure.configuration.api.GlobalConfigurationConstants;
|
||||||
import org.apache.fineract.integrationtests.common.Utils;
|
import org.apache.fineract.integrationtests.common.Utils;
|
||||||
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
import org.apache.fineract.integrationtests.common.loans.LoanTestLifecycleExtension;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
@@ -47,9 +47,8 @@ public class SearchExternalAssetOwnerTransferTest extends ExternalAssetOwnerTran
|
|||||||
LocalDate baseLocalDate = Utils.getDateAsLocalDate("29 February 2020");
|
LocalDate baseLocalDate = Utils.getDateAsLocalDate("29 February 2020");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
GlobalConfigurationHelper.manageConfigurations(REQUEST_SPEC, RESPONSE_SPEC,
|
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, true);
|
||||||
GlobalConfigurationHelper.ENABLE_AUTOGENERATED_EXTERNAL_ID, true);
|
setInitialBusinessDate(LocalDate.of(2020, 2, 29));
|
||||||
setInitialBusinessDate("2020-02-29");
|
|
||||||
Integer clientID = createClient();
|
Integer clientID = createClient();
|
||||||
Integer loanID = createLoanForClient(clientID, "29 February 2020");
|
Integer loanID = createLoanForClient(clientID, "29 February 2020");
|
||||||
addPenaltyForLoan(loanID, "10");
|
addPenaltyForLoan(loanID, "10");
|
||||||
|
|||||||
Reference in New Issue
Block a user