FINERACT-1029 Failing lint test for static
This commit is contained in:
committed by
Yemdjih Kaze Nasser
parent
f6f1af9e95
commit
03f38e33b3
@@ -326,7 +326,7 @@ tasks.withType(JavaCompile) {
|
||||
"-Xlint:finally","-Xlint:module","-Xlint:opens","-Xlint:options","-Xlint:overloads",
|
||||
"-Xlint:overrides","-Xlint:path","-Xlint:processing","-Xlint:removal",
|
||||
"-Xlint:requires-automatic","-Xlint:requires-transitive-automatic","-Xlint:try",
|
||||
"-Xlint:varargs","-Xlint:preview","-Werror"]
|
||||
"-Xlint:varargs","-Xlint:preview","-Xlint:static","-Werror"]
|
||||
// TODO FINERACT-959 (gradually) enable -Xlint:all (see "javac -help -X")
|
||||
|
||||
options.deprecation = true
|
||||
|
||||
+49
-53
@@ -66,7 +66,8 @@ import org.junit.jupiter.api.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@SuppressWarnings({ "unused", "rawtypes", "unchecked", "static-access" })
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
|
||||
public class AccountingScenarioIntegrationTest {
|
||||
|
||||
private final static Logger LOG = LoggerFactory.getLogger(AccountingScenarioIntegrationTest.class);
|
||||
@@ -114,15 +115,15 @@ public class AccountingScenarioIntegrationTest {
|
||||
@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();
|
||||
requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
|
||||
this.periodicAccrualAccountingHelper = new PeriodicAccrualAccountingHelper(this.requestSpec, this.responseSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||
this.accountHelper = new AccountHelper(requestSpec, responseSpec);
|
||||
this.journalEntryHelper = new JournalEntryHelper(requestSpec, responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
||||
this.periodicAccrualAccountingHelper = new PeriodicAccrualAccountingHelper(requestSpec, responseSpec);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -135,10 +136,10 @@ public class AccountingScenarioIntegrationTest {
|
||||
final Integer loanProductID = createLoanProductWithUpfrontAccrualAccountingEnabled(assetAccount, incomeAccount, expenseAccount,
|
||||
overpaymentAccount);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer loanID = applyForLoanApplication(clientID, loanProductID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(requestSpec, responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(this.EXPECTED_DISBURSAL_DATE, loanID);
|
||||
@@ -250,7 +251,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
|
||||
@Test
|
||||
public void checkAccountingWithSavingsFlow() {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
|
||||
|
||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
||||
@@ -260,10 +261,10 @@ public class AccountingScenarioIntegrationTest {
|
||||
final Integer savingsProductID = createSavingsProduct(MINIMUM_OPENING_BALANCE, assetAccount, incomeAccount, expenseAccount,
|
||||
liabilityAccount);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer savingsID = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsID);
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(requestSpec, responseSpec, savingsID);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsID);
|
||||
@@ -312,7 +313,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
liabililityAccountSecondTransactionEntry);
|
||||
|
||||
// Third Transaction-Add Charges for Withdrawal Fee
|
||||
final Integer withdrawalChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
final Integer withdrawalChargeId = ChargesHelper.createCharges(requestSpec, responseSpec,
|
||||
ChargesHelper.getSavingsWithdrawalFeeJSON());
|
||||
Assertions.assertNotNull(withdrawalChargeId);
|
||||
|
||||
@@ -345,10 +346,10 @@ public class AccountingScenarioIntegrationTest {
|
||||
|
||||
@Test
|
||||
public void testFixedDepositAccountingFlow() {
|
||||
this.fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.fixedDepositAccountHelper = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.fixedDepositProductHelper = new FixedDepositProductHelper(requestSpec, responseSpec);
|
||||
this.accountHelper = new AccountHelper(requestSpec, responseSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
|
||||
this.fixedDepositAccountHelper = new FixedDepositAccountHelper(requestSpec, responseSpec);
|
||||
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
|
||||
DateFormat currentDateFormat = new SimpleDateFormat("dd");
|
||||
@@ -376,7 +377,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
final Account expenseAccount = this.accountHelper.createExpenseAccount();
|
||||
final Account liabilityAccount = this.accountHelper.createLiabilityAccount();
|
||||
|
||||
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Integer clientId = ClientHelper.createClient(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(clientId);
|
||||
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, assetAccount, incomeAccount, expenseAccount,
|
||||
@@ -387,8 +388,8 @@ public class AccountingScenarioIntegrationTest {
|
||||
VALID_TO, SUBMITTED_ON_DATE, FixedDepositTest.WHOLE_TERM);
|
||||
Assertions.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
|
||||
this.responseSpec, fixedDepositAccountId.toString());
|
||||
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(requestSpec,
|
||||
responseSpec, fixedDepositAccountId.toString());
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsPending(fixedDepositAccountStatusHashMap);
|
||||
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
|
||||
@@ -423,9 +424,9 @@ public class AccountingScenarioIntegrationTest {
|
||||
|
||||
@Test
|
||||
public void testRecurringDepositAccountingFlow() {
|
||||
this.recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.recurringDepositAccountHelper = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.recurringDepositProductHelper = new RecurringDepositProductHelper(requestSpec, responseSpec);
|
||||
this.accountHelper = new AccountHelper(requestSpec, responseSpec);
|
||||
this.recurringDepositAccountHelper = new RecurringDepositAccountHelper(requestSpec, responseSpec);
|
||||
|
||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
||||
@@ -454,7 +455,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
todaysDate.add(Calendar.DATE, numberOfDaysLeft);
|
||||
final String INTEREST_POSTED_DATE = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Integer clientId = ClientHelper.createClient(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(clientId);
|
||||
|
||||
Integer recurringDepositProductId = createRecurringDepositProduct(VALID_FROM, VALID_TO, assetAccount, liabilityAccount,
|
||||
@@ -465,8 +466,8 @@ public class AccountingScenarioIntegrationTest {
|
||||
VALID_FROM, VALID_TO, SUBMITTED_ON_DATE, RecurringDepositTest.WHOLE_TERM, EXPECTED_FIRST_DEPOSIT_ON_DATE);
|
||||
Assertions.assertNotNull(recurringDepositAccountId);
|
||||
|
||||
HashMap recurringDepositAccountStatusHashMap = RecurringDepositAccountStatusChecker
|
||||
.getStatusOfRecurringDepositAccount(this.requestSpec, this.responseSpec, recurringDepositAccountId.toString());
|
||||
HashMap recurringDepositAccountStatusHashMap = RecurringDepositAccountStatusChecker.getStatusOfRecurringDepositAccount(requestSpec,
|
||||
responseSpec, recurringDepositAccountId.toString());
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsPending(recurringDepositAccountStatusHashMap);
|
||||
|
||||
recurringDepositAccountStatusHashMap = this.recurringDepositAccountHelper.approveRecurringDeposit(recurringDepositAccountId,
|
||||
@@ -477,8 +478,8 @@ public class AccountingScenarioIntegrationTest {
|
||||
ACTIVATION_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsActive(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(requestSpec, responseSpec,
|
||||
recurringDepositAccountId);
|
||||
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
|
||||
|
||||
Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId,
|
||||
@@ -518,7 +519,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
|
||||
private Integer createFixedDepositProduct(final String validFrom, final String validTo, Account... accounts) {
|
||||
LOG.info("------------------------------CREATING NEW FIXED DEPOSIT PRODUCT ---------------------------------------");
|
||||
FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(requestSpec, responseSpec);
|
||||
final String fixedDepositProductJSON = fixedDepositProductHelper //
|
||||
.withPeriodRangeChart()//
|
||||
.withAccountingRuleAsCashBased(accounts).build(validFrom, validTo);
|
||||
@@ -528,16 +529,14 @@ public class AccountingScenarioIntegrationTest {
|
||||
private Integer applyForFixedDepositApplication(final String clientID, final String productID, final String validFrom,
|
||||
final String validTo, final String submittedOnDate, final String penalInterestType) {
|
||||
LOG.info("--------------------------------APPLYING FOR FIXED DEPOSIT ACCOUNT --------------------------------");
|
||||
final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec) //
|
||||
final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(requestSpec, responseSpec) //
|
||||
.withSubmittedOnDate(submittedOnDate).build(clientID, productID, penalInterestType);
|
||||
return this.fixedDepositAccountHelper.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec,
|
||||
this.responseSpec);
|
||||
return FixedDepositAccountHelper.applyFixedDepositApplication(fixedDepositApplicationJSON, requestSpec, responseSpec);
|
||||
}
|
||||
|
||||
private Integer createRecurringDepositProduct(final String validFrom, final String validTo, Account... accounts) {
|
||||
LOG.info("------------------------------CREATING NEW RECURRING DEPOSIT PRODUCT ---------------------------------------");
|
||||
RecurringDepositProductHelper recurringDepositProductHelper = new RecurringDepositProductHelper(this.requestSpec,
|
||||
this.responseSpec);
|
||||
RecurringDepositProductHelper recurringDepositProductHelper = new RecurringDepositProductHelper(requestSpec, responseSpec);
|
||||
final String recurringDepositProductJSON = recurringDepositProductHelper //
|
||||
.withPeriodRangeChart()//
|
||||
.withAccountingRuleAsCashBased(accounts).build(validFrom, validTo);
|
||||
@@ -547,12 +546,11 @@ public class AccountingScenarioIntegrationTest {
|
||||
private Integer applyForRecurringDepositApplication(final String clientID, final String productID, final String validFrom,
|
||||
final String validTo, final String submittedOnDate, final String penalInterestType, final String expectedFirstDepositOnDate) {
|
||||
LOG.info("--------------------------------APPLYING FOR RECURRING DEPOSIT ACCOUNT --------------------------------");
|
||||
final String recurringDepositApplicationJSON = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec)
|
||||
final String recurringDepositApplicationJSON = new RecurringDepositAccountHelper(requestSpec, responseSpec)
|
||||
//
|
||||
.withSubmittedOnDate(submittedOnDate).withExpectedFirstDepositOnDate(expectedFirstDepositOnDate)
|
||||
.build(clientID, productID, penalInterestType);
|
||||
return this.recurringDepositAccountHelper.applyRecurringDepositApplication(recurringDepositApplicationJSON, this.requestSpec,
|
||||
this.responseSpec);
|
||||
return RecurringDepositAccountHelper.applyRecurringDepositApplication(recurringDepositApplicationJSON, requestSpec, responseSpec);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -565,10 +563,10 @@ public class AccountingScenarioIntegrationTest {
|
||||
final Integer loanProductID = createLoanProductWithPeriodicAccrualAccountingEnabled(assetAccount, incomeAccount, expenseAccount,
|
||||
overpaymentAccount);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer loanID = applyForLoanApplication(clientID, loanProductID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(requestSpec, responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(this.EXPECTED_DISBURSAL_DATE, loanID);
|
||||
@@ -678,10 +676,10 @@ public class AccountingScenarioIntegrationTest {
|
||||
final Integer loanProductID = createLoanProductWithPeriodicAccrualAccountingEnabled(assetAccount, incomeAccount, expenseAccount,
|
||||
overpaymentAccount);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer loanID = applyForLoanApplication(clientID, loanProductID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(requestSpec, responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(this.EXPECTED_DISBURSAL_DATE, loanID);
|
||||
@@ -733,7 +731,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
final Integer loanProductID = createLoanProductWithPeriodicAccrualAccountingEnabled(assetAccount, incomeAccount, expenseAccount,
|
||||
overpaymentAccount);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer loanID = applyForLoanApplication(clientID, loanProductID);
|
||||
|
||||
final float FEE_PORTION = 50.0f;
|
||||
@@ -743,7 +741,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
Integer flatSpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
|
||||
.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, String.valueOf(PENALTY_PORTION), true));
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(requestSpec, responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(this.EXPECTED_DISBURSAL_DATE, loanID);
|
||||
@@ -786,8 +784,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
|
||||
this.schedulerJobHelper.executeAndAwaitJob(jobName);
|
||||
|
||||
final ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec,
|
||||
loanID);
|
||||
final ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec, responseSpec, loanID);
|
||||
// MAKE 1
|
||||
List fromDateList = (List) loanSchedule.get(1).get("fromDate");
|
||||
LocalDate fromDateLocal = LocalDate.now();
|
||||
@@ -823,7 +820,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
final Integer loanProductID = createLoanProductWithPeriodicAccrualAccountingEnabled(assetAccount, incomeAccount, expenseAccount,
|
||||
overpaymentAccount);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer loanID = applyForLoanApplication(clientID, loanProductID);
|
||||
|
||||
final float FEE_PORTION = 50.0f;
|
||||
@@ -841,7 +838,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
Integer flatSpecifiedDueDateNext = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper
|
||||
.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, String.valueOf(NEXT_PENALTY_PORTION), true));
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(requestSpec, responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(this.EXPECTED_DISBURSAL_DATE, loanID);
|
||||
@@ -891,8 +888,7 @@ public class AccountingScenarioIntegrationTest {
|
||||
|
||||
this.periodicAccrualAccountingHelper.runPeriodicAccrualAccounting(runOndate);
|
||||
|
||||
final ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec,
|
||||
loanID);
|
||||
final ArrayList<HashMap> loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec, responseSpec, loanID);
|
||||
// MAKE 1
|
||||
List fromDateList = (List) loanSchedule.get(1).get("fromDate");
|
||||
LocalDate fromDateLocal = LocalDate.now();
|
||||
@@ -945,10 +941,10 @@ public class AccountingScenarioIntegrationTest {
|
||||
final Integer loanProductID = createLoanProductWithCashBasedAccountingEnabled(assetAccount, incomeAccount, expenseAccount,
|
||||
overpaymentAccount);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer loanID = applyForLoanApplication(clientID, loanProductID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(requestSpec, responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(this.EXPECTED_DISBURSAL_DATE, loanID);
|
||||
|
||||
+2
-2
@@ -131,7 +131,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
|
||||
assertEquals("error.msg.client.undorejection.on.nonrejected.account",
|
||||
clientErrorData.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
status = this.clientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
|
||||
status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
|
||||
}
|
||||
@@ -240,7 +240,7 @@ public class ClientUndoRejectAndWithdrawalIntegrationTest {
|
||||
assertEquals("error.msg.client.undoWithdrawal.on.nonwithdrawal.account",
|
||||
clientErrorData.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));
|
||||
|
||||
status = this.clientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
|
||||
status = ClientHelper.getClientStatus(requestSpec, responseSpec, String.valueOf(clientId));
|
||||
ClientStatusChecker.verifyClientPending(status);
|
||||
|
||||
}
|
||||
|
||||
+7
-7
@@ -33,7 +33,6 @@ import org.junit.jupiter.api.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked", "static-access" })
|
||||
public class ExternalServicesConfigurationTest {
|
||||
|
||||
private final static Logger LOG = LoggerFactory.getLogger(ExternalServicesConfigurationTest.class);
|
||||
@@ -58,7 +57,7 @@ public class ExternalServicesConfigurationTest {
|
||||
|
||||
// Checking for S3
|
||||
String configName = "s3_access_key";
|
||||
ArrayList<HashMap> externalServicesConfig = this.externalServicesConfigurationHelper
|
||||
ArrayList<HashMap> externalServicesConfig = ExternalServicesConfigurationHelper
|
||||
.getExternalServicesConfigurationByServiceName(requestSpec, responseSpec, "S3");
|
||||
Assertions.assertNotNull(externalServicesConfig);
|
||||
for (Integer configIndex = 0; configIndex < externalServicesConfig.size(); configIndex++) {
|
||||
@@ -71,11 +70,11 @@ public class ExternalServicesConfigurationTest {
|
||||
}
|
||||
String newValue = "test";
|
||||
LOG.info("{} : {}", name, value);
|
||||
HashMap arrayListValue = this.externalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec,
|
||||
HashMap arrayListValue = ExternalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec,
|
||||
responseSpec, "S3", name, newValue);
|
||||
Assertions.assertNotNull(arrayListValue.get("value"));
|
||||
Assertions.assertEquals(arrayListValue.get("value"), newValue);
|
||||
HashMap arrayListValue1 = this.externalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec,
|
||||
HashMap arrayListValue1 = ExternalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec,
|
||||
responseSpec, "S3", name, value);
|
||||
Assertions.assertNotNull(arrayListValue1.get("value"));
|
||||
Assertions.assertEquals(arrayListValue1.get("value"), value);
|
||||
@@ -86,9 +85,10 @@ public class ExternalServicesConfigurationTest {
|
||||
// Checking for SMTP:
|
||||
|
||||
configName = "username";
|
||||
externalServicesConfig = this.externalServicesConfigurationHelper.getExternalServicesConfigurationByServiceName(requestSpec,
|
||||
externalServicesConfig = ExternalServicesConfigurationHelper.getExternalServicesConfigurationByServiceName(requestSpec,
|
||||
responseSpec, "SMTP");
|
||||
Assertions.assertNotNull(externalServicesConfig);
|
||||
|
||||
for (Integer configIndex = 0; configIndex < externalServicesConfig.size(); configIndex++) {
|
||||
String name = (String) externalServicesConfig.get(configIndex).get("name");
|
||||
String value = null;
|
||||
@@ -99,11 +99,11 @@ public class ExternalServicesConfigurationTest {
|
||||
}
|
||||
String newValue = "test";
|
||||
LOG.info("{} : {}", name, value);
|
||||
HashMap arrayListValue = this.externalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec,
|
||||
HashMap arrayListValue = ExternalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec,
|
||||
responseSpec, "SMTP", name, newValue);
|
||||
Assertions.assertNotNull(arrayListValue.get("value"));
|
||||
Assertions.assertEquals(arrayListValue.get("value"), newValue);
|
||||
HashMap arrayListValue1 = this.externalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec,
|
||||
HashMap arrayListValue1 = ExternalServicesConfigurationHelper.updateValueForExternaServicesConfiguration(requestSpec,
|
||||
responseSpec, "SMTP", name, value);
|
||||
Assertions.assertNotNull(arrayListValue1.get("value"));
|
||||
Assertions.assertEquals(arrayListValue1.get("value"), value);
|
||||
|
||||
+81
-85
@@ -246,7 +246,7 @@ public class FixedDepositTest {
|
||||
/***
|
||||
* Verify journal entry transactions for preclosure transaction
|
||||
*/
|
||||
HashMap accountDetails = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
HashMap accountDetails = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
Float maturityAmount = Float.valueOf(accountDetails.get("maturityAmount").toString());
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, CLOSED_ON_DATE,
|
||||
@@ -381,7 +381,7 @@ public class FixedDepositTest {
|
||||
/***
|
||||
* Verify journal entry transactions for preclosure transaction
|
||||
*/
|
||||
HashMap accountDetails = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
HashMap accountDetails = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
Float maturityAmount = Float.valueOf(accountDetails.get("maturityAmount").toString());
|
||||
|
||||
@@ -511,7 +511,7 @@ public class FixedDepositTest {
|
||||
String JobName = "Update Deposit Accounts Maturity details";
|
||||
schedulerJobHelper.executeAndAwaitJob(JobName);
|
||||
|
||||
HashMap accountDetails = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
HashMap accountDetails = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
|
||||
HashMap summary = (HashMap) accountDetails.get("summary");
|
||||
@@ -829,7 +829,7 @@ public class FixedDepositTest {
|
||||
this.responseSpec, fixedDepositAccountId.toString());
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositAccountIsPrematureClosed(fixedDepositAccountStatusHashMap);
|
||||
|
||||
HashMap fixedDepositData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
HashMap fixedDepositData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
Float prematurityAmount = (Float) fixedDepositData.get("maturityAmount");
|
||||
|
||||
@@ -991,9 +991,8 @@ public class FixedDepositTest {
|
||||
Integer fixedDepositProductId = createFixedDepositProduct(VALID_FROM, VALID_TO, accountingRule);
|
||||
Assertions.assertNotNull(fixedDepositProductId);
|
||||
|
||||
this.fixedDepositProductHelper.retrieveAllFixedDepositProducts(this.requestSpec, this.responseSpec);
|
||||
this.fixedDepositProductHelper.retrieveFixedDepositProductById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositProductId.toString());
|
||||
FixedDepositProductHelper.retrieveAllFixedDepositProducts(this.requestSpec, this.responseSpec);
|
||||
FixedDepositProductHelper.retrieveFixedDepositProductById(this.requestSpec, this.responseSpec, fixedDepositProductId.toString());
|
||||
|
||||
Integer fixedDepositAccountId = applyForFixedDepositApplication(clientId.toString(), fixedDepositProductId.toString(),
|
||||
SUBMITTED_ON_DATE, WHOLE_TERM);
|
||||
@@ -1211,16 +1210,16 @@ public class FixedDepositTest {
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(fixedDepositAccountStatusHashMap);
|
||||
|
||||
HashMap fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
HashMap fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
Float principal = (Float) fixedDepositAccountData.get("depositAmount");
|
||||
Float maturityAmount = (Float) fixedDepositAccountData.get("maturityAmount");
|
||||
Integer depositPeriod = (Integer) fixedDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) fixedDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = FixedDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, fixedDepositProductId);
|
||||
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = FixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {}", perDay);
|
||||
@@ -1228,8 +1227,8 @@ public class FixedDepositTest {
|
||||
|
||||
todaysDate.getActualMaximum(Calendar.DATE);
|
||||
|
||||
principal = this.fixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod,
|
||||
interestPerDay, MONTHLY_INTERVAL, MONTHLY_INTERVAL);
|
||||
principal = FixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod, interestPerDay,
|
||||
MONTHLY_INTERVAL, MONTHLY_INTERVAL);
|
||||
|
||||
principal = (float) Math.floor(principal);
|
||||
maturityAmount = (float) Math.floor(maturityAmount);
|
||||
@@ -1283,16 +1282,16 @@ public class FixedDepositTest {
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(fixedDepositAccountStatusHashMap);
|
||||
|
||||
HashMap fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
HashMap fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
Float principal = (Float) fixedDepositAccountData.get("depositAmount");
|
||||
Float maturityAmount = (Float) fixedDepositAccountData.get("maturityAmount");
|
||||
Integer depositPeriod = (Integer) fixedDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) fixedDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = FixedDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, fixedDepositProductId);
|
||||
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = FixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {}", perDay);
|
||||
@@ -1300,8 +1299,8 @@ public class FixedDepositTest {
|
||||
|
||||
todaysDate.getActualMaximum(Calendar.DATE);
|
||||
|
||||
principal = this.fixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod,
|
||||
interestPerDay, MONTHLY_INTERVAL, MONTHLY_INTERVAL);
|
||||
principal = FixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod, interestPerDay,
|
||||
MONTHLY_INTERVAL, MONTHLY_INTERVAL);
|
||||
|
||||
principal = (float) Math.floor(principal);
|
||||
maturityAmount = (float) Math.floor(maturityAmount);
|
||||
@@ -1358,17 +1357,17 @@ public class FixedDepositTest {
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
|
||||
|
||||
HashMap fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
HashMap fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
Float principal = (Float) fixedDepositAccountData.get("depositAmount");
|
||||
Integer depositPeriod = (Integer) fixedDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) fixedDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Float preClosurePenalInterestRate = (Float) fixedDepositAccountData.get("preClosurePenalInterest");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = FixedDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, fixedDepositProductId);
|
||||
|
||||
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = FixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
interestRate -= preClosurePenalInterestRate;
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
@@ -1400,7 +1399,7 @@ public class FixedDepositTest {
|
||||
this.responseSpec, fixedDepositAccountId.toString());
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositAccountIsPrematureClosed(fixedDepositAccountStatusHashMap);
|
||||
|
||||
fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
|
||||
principal = (float) Math.floor(principal);
|
||||
@@ -1463,17 +1462,17 @@ public class FixedDepositTest {
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
|
||||
|
||||
HashMap fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
HashMap fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
Float principal = (Float) fixedDepositAccountData.get("depositAmount");
|
||||
Integer depositPeriod = (Integer) fixedDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) fixedDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Float preClosurePenalInterestRate = (Float) fixedDepositAccountData.get("preClosurePenalInterest");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = FixedDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, fixedDepositProductId);
|
||||
|
||||
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = FixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
interestRate -= preClosurePenalInterestRate;
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
@@ -1505,7 +1504,7 @@ public class FixedDepositTest {
|
||||
this.responseSpec, fixedDepositAccountId.toString());
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositAccountIsPrematureClosed(fixedDepositAccountStatusHashMap);
|
||||
|
||||
fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
|
||||
principal = (float) Math.floor(principal);
|
||||
@@ -1564,13 +1563,13 @@ public class FixedDepositTest {
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
|
||||
|
||||
HashMap fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
HashMap fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
Float principal = (Float) fixedDepositAccountData.get("depositAmount");
|
||||
HashMap daysInYearMap = (HashMap) fixedDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Float preClosurePenalInterestRate = (Float) fixedDepositAccountData.get("preClosurePenalInterest");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = FixedDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, fixedDepositProductId);
|
||||
|
||||
Calendar activationDate = Calendar.getInstance();
|
||||
@@ -1583,7 +1582,7 @@ public class FixedDepositTest {
|
||||
|
||||
Integer depositedPeriod = Months.monthsBetween(startDate, endDate).getMonths();
|
||||
|
||||
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositedPeriod);
|
||||
Float interestRate = FixedDepositAccountHelper.getInterestRate(interestRateChartData, depositedPeriod);
|
||||
interestRate -= preClosurePenalInterestRate;
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
@@ -1615,7 +1614,7 @@ public class FixedDepositTest {
|
||||
this.responseSpec, fixedDepositAccountId.toString());
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositAccountIsPrematureClosed(fixedDepositAccountStatusHashMap);
|
||||
|
||||
fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
|
||||
Double expectedPrematureAmount = Math.floor(principal);
|
||||
@@ -1678,13 +1677,13 @@ public class FixedDepositTest {
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
|
||||
|
||||
HashMap fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
HashMap fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
Float principal = (Float) fixedDepositAccountData.get("depositAmount");
|
||||
HashMap daysInYearMap = (HashMap) fixedDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Float preClosurePenalInterestRate = (Float) fixedDepositAccountData.get("preClosurePenalInterest");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = FixedDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, fixedDepositProductId);
|
||||
|
||||
Calendar activationDate = Calendar.getInstance();
|
||||
@@ -1697,7 +1696,7 @@ public class FixedDepositTest {
|
||||
|
||||
Integer depositedPeriod = Months.monthsBetween(startDate, endDate).getMonths();
|
||||
|
||||
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositedPeriod);
|
||||
Float interestRate = FixedDepositAccountHelper.getInterestRate(interestRateChartData, depositedPeriod);
|
||||
interestRate -= preClosurePenalInterestRate;
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
@@ -1729,7 +1728,7 @@ public class FixedDepositTest {
|
||||
this.responseSpec, fixedDepositAccountId.toString());
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositAccountIsPrematureClosed(fixedDepositAccountStatusHashMap);
|
||||
|
||||
fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
|
||||
Float expectedPrematureAmount = (float) Math.floor(principal);
|
||||
@@ -1785,17 +1784,17 @@ public class FixedDepositTest {
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(fixedDepositAccountStatusHashMap);
|
||||
|
||||
HashMap fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
HashMap fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
Float principal = (Float) fixedDepositAccountData.get("depositAmount");
|
||||
Float maturityAmount = (Float) fixedDepositAccountData.get("maturityAmount");
|
||||
Integer depositPeriod = (Integer) fixedDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) fixedDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = FixedDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, fixedDepositProductId);
|
||||
|
||||
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = FixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {}", perDay);
|
||||
@@ -1803,8 +1802,8 @@ public class FixedDepositTest {
|
||||
|
||||
todaysDate.getActualMaximum(Calendar.DATE);
|
||||
|
||||
principal = this.fixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod,
|
||||
interestPerDay, DAILY_COMPOUNDING_INTERVAL, MONTHLY_INTERVAL);
|
||||
principal = FixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod, interestPerDay,
|
||||
DAILY_COMPOUNDING_INTERVAL, MONTHLY_INTERVAL);
|
||||
|
||||
principal = (float) Math.floor(principal);
|
||||
maturityAmount = (float) Math.floor(maturityAmount);
|
||||
@@ -1860,17 +1859,17 @@ public class FixedDepositTest {
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(fixedDepositAccountStatusHashMap);
|
||||
|
||||
HashMap fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
HashMap fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
Float principal = (Float) fixedDepositAccountData.get("depositAmount");
|
||||
Float maturityAmount = (Float) fixedDepositAccountData.get("maturityAmount");
|
||||
Integer depositPeriod = (Integer) fixedDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) fixedDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = FixedDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, fixedDepositProductId);
|
||||
|
||||
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = FixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {}", perDay);
|
||||
@@ -1878,8 +1877,8 @@ public class FixedDepositTest {
|
||||
|
||||
todaysDate.getActualMaximum(Calendar.DATE);
|
||||
|
||||
principal = this.fixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod,
|
||||
interestPerDay, DAILY_COMPOUNDING_INTERVAL, MONTHLY_INTERVAL);
|
||||
principal = FixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod, interestPerDay,
|
||||
DAILY_COMPOUNDING_INTERVAL, MONTHLY_INTERVAL);
|
||||
|
||||
principal = new BigDecimal(principal).setScale(0, RoundingMode.FLOOR).floatValue();
|
||||
maturityAmount = new BigDecimal(maturityAmount).setScale(0, RoundingMode.FLOOR).floatValue();
|
||||
@@ -1943,25 +1942,25 @@ public class FixedDepositTest {
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
|
||||
|
||||
HashMap fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
HashMap fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
Float principal = (Float) fixedDepositAccountData.get("depositAmount");
|
||||
Integer depositPeriod = (Integer) fixedDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) fixedDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = FixedDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, fixedDepositProductId);
|
||||
|
||||
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = FixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {}", perDay);
|
||||
double interestPerDay = interestRateInFraction * perDay;
|
||||
|
||||
principal = this.fixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod,
|
||||
interestPerDay, DAILY_COMPOUNDING_INTERVAL, ANNUL_INTERVAL);
|
||||
principal = FixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod, interestPerDay,
|
||||
DAILY_COMPOUNDING_INTERVAL, ANNUL_INTERVAL);
|
||||
|
||||
fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
|
||||
Double expectedPrematureAmount = Math.floor(principal);
|
||||
@@ -2026,25 +2025,25 @@ public class FixedDepositTest {
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
|
||||
|
||||
HashMap fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
HashMap fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
Float principal = (Float) fixedDepositAccountData.get("depositAmount");
|
||||
Integer depositPeriod = (Integer) fixedDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) fixedDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = FixedDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, fixedDepositProductId);
|
||||
|
||||
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = FixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {}", perDay);
|
||||
double interestPerDay = interestRateInFraction * perDay;
|
||||
|
||||
principal = this.fixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod,
|
||||
interestPerDay, DAILY_COMPOUNDING_INTERVAL, ANNUL_INTERVAL);
|
||||
principal = FixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod, interestPerDay,
|
||||
DAILY_COMPOUNDING_INTERVAL, ANNUL_INTERVAL);
|
||||
|
||||
fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
|
||||
Double expectedPrematureAmount = Math.floor(principal);
|
||||
@@ -2107,25 +2106,25 @@ public class FixedDepositTest {
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(fixedDepositAccountStatusHashMap);
|
||||
|
||||
HashMap fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
HashMap fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
Float principal = (Float) fixedDepositAccountData.get("depositAmount");
|
||||
Integer depositPeriod = (Integer) fixedDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) fixedDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = FixedDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, fixedDepositProductId);
|
||||
|
||||
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = FixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {}", perDay);
|
||||
double interestPerDay = interestRateInFraction * perDay;
|
||||
|
||||
principal = this.fixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod,
|
||||
interestPerDay, BIANNULLY_INTERVAL, BIANNULLY_INTERVAL);
|
||||
principal = FixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod, interestPerDay,
|
||||
BIANNULLY_INTERVAL, BIANNULLY_INTERVAL);
|
||||
|
||||
fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
|
||||
Double expectedPrematureAmount = Math.floor(principal);
|
||||
@@ -2188,25 +2187,25 @@ public class FixedDepositTest {
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(fixedDepositAccountStatusHashMap);
|
||||
|
||||
HashMap fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
HashMap fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
Float principal = (Float) fixedDepositAccountData.get("depositAmount");
|
||||
Integer depositPeriod = (Integer) fixedDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) fixedDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = FixedDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, fixedDepositProductId);
|
||||
|
||||
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = FixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {}", perDay);
|
||||
double interestPerDay = interestRateInFraction * perDay;
|
||||
|
||||
principal = this.fixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod,
|
||||
interestPerDay, BIANNULLY_INTERVAL, BIANNULLY_INTERVAL);
|
||||
principal = FixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod, interestPerDay,
|
||||
BIANNULLY_INTERVAL, BIANNULLY_INTERVAL);
|
||||
|
||||
fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
|
||||
Double expectedPrematureAmount = Math.floor(principal);
|
||||
@@ -2269,25 +2268,25 @@ public class FixedDepositTest {
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(fixedDepositAccountStatusHashMap);
|
||||
|
||||
HashMap fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
HashMap fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
Float principal = (Float) fixedDepositAccountData.get("depositAmount");
|
||||
Integer depositPeriod = (Integer) fixedDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) fixedDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = FixedDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, fixedDepositProductId);
|
||||
|
||||
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = FixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {}", perDay);
|
||||
double interestPerDay = interestRateInFraction * perDay;
|
||||
|
||||
principal = this.fixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod,
|
||||
interestPerDay, QUARTERLY_INTERVAL, QUARTERLY_INTERVAL);
|
||||
principal = FixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod, interestPerDay,
|
||||
QUARTERLY_INTERVAL, QUARTERLY_INTERVAL);
|
||||
|
||||
fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
|
||||
Double expectedPrematureAmount = Math.floor(principal);
|
||||
@@ -2349,25 +2348,25 @@ public class FixedDepositTest {
|
||||
fixedDepositAccountStatusHashMap = this.fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(fixedDepositAccountStatusHashMap);
|
||||
|
||||
HashMap fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
HashMap fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
Float principal = (Float) fixedDepositAccountData.get("depositAmount");
|
||||
Integer depositPeriod = (Integer) fixedDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) fixedDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.fixedDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = FixedDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, fixedDepositProductId);
|
||||
|
||||
Float interestRate = this.fixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = FixedDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {}", perDay);
|
||||
double interestPerDay = interestRateInFraction * perDay;
|
||||
|
||||
principal = this.fixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod,
|
||||
interestPerDay, QUARTERLY_INTERVAL, QUARTERLY_INTERVAL);
|
||||
principal = FixedDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositPeriod, interestPerDay,
|
||||
QUARTERLY_INTERVAL, QUARTERLY_INTERVAL);
|
||||
|
||||
fixedDepositAccountData = this.fixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountData = FixedDepositAccountHelper.getFixedDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
fixedDepositAccountId);
|
||||
|
||||
Double expectedPrematureAmount = Math.floor(principal);
|
||||
@@ -2603,8 +2602,7 @@ public class FixedDepositTest {
|
||||
LOG.info("--------------------------------APPLYING FOR FIXED DEPOSIT ACCOUNT --------------------------------");
|
||||
final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec) //
|
||||
.withSubmittedOnDate(submittedOnDate).build(clientID, productID, penalInterestType);
|
||||
return this.fixedDepositAccountHelper.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec,
|
||||
this.responseSpec);
|
||||
return FixedDepositAccountHelper.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec, this.responseSpec);
|
||||
}
|
||||
|
||||
private Integer applyForFixedDepositApplication(final String clientID, final String productID, final String submittedOnDate,
|
||||
@@ -2613,8 +2611,7 @@ public class FixedDepositTest {
|
||||
final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec) //
|
||||
.withSubmittedOnDate(submittedOnDate).withMaturityInstructionId(maturityInstructionId)
|
||||
.build(clientID, productID, penalInterestType);
|
||||
return this.fixedDepositAccountHelper.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec,
|
||||
this.responseSpec);
|
||||
return FixedDepositAccountHelper.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec, this.responseSpec);
|
||||
}
|
||||
|
||||
private Integer applyForFixedDepositApplication(final String clientID, final String productID, final String submittedOnDate,
|
||||
@@ -2624,8 +2621,7 @@ public class FixedDepositTest {
|
||||
//
|
||||
.withSubmittedOnDate(submittedOnDate).withDepositPeriod(depositPeriod).withDepositAmount(depositAmount)
|
||||
.build(clientID, productID, penalInterestType);
|
||||
return this.fixedDepositAccountHelper.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec,
|
||||
this.responseSpec);
|
||||
return FixedDepositAccountHelper.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec, this.responseSpec);
|
||||
}
|
||||
|
||||
private Integer createSavingsProduct(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||
|
||||
+2
-3
@@ -58,8 +58,7 @@ public class GlobalConfigInterestChargedFromDateSameAsDisbursalDateTest {
|
||||
this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
// Retrieving All Global Configuration details
|
||||
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec,
|
||||
this.responseSpec);
|
||||
final ArrayList<HashMap> globalConfig = GlobalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
|
||||
Assertions.assertNotNull(globalConfig);
|
||||
|
||||
String configName = "interest-charged-from-date-same-as-disbursal-date";
|
||||
@@ -68,7 +67,7 @@ public class GlobalConfigInterestChargedFromDateSameAsDisbursalDateTest {
|
||||
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 = this.globalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec,
|
||||
Integer updateConfigId = GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec,
|
||||
this.responseSpec, configId.toString(), newBooleanValue);
|
||||
Assertions.assertNotNull(updateConfigId);
|
||||
break;
|
||||
|
||||
+19
-20
@@ -33,7 +33,8 @@ import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked", "static-access" })
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
|
||||
public class GlobalConfigurationTest {
|
||||
|
||||
private ResponseSpecification responseSpec;
|
||||
@@ -61,8 +62,7 @@ public class GlobalConfigurationTest {
|
||||
this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
// Retrieving All Global Configuration details
|
||||
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec,
|
||||
this.responseSpec);
|
||||
final ArrayList<HashMap> globalConfig = GlobalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
|
||||
Assertions.assertNotNull(globalConfig);
|
||||
|
||||
String configName = "penalty-wait-period";
|
||||
@@ -71,18 +71,18 @@ public class GlobalConfigurationTest {
|
||||
Integer configId = (Integer) globalConfig.get(configIndex).get("id");
|
||||
Assertions.assertNotNull(configId);
|
||||
|
||||
HashMap configDataBefore = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
|
||||
HashMap configDataBefore = GlobalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
|
||||
configId.toString());
|
||||
Assertions.assertNotNull(configDataBefore);
|
||||
|
||||
Integer value = (Integer) configDataBefore.get("value") + 1;
|
||||
|
||||
// Updating Value for penalty-wait-period Global Configuration
|
||||
configId = this.globalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec,
|
||||
configId = GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec,
|
||||
configId.toString(), value.toString());
|
||||
Assertions.assertNotNull(configId);
|
||||
|
||||
HashMap configDataAfter = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
|
||||
HashMap configDataAfter = GlobalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
|
||||
configId.toString());
|
||||
|
||||
// Verifying Value for penalty-wait-period after Updation
|
||||
@@ -98,10 +98,10 @@ public class GlobalConfigurationTest {
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
configId = this.globalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec,
|
||||
configId = GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec,
|
||||
configId.toString(), enabled);
|
||||
|
||||
configDataAfter = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
|
||||
configDataAfter = GlobalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
|
||||
configId.toString());
|
||||
|
||||
// Verifying Enabled Flag for penalty-wait-period after Updation
|
||||
@@ -116,14 +116,14 @@ public class GlobalConfigurationTest {
|
||||
this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
// Retrieving Is Cache Enabled Global Configuration details
|
||||
ArrayList<HashMap> isCacheGlobalConfig = this.globalConfigurationHelper.getGlobalConfigurationIsCacheEnabled(this.requestSpec,
|
||||
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 = this.globalConfigurationHelper.getGlobalConfigurationIsCacheEnabled(this.requestSpec, this.responseSpec);
|
||||
isCacheGlobalConfig = GlobalConfigurationHelper.getGlobalConfigurationIsCacheEnabled(this.requestSpec, this.responseSpec);
|
||||
Assertions.assertNotNull(isCacheGlobalConfig);
|
||||
|
||||
HashMap cacheTypeAsHashMap = (HashMap) isCacheGlobalConfig.get(cacheType).get("cacheType");
|
||||
@@ -137,7 +137,7 @@ public class GlobalConfigurationTest {
|
||||
cacheTypeId -= 1;
|
||||
}
|
||||
|
||||
HashMap changes = this.globalConfigurationHelper.updateIsCacheEnabledForGlobalConfiguration(this.requestSpec, this.responseSpec,
|
||||
HashMap changes = GlobalConfigurationHelper.updateIsCacheEnabledForGlobalConfiguration(this.requestSpec, this.responseSpec,
|
||||
cacheTypeId.toString());
|
||||
Assertions.assertEquals(cacheTypeId, changes.get("cacheType"), "Verifying Is Cache Enabled Global Config after Updation");
|
||||
}
|
||||
@@ -147,8 +147,7 @@ public class GlobalConfigurationTest {
|
||||
public void testGlobalConfigForcePasswordResetDays() {
|
||||
|
||||
// Retrieving All Global Configuration details
|
||||
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec,
|
||||
this.responseSpec);
|
||||
final ArrayList<HashMap> globalConfig = GlobalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
|
||||
Assertions.assertNotNull(globalConfig);
|
||||
|
||||
String configName = "force-password-reset-days";
|
||||
@@ -164,7 +163,7 @@ public class GlobalConfigurationTest {
|
||||
* Update force-password-reset-days with value as 0 and Enable
|
||||
* as true - failure case
|
||||
*/
|
||||
ArrayList error = (ArrayList) this.globalConfigurationHelper.updatePasswordResetDaysForGlobalConfiguration(this.requestSpec,
|
||||
ArrayList error = (ArrayList) GlobalConfigurationHelper.updatePasswordResetDaysForGlobalConfiguration(this.requestSpec,
|
||||
this.httpStatusForidden, configId, newValue, newBooleanValue, CommonConstants.RESPONSE_ERROR);
|
||||
HashMap hash = (HashMap) error.get(0);
|
||||
|
||||
@@ -176,12 +175,12 @@ public class GlobalConfigurationTest {
|
||||
* Update force-password-reset-days with value as 50 and Enable
|
||||
* as true - success case
|
||||
*/
|
||||
final HashMap updateSuccess = (HashMap) this.globalConfigurationHelper.updatePasswordResetDaysForGlobalConfiguration(
|
||||
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) this.globalConfigurationHelper.updatePasswordResetDaysForGlobalConfiguration(
|
||||
final HashMap updateSuccess1 = (HashMap) GlobalConfigurationHelper.updatePasswordResetDaysForGlobalConfiguration(
|
||||
this.requestSpec, this.responseSpec, configId, newValue, "false", "changes");
|
||||
Assertions.assertNotNull(updateSuccess1);
|
||||
|
||||
@@ -189,8 +188,8 @@ public class GlobalConfigurationTest {
|
||||
* Update without sending value and Enable as true - failure
|
||||
* case
|
||||
*/
|
||||
ArrayList failure = (ArrayList) this.globalConfigurationHelper.updatePasswordResetDaysForGlobalConfiguration(
|
||||
this.requestSpec, this.httpStatusForidden, configId, null, newBooleanValue, CommonConstants.RESPONSE_ERROR);
|
||||
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),
|
||||
@@ -204,8 +203,8 @@ public class GlobalConfigurationTest {
|
||||
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 = this.globalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec,
|
||||
this.responseSpec, configId, newValue);
|
||||
Integer updateConfigId = GlobalConfigurationHelper.updateValueForGlobalConfiguration(this.requestSpec, this.responseSpec,
|
||||
configId, newValue);
|
||||
Assertions.assertNotNull(updateConfigId);
|
||||
break;
|
||||
}
|
||||
|
||||
+85
-85
@@ -203,7 +203,7 @@ public class RecurringDepositTest {
|
||||
ACTIVATION_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsActive(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
|
||||
|
||||
@@ -261,7 +261,7 @@ public class RecurringDepositTest {
|
||||
/***
|
||||
* Verify journal entry transactions for preclosure transaction
|
||||
*/
|
||||
recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountId);
|
||||
Float maturityAmount = Float.valueOf(recurringDepositAccountData.get("maturityAmount").toString());
|
||||
this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, CLOSED_ON_DATE,
|
||||
@@ -383,7 +383,7 @@ public class RecurringDepositTest {
|
||||
ACTIVATION_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsActive(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
|
||||
|
||||
@@ -447,7 +447,7 @@ public class RecurringDepositTest {
|
||||
this.responseSpec, recurringDepositAccountId.toString());
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositAccountIsPrematureClosed(recurringDepositAccountStatusHashMap);
|
||||
|
||||
recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountId);
|
||||
Float maturityAmount = Float.valueOf(recurringDepositAccountData.get("maturityAmount").toString());
|
||||
/***
|
||||
@@ -465,8 +465,8 @@ public class RecurringDepositTest {
|
||||
/***
|
||||
* Verify rd account maturity amount and savings account balance
|
||||
*/
|
||||
HashMap recurringDepositData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
HashMap recurringDepositData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountId);
|
||||
Float prematurityAmount = (Float) recurringDepositData.get("maturityAmount");
|
||||
|
||||
HashMap savingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
@@ -587,7 +587,7 @@ public class RecurringDepositTest {
|
||||
ACTIVATION_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsActive(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
|
||||
|
||||
@@ -652,7 +652,7 @@ public class RecurringDepositTest {
|
||||
this.responseSpec, recurringDepositAccountId.toString());
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositAccountIsPrematureClosed(recurringDepositAccountStatusHashMap);
|
||||
|
||||
recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountId);
|
||||
Float maturityAmount = Float.valueOf(recurringDepositAccountData.get("maturityAmount").toString());
|
||||
/***
|
||||
@@ -670,8 +670,8 @@ public class RecurringDepositTest {
|
||||
/***
|
||||
* Verify rd account maturity amount and savings account balance
|
||||
*/
|
||||
HashMap recurringDepositData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
HashMap recurringDepositData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountId);
|
||||
Float prematurityAmount = (Float) recurringDepositData.get("maturityAmount");
|
||||
HashMap summary = (HashMap) recurringDepositData.get("summary");
|
||||
Assertions.assertNotNull(summary.get("totalWithholdTax"));
|
||||
@@ -799,7 +799,7 @@ public class RecurringDepositTest {
|
||||
ACTIVATION_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsActive(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
|
||||
|
||||
@@ -830,7 +830,7 @@ public class RecurringDepositTest {
|
||||
String JobName = "Update Deposit Accounts Maturity details";
|
||||
schedulerJobHelper.executeAndAwaitJob(JobName);
|
||||
|
||||
HashMap accountDetails = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
HashMap accountDetails = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountId);
|
||||
|
||||
HashMap summary = (HashMap) accountDetails.get("summary");
|
||||
@@ -906,9 +906,9 @@ public class RecurringDepositTest {
|
||||
liabilityAccount, incomeAccount, expenseAccount);
|
||||
Assertions.assertNotNull(recurringDepositProductId);
|
||||
|
||||
ArrayList<HashMap> allRecurringDepositProductsData = this.recurringDepositProductHelper
|
||||
ArrayList<HashMap> allRecurringDepositProductsData = RecurringDepositProductHelper
|
||||
.retrieveAllRecurringDepositProducts(this.requestSpec, this.responseSpec);
|
||||
HashMap recurringDepositProductData = this.recurringDepositProductHelper.retrieveRecurringDepositProductById(this.requestSpec,
|
||||
HashMap recurringDepositProductData = RecurringDepositProductHelper.retrieveRecurringDepositProductById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositProductId.toString());
|
||||
|
||||
/***
|
||||
@@ -936,7 +936,7 @@ public class RecurringDepositTest {
|
||||
ACTIVATION_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsActive(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
|
||||
|
||||
@@ -1398,20 +1398,20 @@ public class RecurringDepositTest {
|
||||
APPROVED_ON_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsApproved(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
|
||||
Float maturityAmount = (Float) recurringDepositAccountData.get("maturityAmount");
|
||||
Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.recurringDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = RecurringDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, recurringDepositProductId);
|
||||
|
||||
HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
|
||||
Float principal = (Float) recurringDepositSummary.get("accountBalance");
|
||||
|
||||
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = RecurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {}", perDay);
|
||||
@@ -1419,8 +1419,8 @@ public class RecurringDepositTest {
|
||||
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
|
||||
principal = this.recurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositAmount,
|
||||
depositPeriod, interestPerDay, MONTHLY_INTERVAL, MONTHLY_INTERVAL);
|
||||
principal = RecurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositAmount, depositPeriod,
|
||||
interestPerDay, MONTHLY_INTERVAL, MONTHLY_INTERVAL);
|
||||
|
||||
principal = (float) Math.floor(principal);
|
||||
maturityAmount = (float) Math.floor(maturityAmount);
|
||||
@@ -1481,20 +1481,20 @@ public class RecurringDepositTest {
|
||||
APPROVED_ON_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsApproved(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
|
||||
Float maturityAmount = (Float) recurringDepositAccountData.get("maturityAmount");
|
||||
Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.recurringDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = RecurringDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, recurringDepositProductId);
|
||||
|
||||
HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
|
||||
Float principal = (Float) recurringDepositSummary.get("accountBalance");
|
||||
|
||||
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = RecurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {}", perDay);
|
||||
@@ -1502,8 +1502,8 @@ public class RecurringDepositTest {
|
||||
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
|
||||
principal = this.recurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositAmount,
|
||||
depositPeriod, interestPerDay, MONTHLY_INTERVAL, MONTHLY_INTERVAL);
|
||||
principal = RecurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, depositAmount, depositPeriod,
|
||||
interestPerDay, MONTHLY_INTERVAL, MONTHLY_INTERVAL);
|
||||
|
||||
principal = (float) Math.floor(principal);
|
||||
maturityAmount = (float) Math.floor(maturityAmount);
|
||||
@@ -1560,12 +1560,12 @@ public class RecurringDepositTest {
|
||||
ACTIVATION_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsActive(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.recurringDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = RecurringDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, recurringDepositProductId);
|
||||
|
||||
Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId,
|
||||
@@ -1575,7 +1575,7 @@ public class RecurringDepositTest {
|
||||
HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
|
||||
Float principal = (Float) recurringDepositSummary.get("totalDeposits");
|
||||
|
||||
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = RecurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {}", perDay);
|
||||
@@ -1664,14 +1664,14 @@ public class RecurringDepositTest {
|
||||
ACTIVATION_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsActive(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
|
||||
Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Float preClosurePenalInterestRate = (Float) recurringDepositAccountData.get("preClosurePenalInterest");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.recurringDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = RecurringDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, recurringDepositProductId);
|
||||
|
||||
Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId,
|
||||
@@ -1681,7 +1681,7 @@ public class RecurringDepositTest {
|
||||
HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
|
||||
Float principal = (Float) recurringDepositSummary.get("totalDeposits");
|
||||
|
||||
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = RecurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
interestRate -= preClosurePenalInterestRate;
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
@@ -1720,7 +1720,7 @@ public class RecurringDepositTest {
|
||||
this.responseSpec, recurringDepositAccountId.toString());
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositAccountIsPrematureClosed(recurringDepositAccountStatusHashMap);
|
||||
|
||||
recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountId);
|
||||
|
||||
principal = (float) Math.floor(principal);
|
||||
@@ -1794,14 +1794,14 @@ public class RecurringDepositTest {
|
||||
ACTIVATION_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsActive(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
|
||||
Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Float preClosurePenalInterestRate = (Float) recurringDepositAccountData.get("preClosurePenalInterest");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.recurringDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = RecurringDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, recurringDepositProductId);
|
||||
|
||||
Integer depositTransactionId = this.recurringDepositAccountHelper.depositToRecurringDepositAccount(recurringDepositAccountId,
|
||||
@@ -1811,7 +1811,7 @@ public class RecurringDepositTest {
|
||||
HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
|
||||
Float principal = (Float) recurringDepositSummary.get("totalDeposits");
|
||||
|
||||
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = RecurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
interestRate -= preClosurePenalInterestRate;
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
@@ -1850,7 +1850,7 @@ public class RecurringDepositTest {
|
||||
this.responseSpec, recurringDepositAccountId.toString());
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositAccountIsPrematureClosed(recurringDepositAccountStatusHashMap);
|
||||
|
||||
recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountId);
|
||||
|
||||
principal = (float) Math.floor(principal);
|
||||
@@ -1922,13 +1922,13 @@ public class RecurringDepositTest {
|
||||
ACTIVATION_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsActive(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
|
||||
HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Float preClosurePenalInterestRate = (Float) recurringDepositAccountData.get("preClosurePenalInterest");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.recurringDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = RecurringDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, recurringDepositProductId);
|
||||
|
||||
Calendar activationDate = Calendar.getInstance();
|
||||
@@ -1948,7 +1948,7 @@ public class RecurringDepositTest {
|
||||
HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
|
||||
Float principal = (Float) recurringDepositSummary.get("totalDeposits");
|
||||
|
||||
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositedPeriod);
|
||||
Float interestRate = RecurringDepositAccountHelper.getInterestRate(interestRateChartData, depositedPeriod);
|
||||
interestRate -= preClosurePenalInterestRate;
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
@@ -1988,7 +1988,7 @@ public class RecurringDepositTest {
|
||||
this.responseSpec, recurringDepositAccountId.toString());
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositAccountIsPrematureClosed(recurringDepositAccountStatusHashMap);
|
||||
|
||||
recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountId);
|
||||
|
||||
principal = (float) Math.floor(principal);
|
||||
@@ -2065,13 +2065,13 @@ public class RecurringDepositTest {
|
||||
ACTIVATION_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsActive(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
Float depositAmount = (Float) recurringDepositAccountData.get("mandatoryRecommendedDepositAmount");
|
||||
HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Float preClosurePenalInterestRate = (Float) recurringDepositAccountData.get("preClosurePenalInterest");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.recurringDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = RecurringDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, recurringDepositProductId);
|
||||
|
||||
Calendar activationDate = Calendar.getInstance();
|
||||
@@ -2091,7 +2091,7 @@ public class RecurringDepositTest {
|
||||
HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
|
||||
Float principal = (Float) recurringDepositSummary.get("totalDeposits");
|
||||
|
||||
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositedPeriod);
|
||||
Float interestRate = RecurringDepositAccountHelper.getInterestRate(interestRateChartData, depositedPeriod);
|
||||
interestRate -= preClosurePenalInterestRate;
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
@@ -2131,7 +2131,7 @@ public class RecurringDepositTest {
|
||||
this.responseSpec, recurringDepositAccountId.toString());
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositAccountIsPrematureClosed(recurringDepositAccountStatusHashMap);
|
||||
|
||||
recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountId);
|
||||
|
||||
principal = (float) Math.floor(principal);
|
||||
@@ -2193,7 +2193,7 @@ public class RecurringDepositTest {
|
||||
APPROVED_ON_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsApproved(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
|
||||
Float principal = (Float) recurringDepositSummary.get("accountBalance");
|
||||
@@ -2202,10 +2202,10 @@ public class RecurringDepositTest {
|
||||
Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.recurringDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = RecurringDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, recurringDepositProductId);
|
||||
|
||||
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = RecurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {}", perDay);
|
||||
@@ -2213,7 +2213,7 @@ public class RecurringDepositTest {
|
||||
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
|
||||
principal = this.recurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount,
|
||||
principal = RecurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount,
|
||||
depositPeriod, interestPerDay, DAILY_COMPOUNDING_INTERVAL, MONTHLY_INTERVAL);
|
||||
|
||||
principal = (float) Math.floor(principal);
|
||||
@@ -2276,7 +2276,7 @@ public class RecurringDepositTest {
|
||||
APPROVED_ON_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsApproved(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
|
||||
Float principal = (Float) recurringDepositSummary.get("accountBalance");
|
||||
@@ -2285,10 +2285,10 @@ public class RecurringDepositTest {
|
||||
Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.recurringDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = RecurringDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, recurringDepositProductId);
|
||||
|
||||
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = RecurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {}", perDay);
|
||||
@@ -2296,7 +2296,7 @@ public class RecurringDepositTest {
|
||||
|
||||
Integer daysInMonth = todaysDate.getActualMaximum(Calendar.DATE);
|
||||
|
||||
principal = this.recurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount,
|
||||
principal = RecurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount,
|
||||
depositPeriod, interestPerDay, DAILY_COMPOUNDING_INTERVAL, MONTHLY_INTERVAL);
|
||||
|
||||
principal = (float) Math.floor(principal);
|
||||
@@ -2366,7 +2366,7 @@ public class RecurringDepositTest {
|
||||
APPROVED_ON_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsApproved(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
|
||||
Float principal = (Float) recurringDepositSummary.get("accountBalance");
|
||||
@@ -2374,19 +2374,19 @@ public class RecurringDepositTest {
|
||||
Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.recurringDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = RecurringDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, recurringDepositProductId);
|
||||
|
||||
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = RecurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {}", perDay);
|
||||
double interestPerDay = interestRateInFraction * perDay;
|
||||
|
||||
principal = this.recurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount,
|
||||
principal = RecurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount,
|
||||
depositPeriod, interestPerDay, BIANNULLY_INTERVAL, BIANNULLY_INTERVAL);
|
||||
|
||||
recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountId);
|
||||
|
||||
Double expectedPrematureAmount = Math.floor(principal);
|
||||
@@ -2456,7 +2456,7 @@ public class RecurringDepositTest {
|
||||
APPROVED_ON_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsApproved(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
|
||||
Float principal = (Float) recurringDepositSummary.get("accountBalance");
|
||||
@@ -2464,19 +2464,19 @@ public class RecurringDepositTest {
|
||||
Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.recurringDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = RecurringDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, recurringDepositProductId);
|
||||
|
||||
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = RecurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {} ", perDay);
|
||||
double interestPerDay = interestRateInFraction * perDay;
|
||||
|
||||
principal = this.recurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount,
|
||||
principal = RecurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount,
|
||||
depositPeriod, interestPerDay, BIANNULLY_INTERVAL, BIANNULLY_INTERVAL);
|
||||
|
||||
recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountId);
|
||||
|
||||
Double expectedPrematureAmount = Math.floor(principal);
|
||||
@@ -2545,7 +2545,7 @@ public class RecurringDepositTest {
|
||||
APPROVED_ON_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
|
||||
|
||||
@@ -2554,19 +2554,19 @@ public class RecurringDepositTest {
|
||||
Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.recurringDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = RecurringDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, recurringDepositProductId);
|
||||
|
||||
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = RecurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {} ", perDay);
|
||||
double interestPerDay = interestRateInFraction * perDay;
|
||||
|
||||
principal = this.recurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount,
|
||||
principal = RecurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount,
|
||||
depositPeriod, interestPerDay, DAILY_COMPOUNDING_INTERVAL, ANNUL_INTERVAL);
|
||||
|
||||
recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountId);
|
||||
|
||||
Double expectedPrematureAmount = Math.floor(principal);
|
||||
@@ -2635,7 +2635,7 @@ public class RecurringDepositTest {
|
||||
APPROVED_ON_DATE);
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsApproved(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
|
||||
|
||||
@@ -2644,19 +2644,19 @@ public class RecurringDepositTest {
|
||||
Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.recurringDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = RecurringDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, recurringDepositProductId);
|
||||
|
||||
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = RecurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {} ", perDay);
|
||||
double interestPerDay = interestRateInFraction * perDay;
|
||||
|
||||
principal = this.recurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount,
|
||||
principal = RecurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount,
|
||||
depositPeriod, interestPerDay, DAILY_COMPOUNDING_INTERVAL, ANNUL_INTERVAL);
|
||||
|
||||
recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountId);
|
||||
|
||||
Double expectedPrematureAmount = Math.floor(principal);
|
||||
@@ -2726,7 +2726,7 @@ public class RecurringDepositTest {
|
||||
APPROVED_ON_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsApproved(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
|
||||
Float principal = (Float) recurringDepositSummary.get("accountBalance");
|
||||
@@ -2734,19 +2734,19 @@ public class RecurringDepositTest {
|
||||
Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.recurringDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = RecurringDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, recurringDepositProductId);
|
||||
|
||||
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = RecurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {} ", perDay);
|
||||
double interestPerDay = interestRateInFraction * perDay;
|
||||
|
||||
principal = this.recurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount,
|
||||
principal = RecurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount,
|
||||
depositPeriod, interestPerDay, QUARTERLY_INTERVAL, QUARTERLY_INTERVAL);
|
||||
|
||||
recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountId);
|
||||
|
||||
Double expectedPrematureAmount = Math.floor(principal);
|
||||
@@ -2816,7 +2816,7 @@ public class RecurringDepositTest {
|
||||
APPROVED_ON_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsApproved(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
HashMap recurringDepositSummary = this.recurringDepositAccountHelper.getRecurringDepositSummary(recurringDepositAccountId);
|
||||
Float principal = (Float) recurringDepositSummary.get("accountBalance");
|
||||
@@ -2824,19 +2824,19 @@ public class RecurringDepositTest {
|
||||
Integer depositPeriod = (Integer) recurringDepositAccountData.get("depositPeriod");
|
||||
HashMap daysInYearMap = (HashMap) recurringDepositAccountData.get("interestCalculationDaysInYearType");
|
||||
Integer daysInYear = (Integer) daysInYearMap.get("id");
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = this.recurringDepositProductHelper
|
||||
ArrayList<ArrayList<HashMap>> interestRateChartData = RecurringDepositProductHelper
|
||||
.getInterestRateChartSlabsByProductId(this.requestSpec, this.responseSpec, recurringDepositProductId);
|
||||
|
||||
Float interestRate = this.recurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
Float interestRate = RecurringDepositAccountHelper.getInterestRate(interestRateChartData, depositPeriod);
|
||||
double interestRateInFraction = interestRate / 100;
|
||||
double perDay = (double) 1 / daysInYear;
|
||||
LOG.info("per day = {} ", perDay);
|
||||
double interestPerDay = interestRateInFraction * perDay;
|
||||
|
||||
principal = this.recurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount,
|
||||
principal = RecurringDepositAccountHelper.getPrincipalAfterCompoundingInterest(todaysDate, principal, recurringDepositAmount,
|
||||
depositPeriod, interestPerDay, QUARTERLY_INTERVAL, QUARTERLY_INTERVAL);
|
||||
|
||||
recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec, this.responseSpec,
|
||||
recurringDepositAccountId);
|
||||
|
||||
Double expectedPrematureAmount = Math.floor(principal);
|
||||
@@ -3003,7 +3003,7 @@ public class RecurringDepositTest {
|
||||
ACTIVATION_DATE);
|
||||
RecurringDepositAccountStatusChecker.verifyRecurringDepositIsActive(recurringDepositAccountStatusHashMap);
|
||||
|
||||
HashMap recurringDepositAccountData = this.recurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
HashMap recurringDepositAccountData = RecurringDepositAccountHelper.getRecurringDepositAccountById(this.requestSpec,
|
||||
this.responseSpec, recurringDepositAccountId);
|
||||
|
||||
Assertions.assertEquals(interestRate, recurringDepositAccountData.get("nominalAnnualInterestRate"));
|
||||
@@ -3075,7 +3075,7 @@ public class RecurringDepositTest {
|
||||
final String recurringDepositApplicationJSON = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec)
|
||||
.withSubmittedOnDate(submittedOnDate).withExpectedFirstDepositOnDate(expectedFirstDepositOnDate)
|
||||
.build(clientID, productID, penalInterestType);
|
||||
return this.recurringDepositAccountHelper.applyRecurringDepositApplication(recurringDepositApplicationJSON, this.requestSpec,
|
||||
return RecurringDepositAccountHelper.applyRecurringDepositApplication(recurringDepositApplicationJSON, this.requestSpec,
|
||||
this.responseSpec);
|
||||
}
|
||||
|
||||
@@ -3086,7 +3086,7 @@ public class RecurringDepositTest {
|
||||
final String recurringDepositApplicationJSON = new RecurringDepositAccountHelper(this.requestSpec, this.responseSpec)
|
||||
.withSubmittedOnDate(submittedOnDate).withExpectedFirstDepositOnDate(expectedFirstDepositOnDate)
|
||||
.withDepositPeriod(depositPeriod).withMandatoryDepositAmount(depositAmount).build(clientID, productID, penalInterestType);
|
||||
return this.recurringDepositAccountHelper.applyRecurringDepositApplication(recurringDepositApplicationJSON, this.requestSpec,
|
||||
return RecurringDepositAccountHelper.applyRecurringDepositApplication(recurringDepositApplicationJSON, this.requestSpec,
|
||||
this.responseSpec);
|
||||
}
|
||||
|
||||
|
||||
+124
-130
@@ -66,7 +66,8 @@ import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@SuppressWarnings({ "unused", "unchecked", "rawtypes", "static-access", "cast" })
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
|
||||
public class SchedulerJobsTestResults {
|
||||
|
||||
private static final String FROM_ACCOUNT_TYPE_LOAN = "1";
|
||||
@@ -96,30 +97,30 @@ public class SchedulerJobsTestResults {
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
Utils.initializeRESTAssured();
|
||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
this.requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||
this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||
requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||
requestSpec.header("Fineract-Platform-TenantId", "default");
|
||||
responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
|
||||
this.responseSpecForSchedulerJob = new ResponseSpecBuilder().expectStatusCode(202).build();
|
||||
this.accountHelper = new AccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
|
||||
this.accountHelper = new AccountHelper(requestSpec, responseSpec);
|
||||
this.journalEntryHelper = new JournalEntryHelper(requestSpec, responseSpec);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void tearDown() {
|
||||
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
||||
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(this.requestSpec, this.responseSpec);
|
||||
GlobalConfigurationHelper.resetAllDefaultGlobalConfigurations(requestSpec, responseSpec);
|
||||
GlobalConfigurationHelper.verifyAllDefaultGlobalConfigurations(requestSpec, responseSpec);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApplyAnnualFeeForSavingsJobOutcome() throws InterruptedException {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(clientID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
|
||||
final Integer savingsProductID = createSavingsProduct(requestSpec, responseSpec,
|
||||
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
|
||||
Assertions.assertNotNull(savingsProductID);
|
||||
|
||||
@@ -127,11 +128,10 @@ public class SchedulerJobsTestResults {
|
||||
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assertions.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(requestSpec, responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
final Integer annualFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getSavingsAnnualFeeJSON());
|
||||
final Integer annualFeeChargeId = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper.getSavingsAnnualFeeJSON());
|
||||
Assertions.assertNotNull(annualFeeChargeId);
|
||||
|
||||
this.savingsAccountHelper.addChargesForSavings(savingsId, annualFeeChargeId, true);
|
||||
@@ -147,7 +147,7 @@ public class SchedulerJobsTestResults {
|
||||
String JobName = "Apply Annual Fee For Savings";
|
||||
|
||||
this.schedulerJobHelper.executeAndAwaitJob(JobName);
|
||||
final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, annualFeeChargeId);
|
||||
final HashMap chargeData = ChargesHelper.getChargeById(requestSpec, responseSpec, annualFeeChargeId);
|
||||
|
||||
Float chargeAmount = (Float) chargeData.get("amount");
|
||||
|
||||
@@ -164,13 +164,13 @@ public class SchedulerJobsTestResults {
|
||||
|
||||
@Test
|
||||
public void testInterestPostingForSavingsJobOutcome() throws InterruptedException {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(clientID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
|
||||
final Integer savingsProductID = createSavingsProduct(requestSpec, responseSpec,
|
||||
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
|
||||
Assertions.assertNotNull(savingsProductID);
|
||||
|
||||
@@ -178,7 +178,7 @@ public class SchedulerJobsTestResults {
|
||||
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assertions.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(requestSpec, responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
@@ -201,14 +201,14 @@ public class SchedulerJobsTestResults {
|
||||
|
||||
@Test
|
||||
public void testTransferFeeForLoansFromSavingsJobOutcome() throws InterruptedException {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(clientID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
|
||||
final Integer savingsProductID = createSavingsProduct(requestSpec, responseSpec,
|
||||
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
|
||||
Assertions.assertNotNull(savingsProductID);
|
||||
|
||||
@@ -216,7 +216,7 @@ public class SchedulerJobsTestResults {
|
||||
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assertions.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(requestSpec, responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
@@ -231,13 +231,13 @@ public class SchedulerJobsTestResults {
|
||||
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), savingsId.toString());
|
||||
Assertions.assertNotNull(loanID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(requestSpec, responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsApproved(loanStatusHashMap);
|
||||
|
||||
Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
Integer specifiedDueDateChargeId = ChargesHelper.createCharges(requestSpec, responseSpec,
|
||||
ChargesHelper.getLoanSpecifiedDueDateWithAccountTransferJSON());
|
||||
Assertions.assertNotNull(specifiedDueDateChargeId);
|
||||
|
||||
@@ -254,7 +254,7 @@ public class SchedulerJobsTestResults {
|
||||
this.schedulerJobHelper.executeAndAwaitJob(JobName);
|
||||
final HashMap summaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
|
||||
final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
|
||||
final HashMap chargeData = ChargesHelper.getChargeById(requestSpec, responseSpec, specifiedDueDateChargeId);
|
||||
|
||||
Float chargeAmount = (Float) chargeData.get("amount");
|
||||
|
||||
@@ -267,15 +267,15 @@ public class SchedulerJobsTestResults {
|
||||
|
||||
@Test
|
||||
public void testApplyHolidaysToLoansJobOutcome() throws InterruptedException {
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
this.holidayHelper = new HolidayHelper(this.requestSpec, this.responseSpec);
|
||||
this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||
this.holidayHelper = new HolidayHelper(requestSpec, responseSpec);
|
||||
this.globalConfigurationHelper = new GlobalConfigurationHelper(requestSpec, responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(clientID);
|
||||
|
||||
Integer holidayId = this.holidayHelper.createHolidays(this.requestSpec, this.responseSpec);
|
||||
Integer holidayId = HolidayHelper.createHolidays(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(holidayId);
|
||||
|
||||
final Integer loanProductID = createLoanProduct(null);
|
||||
@@ -284,7 +284,7 @@ public class SchedulerJobsTestResults {
|
||||
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
|
||||
Assertions.assertNotNull(loanID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(requestSpec, responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
|
||||
@@ -294,8 +294,7 @@ public class SchedulerJobsTestResults {
|
||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||
|
||||
// Retrieving All Global Configuration details
|
||||
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec,
|
||||
this.responseSpec);
|
||||
final ArrayList<HashMap> globalConfig = GlobalConfigurationHelper.getAllGlobalConfigurations(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(globalConfig);
|
||||
|
||||
// Updating Value for reschedule-repayments-on-holidays Global
|
||||
@@ -303,30 +302,29 @@ public class SchedulerJobsTestResults {
|
||||
Integer configId = (Integer) globalConfig.get(3).get("id");
|
||||
Assertions.assertNotNull(configId);
|
||||
|
||||
HashMap configData = this.globalConfigurationHelper.getGlobalConfigurationById(this.requestSpec, this.responseSpec,
|
||||
configId.toString());
|
||||
HashMap configData = GlobalConfigurationHelper.getGlobalConfigurationById(requestSpec, responseSpec, configId.toString());
|
||||
Assertions.assertNotNull(configData);
|
||||
|
||||
Boolean enabled = (Boolean) globalConfig.get(3).get("enabled");
|
||||
|
||||
if (enabled == false) {
|
||||
enabled = true;
|
||||
configId = this.globalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec, this.responseSpec,
|
||||
configId.toString(), enabled);
|
||||
configId = GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(requestSpec, responseSpec, configId.toString(),
|
||||
enabled);
|
||||
}
|
||||
final ArrayList<HashMap> repaymentScheduleDataBeforeJob = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
|
||||
this.responseSpec, loanID);
|
||||
final ArrayList<HashMap> repaymentScheduleDataBeforeJob = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec,
|
||||
responseSpec, loanID);
|
||||
|
||||
holidayId = this.holidayHelper.activateHolidays(this.requestSpec, this.responseSpec, holidayId.toString());
|
||||
holidayId = HolidayHelper.activateHolidays(requestSpec, responseSpec, holidayId.toString());
|
||||
Assertions.assertNotNull(holidayId);
|
||||
|
||||
String JobName = "Apply Holidays To Loans";
|
||||
|
||||
this.schedulerJobHelper.executeAndAwaitJob(JobName);
|
||||
final ArrayList<HashMap> repaymentScheduleDataAfterJob = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
|
||||
this.responseSpec, loanID);
|
||||
final ArrayList<HashMap> repaymentScheduleDataAfterJob = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec,
|
||||
responseSpec, loanID);
|
||||
|
||||
HashMap holidayData = this.holidayHelper.getHolidayById(this.requestSpec, this.responseSpec, holidayId.toString());
|
||||
HashMap holidayData = HolidayHelper.getHolidayById(requestSpec, responseSpec, holidayId.toString());
|
||||
ArrayList<Integer> repaymentsRescheduledDate = (ArrayList<Integer>) holidayData.get("repaymentsRescheduledTo");
|
||||
|
||||
ArrayList<Integer> rescheduleDateAfter = (ArrayList<Integer>) repaymentScheduleDataAfterJob.get(2).get("fromDate");
|
||||
@@ -338,13 +336,13 @@ public class SchedulerJobsTestResults {
|
||||
|
||||
@Test
|
||||
public void testApplyDueFeeChargesForSavingsJobOutcome() throws InterruptedException {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(clientID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
|
||||
final Integer savingsProductID = createSavingsProduct(requestSpec, responseSpec,
|
||||
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
|
||||
Assertions.assertNotNull(savingsProductID);
|
||||
|
||||
@@ -352,10 +350,10 @@ public class SchedulerJobsTestResults {
|
||||
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assertions.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(requestSpec, responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
final Integer specifiedDueDateChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
final Integer specifiedDueDateChargeId = ChargesHelper.createCharges(requestSpec, responseSpec,
|
||||
ChargesHelper.getSavingsSpecifiedDueDateJSON());
|
||||
Assertions.assertNotNull(specifiedDueDateChargeId);
|
||||
|
||||
@@ -376,7 +374,7 @@ public class SchedulerJobsTestResults {
|
||||
this.schedulerJobHelper.executeAndAwaitJob(JobName);
|
||||
HashMap summaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);
|
||||
|
||||
final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, specifiedDueDateChargeId);
|
||||
final HashMap chargeData = ChargesHelper.getChargeById(requestSpec, responseSpec, specifiedDueDateChargeId);
|
||||
|
||||
Float chargeAmount = (Float) chargeData.get("amount");
|
||||
|
||||
@@ -388,8 +386,8 @@ public class SchedulerJobsTestResults {
|
||||
|
||||
@Test
|
||||
public void testUpdateAccountingRunningBalancesJobOutcome() throws InterruptedException {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
||||
|
||||
final Account assetAccount = this.accountHelper.createAssetAccount();
|
||||
final Account incomeAccount = this.accountHelper.createIncomeAccount();
|
||||
@@ -401,10 +399,10 @@ public class SchedulerJobsTestResults {
|
||||
final Integer savingsProductID = createSavingsProduct(MINIMUM_OPENING_BALANCE, assetAccount, incomeAccount, expenseAccount,
|
||||
liabilityAccount);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec, this.DATE_OF_JOINING);
|
||||
final Integer savingsID = this.savingsAccountHelper.applyForSavingsApplication(clientID, savingsProductID, ACCOUNT_TYPE_INDIVIDUAL);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsID);
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(requestSpec, responseSpec, savingsID);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsID);
|
||||
@@ -434,10 +432,10 @@ public class SchedulerJobsTestResults {
|
||||
|
||||
@Test
|
||||
public void testUpdateLoanArrearsAgingJobOutcome() throws InterruptedException {
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(clientID);
|
||||
|
||||
final Integer loanProductID = createLoanProduct(null);
|
||||
@@ -446,7 +444,7 @@ public class SchedulerJobsTestResults {
|
||||
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
|
||||
Assertions.assertNotNull(loanID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(requestSpec, responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
|
||||
@@ -458,7 +456,7 @@ public class SchedulerJobsTestResults {
|
||||
String JobName = "Update Loan Arrears Ageing";
|
||||
|
||||
this.schedulerJobHelper.executeAndAwaitJob(JobName);
|
||||
HashMap loanSummaryData = this.loanTransactionHelper.getLoanSummary(this.requestSpec, this.responseSpec, loanID);
|
||||
HashMap loanSummaryData = this.loanTransactionHelper.getLoanSummary(requestSpec, responseSpec, loanID);
|
||||
|
||||
Float totalLoanArrearsAging = (Float) loanSummaryData.get("principalOverdue") + (Float) loanSummaryData.get("interestOverdue");
|
||||
|
||||
@@ -469,8 +467,8 @@ public class SchedulerJobsTestResults {
|
||||
|
||||
@Test
|
||||
public void testUpdateLoanPaidInAdvanceJobOutcome() throws InterruptedException {
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
|
||||
|
||||
@@ -484,7 +482,7 @@ public class SchedulerJobsTestResults {
|
||||
todayDate.add(Calendar.DATE, -5);
|
||||
final String LOAN_FIRST_REPAYMENT_DATE = dateFormat.format(todayDate.getTime());
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(clientID);
|
||||
|
||||
final Integer loanProductID = createLoanProduct(null);
|
||||
@@ -493,7 +491,7 @@ public class SchedulerJobsTestResults {
|
||||
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
|
||||
Assertions.assertNotNull(loanID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(requestSpec, responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
|
||||
@@ -502,24 +500,22 @@ public class SchedulerJobsTestResults {
|
||||
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(LOAN_DISBURSEMENT_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||
|
||||
ArrayList<HashMap> loanScheduleBefore = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec,
|
||||
loanID);
|
||||
ArrayList<HashMap> loanScheduleBefore = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec, responseSpec, loanID);
|
||||
|
||||
Float totalDueForCurrentPeriod = (Float) loanScheduleBefore.get(1).get("totalDueForPeriod");
|
||||
|
||||
this.loanTransactionHelper.makeRepayment(LOAN_FIRST_REPAYMENT_DATE, totalDueForCurrentPeriod, loanID);
|
||||
|
||||
HashMap loanSummary = this.loanTransactionHelper.getLoanSummary(this.requestSpec, this.responseSpec, loanID);
|
||||
HashMap loanSummary = this.loanTransactionHelper.getLoanSummary(requestSpec, responseSpec, loanID);
|
||||
|
||||
String JobName = "Update Loan Paid In Advance";
|
||||
this.schedulerJobHelper.executeAndAwaitJob(JobName);
|
||||
// Retrieving Loan Repayment Schedule after the successful
|
||||
// completion of
|
||||
// Update Loan Paid in Advance Scheduler Job
|
||||
ArrayList<HashMap> loanScheduleAfter = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec,
|
||||
loanID);
|
||||
ArrayList<HashMap> loanScheduleAfter = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec, responseSpec, loanID);
|
||||
|
||||
loanSummary = this.loanTransactionHelper.getLoanSummary(this.requestSpec, this.responseSpec, loanID);
|
||||
loanSummary = this.loanTransactionHelper.getLoanSummary(requestSpec, responseSpec, loanID);
|
||||
|
||||
Float totalPaidInAdvance = (Float) loanScheduleAfter.get(1).get("totalPaidInAdvanceForPeriod");
|
||||
|
||||
@@ -533,8 +529,8 @@ public class SchedulerJobsTestResults {
|
||||
@Disabled
|
||||
@Test
|
||||
public void testUpdateLoanSummaryJobOutcome() throws InterruptedException {
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
|
||||
|
||||
@@ -548,7 +544,7 @@ public class SchedulerJobsTestResults {
|
||||
todaysDate.add(Calendar.DATE, -5);
|
||||
final String LOAN_FIRST_REPAYMENT_DATE = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(clientID);
|
||||
|
||||
final Integer loanProductID = createLoanProduct(null);
|
||||
@@ -557,8 +553,7 @@ public class SchedulerJobsTestResults {
|
||||
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
|
||||
Assertions.assertNotNull(loanID);
|
||||
|
||||
Integer disburseChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getLoanDisbursementJSON());
|
||||
Integer disburseChargeId = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper.getLoanDisbursementJSON());
|
||||
Assertions.assertNotNull(disburseChargeId);
|
||||
|
||||
this.loanTransactionHelper.addChargesForLoan(loanID,
|
||||
@@ -566,7 +561,7 @@ public class SchedulerJobsTestResults {
|
||||
ArrayList<HashMap> chargesPendingState = this.loanTransactionHelper.getLoanCharges(loanID);
|
||||
Assertions.assertEquals(1, chargesPendingState.size());
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(requestSpec, responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
|
||||
@@ -575,13 +570,13 @@ public class SchedulerJobsTestResults {
|
||||
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(LOAN_DISBURSEMENT_DATE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||
|
||||
HashMap loanSummaryBefore = this.loanTransactionHelper.getLoanSummary(this.requestSpec, this.responseSpec, loanID);
|
||||
HashMap loanSummaryBefore = this.loanTransactionHelper.getLoanSummary(requestSpec, responseSpec, loanID);
|
||||
|
||||
String JobName = "Update loan Summary";
|
||||
this.schedulerJobHelper.executeAndAwaitJob(JobName);
|
||||
Float expectedSummaryAfterJob = (Float) loanSummaryBefore.get("totalExpectedRepayment")
|
||||
/* - (Float) loanSummaryBefore.get("feeChargesPaid") */;
|
||||
HashMap loanSummaryAfter = this.loanTransactionHelper.getLoanSummary(this.requestSpec, this.responseSpec, loanID);
|
||||
HashMap loanSummaryAfter = this.loanTransactionHelper.getLoanSummary(requestSpec, responseSpec, loanID);
|
||||
Assertions.assertEquals(expectedSummaryAfterJob, (Float) loanSummaryAfter.get("totalExpectedRepayment"),
|
||||
"Verifying Loan Summary after Running Update Loan Summary Scheduler Job");
|
||||
|
||||
@@ -589,9 +584,9 @@ public class SchedulerJobsTestResults {
|
||||
|
||||
@Test
|
||||
public void testExecuteStandingInstructionsJobOutcome() throws InterruptedException {
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.standingInstructionsHelper = new StandingInstructionsHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
|
||||
this.standingInstructionsHelper = new StandingInstructionsHelper(requestSpec, responseSpec);
|
||||
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
|
||||
DateFormat monthDayFormat = new SimpleDateFormat("dd MMMM", Locale.US);
|
||||
@@ -605,10 +600,10 @@ public class SchedulerJobsTestResults {
|
||||
todaysDate.add(Calendar.YEAR, 1);
|
||||
final String VALID_TO = dateFormat.format(todaysDate.getTime());
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(clientID);
|
||||
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec,
|
||||
final Integer savingsProductID = createSavingsProduct(requestSpec, responseSpec,
|
||||
ClientSavingsIntegrationTest.MINIMUM_OPENING_BALANCE);
|
||||
Assertions.assertNotNull(savingsProductID);
|
||||
|
||||
@@ -616,7 +611,7 @@ public class SchedulerJobsTestResults {
|
||||
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assertions.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, fromSavingsId);
|
||||
HashMap fromSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(requestSpec, responseSpec, fromSavingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(fromSavingsStatusHashMap);
|
||||
|
||||
fromSavingsStatusHashMap = this.savingsAccountHelper.approveSavings(fromSavingsId);
|
||||
@@ -629,7 +624,7 @@ public class SchedulerJobsTestResults {
|
||||
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assertions.assertNotNull(savingsProductID);
|
||||
|
||||
HashMap toSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, toSavingsId);
|
||||
HashMap toSavingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(requestSpec, responseSpec, toSavingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(toSavingsStatusHashMap);
|
||||
|
||||
toSavingsStatusHashMap = this.savingsAccountHelper.approveSavings(toSavingsId);
|
||||
@@ -681,15 +676,14 @@ public class SchedulerJobsTestResults {
|
||||
|
||||
@Test
|
||||
public void testApplyPenaltyForOverdueLoansJobOutcome() throws InterruptedException {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(clientID);
|
||||
|
||||
Integer overdueFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
ChargesHelper.getLoanOverdueFeeJSON());
|
||||
Integer overdueFeeChargeId = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper.getLoanOverdueFeeJSON());
|
||||
Assertions.assertNotNull(overdueFeeChargeId);
|
||||
|
||||
final Integer loanProductID = createLoanProduct(overdueFeeChargeId.toString());
|
||||
@@ -698,7 +692,7 @@ public class SchedulerJobsTestResults {
|
||||
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
|
||||
Assertions.assertNotNull(loanID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(requestSpec, responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
|
||||
@@ -707,18 +701,18 @@ public class SchedulerJobsTestResults {
|
||||
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(AccountTransferTest.LOAN_APPROVAL_DATE_PLUS_ONE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||
|
||||
ArrayList<HashMap> repaymentScheduleDataBefore = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
|
||||
this.responseSpec, loanID);
|
||||
ArrayList<HashMap> repaymentScheduleDataBefore = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec, responseSpec,
|
||||
loanID);
|
||||
|
||||
String JobName = "Apply penalty to overdue loans";
|
||||
this.schedulerJobHelper.executeAndAwaitJob(JobName);
|
||||
|
||||
final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
|
||||
final HashMap chargeData = ChargesHelper.getChargeById(requestSpec, responseSpec, overdueFeeChargeId);
|
||||
|
||||
Float chargeAmount = (Float) chargeData.get("amount");
|
||||
|
||||
ArrayList<HashMap> repaymentScheduleDataAfter = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
|
||||
this.responseSpec, loanID);
|
||||
ArrayList<HashMap> repaymentScheduleDataAfter = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec, responseSpec,
|
||||
loanID);
|
||||
|
||||
Assertions.assertEquals(chargeAmount, (Float) repaymentScheduleDataAfter.get(1).get("penaltyChargesDue"),
|
||||
"Verifying From Penalty Charges due fot first Repayment after Successful completion of Scheduler Job");
|
||||
@@ -731,14 +725,14 @@ public class SchedulerJobsTestResults {
|
||||
|
||||
@Test
|
||||
public void testAvoidUnncessaryPenaltyWhenAmountZeroForOverdueLoansJobOutcome() throws InterruptedException {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(clientID);
|
||||
|
||||
Integer overdueFeeChargeId = ChargesHelper.createCharges(this.requestSpec, this.responseSpec,
|
||||
Integer overdueFeeChargeId = ChargesHelper.createCharges(requestSpec, responseSpec,
|
||||
ChargesHelper.getLoanOverdueFeeJSONWithCalculattionTypePercentage("0.000001"));
|
||||
Assertions.assertNotNull(overdueFeeChargeId);
|
||||
|
||||
@@ -748,7 +742,7 @@ public class SchedulerJobsTestResults {
|
||||
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
|
||||
Assertions.assertNotNull(loanID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(requestSpec, responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
|
||||
@@ -757,8 +751,8 @@ public class SchedulerJobsTestResults {
|
||||
loanStatusHashMap = this.loanTransactionHelper.disburseLoan(AccountTransferTest.LOAN_APPROVAL_DATE_PLUS_ONE, loanID);
|
||||
LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap);
|
||||
|
||||
ArrayList<HashMap> repaymentScheduleDataBefore = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
|
||||
this.responseSpec, loanID);
|
||||
ArrayList<HashMap> repaymentScheduleDataBefore = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec, responseSpec,
|
||||
loanID);
|
||||
|
||||
String JobName = "Apply penalty to overdue loans";
|
||||
Integer jobId = 12;
|
||||
@@ -774,15 +768,15 @@ public class SchedulerJobsTestResults {
|
||||
Assertions.assertNotNull(schedulerJob);
|
||||
}
|
||||
|
||||
final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, overdueFeeChargeId);
|
||||
final HashMap chargeData = ChargesHelper.getChargeById(requestSpec, responseSpec, overdueFeeChargeId);
|
||||
|
||||
ArrayList<HashMap> repaymentScheduleDataAfter = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec,
|
||||
this.responseSpec, loanID);
|
||||
ArrayList<HashMap> repaymentScheduleDataAfter = this.loanTransactionHelper.getLoanRepaymentSchedule(requestSpec, responseSpec,
|
||||
loanID);
|
||||
|
||||
Assertions.assertEquals(0, repaymentScheduleDataAfter.get(1).get("penaltyChargesDue"),
|
||||
"Verifying From Penalty Charges due fot first Repayment after Successful completion of Scheduler Job");
|
||||
|
||||
final ArrayList loanCharges = this.loanTransactionHelper.getLoanCharges(this.requestSpec, this.responseSpec, loanID);
|
||||
final ArrayList loanCharges = this.loanTransactionHelper.getLoanCharges(requestSpec, responseSpec, loanID);
|
||||
|
||||
Assertions.assertNull(loanCharges, "Verifying that charge isn't created when the amount is 0");
|
||||
|
||||
@@ -794,10 +788,10 @@ public class SchedulerJobsTestResults {
|
||||
|
||||
@Test
|
||||
public void testUpdateOverdueDaysForNPA() throws InterruptedException {
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
||||
this.loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||
|
||||
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
final Integer clientID = ClientHelper.createClient(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(clientID);
|
||||
|
||||
final Integer loanProductID = createLoanProduct(null);
|
||||
@@ -806,7 +800,7 @@ public class SchedulerJobsTestResults {
|
||||
final Integer loanID = applyForLoanApplication(clientID.toString(), loanProductID.toString(), null);
|
||||
Assertions.assertNotNull(loanID);
|
||||
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID);
|
||||
HashMap loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(requestSpec, responseSpec, loanID);
|
||||
LoanStatusChecker.verifyLoanIsPending(loanStatusHashMap);
|
||||
|
||||
loanStatusHashMap = this.loanTransactionHelper.approveLoan(AccountTransferTest.LOAN_APPROVAL_DATE, loanID);
|
||||
@@ -826,13 +820,13 @@ public class SchedulerJobsTestResults {
|
||||
|
||||
@Test
|
||||
public void testInterestTransferForSavings() throws InterruptedException {
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(this.requestSpec);
|
||||
this.savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
|
||||
this.schedulerJobHelper = new SchedulerJobHelper(requestSpec);
|
||||
// FixedDepositProductHelper fixedDepositProductHelper = new
|
||||
// FixedDepositProductHelper(this.requestSpec,this.responseSpec);
|
||||
// AccountHelper accountHelper = new AccountHelper(this.requestSpec,
|
||||
// this.responseSpec);
|
||||
FixedDepositAccountHelper fixedDepositAccountHelper = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec);
|
||||
FixedDepositAccountHelper fixedDepositAccountHelper = new FixedDepositAccountHelper(requestSpec, responseSpec);
|
||||
|
||||
DateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.US);
|
||||
// DateFormat monthDayFormat = new SimpleDateFormat("dd MMM",
|
||||
@@ -852,17 +846,17 @@ public class SchedulerJobsTestResults {
|
||||
todaysDate.add(Calendar.MONTH, 1);
|
||||
final String WHOLE_TERM = "1";
|
||||
|
||||
Integer clientId = ClientHelper.createClient(this.requestSpec, this.responseSpec);
|
||||
Integer clientId = ClientHelper.createClient(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(clientId);
|
||||
Float balance = Float.valueOf(MINIMUM_OPENING_BALANCE) + Float.valueOf(FixedDepositAccountHelper.DEPOSIT_AMOUNT);
|
||||
final Integer savingsProductID = createSavingsProduct(this.requestSpec, this.responseSpec, String.valueOf(balance));
|
||||
final Integer savingsProductID = createSavingsProduct(requestSpec, responseSpec, String.valueOf(balance));
|
||||
Assertions.assertNotNull(savingsProductID);
|
||||
|
||||
final Integer savingsId = this.savingsAccountHelper.applyForSavingsApplication(clientId, savingsProductID,
|
||||
ClientSavingsIntegrationTest.ACCOUNT_TYPE_INDIVIDUAL);
|
||||
Assertions.assertNotNull(savingsId);
|
||||
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(this.requestSpec, this.responseSpec, savingsId);
|
||||
HashMap savingsStatusHashMap = SavingsStatusChecker.getStatusOfSavings(requestSpec, responseSpec, savingsId);
|
||||
SavingsStatusChecker.verifySavingsIsPending(savingsStatusHashMap);
|
||||
|
||||
savingsStatusHashMap = this.savingsAccountHelper.approveSavings(savingsId);
|
||||
@@ -880,8 +874,8 @@ public class SchedulerJobsTestResults {
|
||||
VALID_TO, SUBMITTED_ON_DATE, WHOLE_TERM, savingsId.toString(), true, fixedDepositAccountHelper);
|
||||
Assertions.assertNotNull(fixedDepositAccountId);
|
||||
|
||||
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(this.requestSpec,
|
||||
this.responseSpec, fixedDepositAccountId.toString());
|
||||
HashMap fixedDepositAccountStatusHashMap = FixedDepositAccountStatusChecker.getStatusOfFixedDepositAccount(requestSpec,
|
||||
responseSpec, fixedDepositAccountId.toString());
|
||||
FixedDepositAccountStatusChecker.verifyFixedDepositIsPending(fixedDepositAccountStatusHashMap);
|
||||
|
||||
fixedDepositAccountStatusHashMap = fixedDepositAccountHelper.approveFixedDeposit(fixedDepositAccountId, APPROVED_ON_DATE);
|
||||
@@ -975,7 +969,7 @@ public class SchedulerJobsTestResults {
|
||||
// system.out.println("------------------------------CREATING NEW FIXED
|
||||
// DEPOSIT
|
||||
// PRODUCT ---------------------------------------");
|
||||
FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(this.requestSpec, this.responseSpec);
|
||||
FixedDepositProductHelper fixedDepositProductHelper = new FixedDepositProductHelper(requestSpec, responseSpec);
|
||||
final String fixedDepositProductJSON = fixedDepositProductHelper //
|
||||
// .withAccountingRuleAsCashBased(accounts)
|
||||
.withPeriodRangeChart()//
|
||||
@@ -989,11 +983,11 @@ public class SchedulerJobsTestResults {
|
||||
// system.out.println("--------------------------------APPLYING FOR
|
||||
// FIXED
|
||||
// DEPOSIT ACCOUNT --------------------------------");
|
||||
final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(this.requestSpec, this.responseSpec)
|
||||
final String fixedDepositApplicationJSON = new FixedDepositAccountHelper(requestSpec, responseSpec)
|
||||
//
|
||||
.withSubmittedOnDate(submittedOnDate).withSavings(savingsId).transferInterest(true)
|
||||
.withLockinPeriodFrequency("1", FixedDepositAccountHelper.DAYS).build(clientID, productID, penalInterestType);
|
||||
return fixedDepositAccountHelper.applyFixedDepositApplication(fixedDepositApplicationJSON, this.requestSpec, this.responseSpec);
|
||||
return FixedDepositAccountHelper.applyFixedDepositApplication(fixedDepositApplicationJSON, requestSpec, responseSpec);
|
||||
}
|
||||
|
||||
private void validateNumberForEqualExcludePrecission(String val, String val2) {
|
||||
|
||||
+5
-5
@@ -43,7 +43,8 @@ import org.junit.jupiter.api.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@SuppressWarnings({ "static-access", "rawtypes", "unchecked", "deprecation" })
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
|
||||
public class SkipRepaymentOnMonthFirstTest {
|
||||
|
||||
private final static Logger LOG = LoggerFactory.getLogger(SkipRepaymentOnMonthFirstTest.class);
|
||||
@@ -72,8 +73,7 @@ public class SkipRepaymentOnMonthFirstTest {
|
||||
this.globalConfigurationHelper = new GlobalConfigurationHelper(this.requestSpec, this.responseSpec);
|
||||
|
||||
// Retrieving All Global Configuration details
|
||||
final ArrayList<HashMap> globalConfig = this.globalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec,
|
||||
this.responseSpec);
|
||||
final ArrayList<HashMap> globalConfig = GlobalConfigurationHelper.getAllGlobalConfigurations(this.requestSpec, this.responseSpec);
|
||||
Assertions.assertNotNull(globalConfig);
|
||||
|
||||
String configName = "skip-repayment-on-first-day-of-month";
|
||||
@@ -82,7 +82,7 @@ public class SkipRepaymentOnMonthFirstTest {
|
||||
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 = this.globalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec,
|
||||
Integer updateConfigId = GlobalConfigurationHelper.updateEnabledFlagForGlobalConfiguration(this.requestSpec,
|
||||
this.responseSpec, configId.toString(), newBooleanValue);
|
||||
Assertions.assertNotNull(updateConfigId);
|
||||
break;
|
||||
@@ -101,7 +101,7 @@ public class SkipRepaymentOnMonthFirstTest {
|
||||
final String startDate = "15 September 2011";
|
||||
final String frequency = "3"; // Monthly
|
||||
final String interval = "1"; // Every One Moth
|
||||
Integer calendarID = calendarHelper.createMeetingForGroup(requestSpec, responseSpec, groupID, startDate, frequency, interval, null);
|
||||
Integer calendarID = CalendarHelper.createMeetingForGroup(requestSpec, responseSpec, groupID, startDate, frequency, interval, null);
|
||||
LOG.info("caladerId -------------------- {}", calendarID);
|
||||
final Integer loanProductID = createLoanProduct();
|
||||
final Integer loanID = applyForLoanApplication(groupID, loanProductID, calendarID, clientID);
|
||||
|
||||
+1
-2
@@ -55,9 +55,8 @@ public class ClientEntityWorkbookPopulatorTest {
|
||||
@Test
|
||||
public void testClientEntityWorkbookPopulate() throws IOException {
|
||||
// in order to populate helper sheets
|
||||
StaffHelper staffHelper = new StaffHelper();
|
||||
requestSpec.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
|
||||
Integer outcome_staff_creation = staffHelper.createStaff(requestSpec, responseSpec);
|
||||
Integer outcome_staff_creation = StaffHelper.createStaff(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(outcome_staff_creation, "Could not create staff");
|
||||
|
||||
// in order to populate helper sheets
|
||||
|
||||
+5
-10
@@ -65,18 +65,15 @@ public class LoanWorkbookPopulatorTest {
|
||||
Assertions.assertNotNull(outcome_office_creation, "Could not create office");
|
||||
|
||||
// in order to populate helper sheets
|
||||
ClientHelper clientHelper = new ClientHelper(requestSpec, responseSpec);
|
||||
Integer outcome_client_creation = clientHelper.createClient(requestSpec, responseSpec);
|
||||
Integer outcome_client_creation = ClientHelper.createClient(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(outcome_client_creation, "Could not create client");
|
||||
|
||||
// in order to populate helper sheets
|
||||
GroupHelper groupHelper = new GroupHelper(requestSpec, responseSpec);
|
||||
Integer outcome_group_creation = groupHelper.createGroup(requestSpec, responseSpec, true);
|
||||
Integer outcome_group_creation = GroupHelper.createGroup(requestSpec, responseSpec, true);
|
||||
Assertions.assertNotNull(outcome_group_creation, "Could not create group");
|
||||
|
||||
// in order to populate helper sheets
|
||||
StaffHelper staffHelper = new StaffHelper();
|
||||
Integer outcome_staff_creation = staffHelper.createStaff(requestSpec, responseSpec);
|
||||
Integer outcome_staff_creation = StaffHelper.createStaff(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(outcome_staff_creation, "Could not create staff");
|
||||
|
||||
LoanTransactionHelper loanTransactionHelper = new LoanTransactionHelper(requestSpec, responseSpec);
|
||||
@@ -85,17 +82,15 @@ public class LoanWorkbookPopulatorTest {
|
||||
Integer outcome_lp_creaion = loanTransactionHelper.getLoanProductId(jsonLoanProduct);
|
||||
Assertions.assertNotNull(outcome_lp_creaion, "Could not create Loan Product");
|
||||
|
||||
FundsResourceHandler fundsResourceHandler = new FundsResourceHandler();
|
||||
String jsonFund = "{\n" + "\t\"name\": \"" + Utils.randomNameGenerator("Fund_Name", 9) + "\"\n" + "}";
|
||||
Integer outcome_fund_creation = fundsResourceHandler.createFund(jsonFund, requestSpec, responseSpec);
|
||||
Integer outcome_fund_creation = FundsResourceHandler.createFund(jsonFund, requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(outcome_fund_creation, "Could not create Fund");
|
||||
|
||||
PaymentTypeHelper paymentTypeHelper = new PaymentTypeHelper();
|
||||
String name = PaymentTypeHelper.randomNameGenerator("P_T", 5);
|
||||
String description = PaymentTypeHelper.randomNameGenerator("PT_Desc", 15);
|
||||
Boolean isCashPayment = true;
|
||||
Integer position = 1;
|
||||
Integer outcome_payment_creation = paymentTypeHelper.createPaymentType(requestSpec, responseSpec, name, description, isCashPayment,
|
||||
Integer outcome_payment_creation = PaymentTypeHelper.createPaymentType(requestSpec, responseSpec, name, description, isCashPayment,
|
||||
position);
|
||||
Assertions.assertNotNull(outcome_payment_creation, "Could not create payment type");
|
||||
|
||||
|
||||
+4
-7
@@ -63,23 +63,20 @@ public class SavingsWorkbookPopulateTest {
|
||||
Assertions.assertNotNull(outcome_office_creation, "Could not create office");
|
||||
|
||||
// in order to populate helper sheets
|
||||
ClientHelper clientHelper = new ClientHelper(requestSpec, responseSpec);
|
||||
Integer outcome_client_creation = clientHelper.createClient(requestSpec, responseSpec);
|
||||
Integer outcome_client_creation = ClientHelper.createClient(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(outcome_client_creation, "Could not create client");
|
||||
|
||||
// in order to populate helper sheets
|
||||
GroupHelper groupHelper = new GroupHelper(requestSpec, responseSpec);
|
||||
Integer outcome_group_creation = groupHelper.createGroup(requestSpec, responseSpec, true);
|
||||
Integer outcome_group_creation = GroupHelper.createGroup(requestSpec, responseSpec, true);
|
||||
Assertions.assertNotNull(outcome_group_creation, "Could not create group");
|
||||
|
||||
// in order to populate helper sheets
|
||||
StaffHelper staffHelper = new StaffHelper();
|
||||
Integer outcome_staff_creation = staffHelper.createStaff(requestSpec, responseSpec);
|
||||
Integer outcome_staff_creation = StaffHelper.createStaff(requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(outcome_staff_creation, "Could not create staff");
|
||||
|
||||
SavingsProductHelper savingsProductHelper = new SavingsProductHelper();
|
||||
String jsonSavingsProduct = savingsProductHelper.build();
|
||||
Integer outcome_sp_creaction = savingsProductHelper.createSavingsProduct(jsonSavingsProduct, requestSpec, responseSpec);
|
||||
Integer outcome_sp_creaction = SavingsProductHelper.createSavingsProduct(jsonSavingsProduct, requestSpec, responseSpec);
|
||||
Assertions.assertNotNull(outcome_sp_creaction, "Could not create Savings product");
|
||||
|
||||
SavingsAccountHelper savingsAccountHelper = new SavingsAccountHelper(requestSpec, responseSpec);
|
||||
|
||||
Reference in New Issue
Block a user