chore(deps): update dependency com.github.spotbugs:spotbugs to v4.2.0

This commit is contained in:
Renovate Bot
2021-01-17 10:56:15 +01:00
committed by Michael Vorburger ⛑️
parent 8d16c8d8c3
commit ff52192f66
17 changed files with 594 additions and 585 deletions
+1 -1
View File
@@ -417,7 +417,7 @@ configure(project.fineractJavaProjects) {
// https://github.com/diffplug/spotless/tree/main/plugin-gradle
dependencies {
spotbugsPlugins 'jp.skypencil.findbugs.slf4j:bug-pattern:1.5.0@jar'
spotbugs 'com.github.spotbugs:spotbugs:4.1.4'
spotbugs 'com.github.spotbugs:spotbugs:4.2.0'
}
spotless {
@@ -399,7 +399,7 @@ public class DataValidatorBuilder {
}
if (this.value != null) {
final BigDecimal number = BigDecimal.valueOf(Double.valueOf(this.value.toString()));
final BigDecimal number = BigDecimal.valueOf(Double.parseDouble(this.value.toString()));
if (number.compareTo(BigDecimal.ZERO) <= 0) {
final StringBuilder validationErrorCode = new StringBuilder("validation.msg.").append(this.resource).append(".")
.append(this.parameter).append(".not.greater.than.zero");
@@ -422,7 +422,7 @@ public class DataValidatorBuilder {
}
if (this.value != null) {
final BigDecimal number = BigDecimal.valueOf(Double.valueOf(this.value.toString()));
final BigDecimal number = BigDecimal.valueOf(Double.parseDouble(this.value.toString()));
if (number.compareTo(BigDecimal.ZERO) < 0) {
final StringBuilder validationErrorCode = new StringBuilder("validation.msg.").append(this.resource).append(".")
.append(this.parameter).append(".not.zero.or.greater");
@@ -806,7 +806,7 @@ public class DataValidatorBuilder {
public DataValidatorBuilder inMinAndMaxAmountRange(final BigDecimal minimumAmount, final BigDecimal maximumAmount) {
if (minimumAmount != null && maximumAmount != null && this.value != null) {
final BigDecimal amount = BigDecimal.valueOf(Double.valueOf(this.value.toString()));
final BigDecimal amount = BigDecimal.valueOf(Double.parseDouble(this.value.toString()));
if (amount.compareTo(minimumAmount) < 0 || amount.compareTo(maximumAmount) > 0) {
final StringBuilder validationErrorCode = new StringBuilder("validation.msg.").append(this.resource).append(".")
.append(this.parameter).append(".amount.is.not.within.min.max.range");
@@ -824,7 +824,7 @@ public class DataValidatorBuilder {
public DataValidatorBuilder notLessThanMin(final BigDecimal min) {
if (min != null && this.value != null) {
final BigDecimal amount = BigDecimal.valueOf(Double.valueOf(this.value.toString()));
final BigDecimal amount = BigDecimal.valueOf(Double.parseDouble(this.value.toString()));
if (amount.compareTo(min) < 0) {
final StringBuilder validationErrorCode = new StringBuilder("validation.msg.").append(this.resource).append(".")
.append(this.parameter).append(".is.less.than.min");
@@ -841,7 +841,7 @@ public class DataValidatorBuilder {
public DataValidatorBuilder notGreaterThanMax(final BigDecimal max) {
if (max != null && this.value != null) {
final BigDecimal amount = BigDecimal.valueOf(Double.valueOf(this.value.toString()));
final BigDecimal amount = BigDecimal.valueOf(Double.parseDouble(this.value.toString()));
if (amount.compareTo(max) > 0) {
final StringBuilder validationErrorCode = new StringBuilder("validation.msg.").append(this.resource).append(".")
.append(this.parameter).append(".is.greater.than.max");
@@ -1811,8 +1811,8 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
}
if ("DECIMAL".equalsIgnoreCase(colType)) {
final BigDecimal currentDecimal = BigDecimal.valueOf(Double.valueOf(currValue));
final BigDecimal newDecimal = BigDecimal.valueOf(Double.valueOf(pValue));
final BigDecimal currentDecimal = BigDecimal.valueOf(Double.parseDouble(currValue));
final BigDecimal newDecimal = BigDecimal.valueOf(Double.parseDouble(pValue));
return currentDecimal.compareTo(newDecimal) != 0;
}
@@ -87,13 +87,13 @@ public class DefaultPaymentPeriodsInOneYearCalculator implements PaymentPeriodsI
fraction = numberOfDaysInterestCalculationGrace.doubleValue() * every.doubleValue();
break;
case WEEKS:
fraction = numberOfDaysInterestCalculationGrace.doubleValue() / (Double.valueOf("7.0") * every.doubleValue());
fraction = numberOfDaysInterestCalculationGrace.doubleValue() / (Double.parseDouble("7.0") * every.doubleValue());
break;
case MONTHS:
fraction = numberOfDaysInterestCalculationGrace.doubleValue() / (Double.valueOf("30.0") * every.doubleValue());
fraction = numberOfDaysInterestCalculationGrace.doubleValue() / (Double.parseDouble("30.0") * every.doubleValue());
break;
case YEARS:
fraction = numberOfDaysInterestCalculationGrace.doubleValue() / (Double.valueOf("365.0") * every.doubleValue());
fraction = numberOfDaysInterestCalculationGrace.doubleValue() / (Double.parseDouble("365.0") * every.doubleValue());
break;
case INVALID:
fraction = Double.valueOf("0");
@@ -764,7 +764,7 @@ public final class LoanApplicationTerms {
private BigDecimal calculateFlatInterestRateForLoanTerm(final PaymentPeriodsInOneYearCalculator calculator, final MathContext mc) {
final BigDecimal divisor = BigDecimal.valueOf(Double.valueOf("100.0"));
final BigDecimal divisor = BigDecimal.valueOf(Double.parseDouble("100.0"));
final long loanTermPeriodsInOneYear = calculatePeriodsInOneYear(calculator);
final BigDecimal loanTermPeriodsInYearBigDecimal = BigDecimal.valueOf(loanTermPeriodsInOneYear);
@@ -1004,7 +1004,7 @@ public final class LoanApplicationTerms {
final long loanTermPeriodsInOneYear = calculatePeriodsInOneYear(calculator);
final BigDecimal divisor = BigDecimal.valueOf(Double.valueOf("100.0"));
final BigDecimal divisor = BigDecimal.valueOf(Double.parseDouble("100.0"));
final BigDecimal loanTermPeriodsInYearBigDecimal = BigDecimal.valueOf(loanTermPeriodsInOneYear);
BigDecimal periodicInterestRate = BigDecimal.ZERO;
@@ -1088,7 +1088,7 @@ public final class LoanApplicationTerms {
repaymentEvery = getPeriodsBetween(fromDate, toDate);
}
final BigDecimal divisor = BigDecimal.valueOf(Double.valueOf("100.0"));
final BigDecimal divisor = BigDecimal.valueOf(Double.parseDouble("100.0"));
final BigDecimal loanTermPeriodsInYearBigDecimal = BigDecimal.valueOf(loanTermPeriodsInOneYear);
final BigDecimal oneDayOfYearInterestRate = this.annualNominalInterestRate.divide(loanTermPeriodsInYearBigDecimal, mc)
.divide(divisor, mc);
@@ -1265,7 +1265,7 @@ public final class LoanApplicationTerms {
interest = interest.zero();
fraction = fraction - Integer.valueOf(1).doubleValue();
} else if (interestCalculationGraceOnRepaymentPeriodFraction > Double.valueOf("0.25")
} else if (interestCalculationGraceOnRepaymentPeriodFraction > Double.parseDouble("0.25")
&& interestCalculationGraceOnRepaymentPeriodFraction < Integer.valueOf(1).doubleValue()) {
final Money graceOnInterestForRepaymentPeriod = interest.multipliedBy(interestCalculationGraceOnRepaymentPeriodFraction);
@@ -1278,7 +1278,7 @@ public final class LoanApplicationTerms {
}
private boolean isInterestFreeGracePeriodFromDate(final double interestCalculationGraceOnRepaymentPeriodFraction) {
return this.interestChargedFromDate != null && interestCalculationGraceOnRepaymentPeriodFraction > Double.valueOf("0.0");
return this.interestChargedFromDate != null && interestCalculationGraceOnRepaymentPeriodFraction > Double.parseDouble("0.0");
}
private Money calculateEqualPrincipalDueForInstallment(final MathContext mc, final int periodNumber) {
@@ -141,12 +141,12 @@ public class LoanProductMinMaxConstraints {
public BigDecimal getMinNominalInterestRatePerPeriod() {
return this.minNominalInterestRatePerPeriod == null ? null
: BigDecimal.valueOf(Double.valueOf(this.minNominalInterestRatePerPeriod.stripTrailingZeros().toString()));
: BigDecimal.valueOf(Double.parseDouble(this.minNominalInterestRatePerPeriod.stripTrailingZeros().toString()));
}
public BigDecimal getMaxNominalInterestRatePerPeriod() {
return this.maxNominalInterestRatePerPeriod == null ? null
: BigDecimal.valueOf(Double.valueOf(this.maxNominalInterestRatePerPeriod.stripTrailingZeros().toString()));
: BigDecimal.valueOf(Double.parseDouble(this.maxNominalInterestRatePerPeriod.stripTrailingZeros().toString()));
}
public Integer getMinNumberOfRepayments() {
@@ -238,7 +238,7 @@ public class LoanProductRelatedDetail implements LoanProductMinimumRepaymentSche
@Override
public BigDecimal getNominalInterestRatePerPeriod() {
return this.nominalInterestRatePerPeriod == null ? null
: BigDecimal.valueOf(Double.valueOf(this.nominalInterestRatePerPeriod.stripTrailingZeros().toString()));
: BigDecimal.valueOf(Double.parseDouble(this.nominalInterestRatePerPeriod.stripTrailingZeros().toString()));
}
@Override
@@ -249,7 +249,7 @@ public class LoanProductRelatedDetail implements LoanProductMinimumRepaymentSche
@Override
public BigDecimal getAnnualNominalInterestRate() {
return this.annualNominalInterestRate == null ? null
: BigDecimal.valueOf(Double.valueOf(this.annualNominalInterestRate.stripTrailingZeros().toString()));
: BigDecimal.valueOf(Double.parseDouble(this.annualNominalInterestRate.stripTrailingZeros().toString()));
}
@Override
@@ -39,7 +39,7 @@ public final class TaxUtils {
Map<TaxComponent, BigDecimal> map = new HashMap<>(3);
if (amount != null) {
final double amountVal = amount.doubleValue();
double cent_percentage = Double.valueOf("100.0");
double cent_percentage = Double.parseDouble("100.0");
for (TaxGroupMappings groupMappings : taxGroupMappings) {
if (groupMappings.occursOnDayFromAndUpToAndIncluding(date)) {
TaxComponent component = groupMappings.getTaxComponent();
@@ -80,7 +80,7 @@ public final class TaxUtils {
if (amount != null && amount.compareTo(BigDecimal.ZERO) > 0) {
double percentageVal = 0;
double amountVal = amount.doubleValue();
double cent_percentage = Double.valueOf("100.0");
double cent_percentage = Double.parseDouble("100.0");
for (TaxGroupMappings groupMappings : taxGroupMappings) {
if (groupMappings.occursOnDayFromAndUpToAndIncluding(date)) {
TaxComponent component = groupMappings.getTaxComponent();
@@ -42,12 +42,12 @@ public final class LoanProductRelatedDetailTestHelper {
public static LoanProductRelatedDetail createSettingsForEqualPrincipalAmortizationQuarterly() {
final MonetaryCurrency currency = new MonetaryCurrencyBuilder().withCode("USD").withDigitsAfterDecimal(2).build();
final BigDecimal defaultPrincipal = BigDecimal.valueOf(Double.valueOf("200000"));
final BigDecimal defaultPrincipal = BigDecimal.valueOf(Double.parseDouble("200000"));
// 2% per month, 24% per year
final BigDecimal defaultNominalInterestRatePerPeriod = BigDecimal.valueOf(Double.valueOf("2"));
final BigDecimal defaultNominalInterestRatePerPeriod = BigDecimal.valueOf(Double.parseDouble("2"));
final PeriodFrequencyType interestPeriodFrequencyType = PeriodFrequencyType.MONTHS;
final BigDecimal defaultAnnualNominalInterestRate = BigDecimal.valueOf(Double.valueOf("24"));
final BigDecimal defaultAnnualNominalInterestRate = BigDecimal.valueOf(Double.parseDouble("24"));
final InterestMethod interestMethod = InterestMethod.DECLINING_BALANCE;
final InterestCalculationPeriodMethod interestCalculationPeriodMethod = InterestCalculationPeriodMethod.SAME_AS_REPAYMENT_PERIOD;
@@ -66,12 +66,12 @@ public final class LoanProductRelatedDetailTestHelper {
public static LoanProductRelatedDetail createSettingsForEqualInstallmentAmortizationQuarterly() {
final MonetaryCurrency currency = new MonetaryCurrencyBuilder().withCode("USD").withDigitsAfterDecimal(2).build();
final BigDecimal defaultPrincipal = BigDecimal.valueOf(Double.valueOf("200000"));
final BigDecimal defaultPrincipal = BigDecimal.valueOf(Double.parseDouble("200000"));
// 2% per month, 24% per year
final BigDecimal defaultNominalInterestRatePerPeriod = BigDecimal.valueOf(Double.valueOf("2"));
final BigDecimal defaultNominalInterestRatePerPeriod = BigDecimal.valueOf(Double.parseDouble("2"));
final PeriodFrequencyType interestPeriodFrequencyType = PeriodFrequencyType.MONTHS;
final BigDecimal defaultAnnualNominalInterestRate = BigDecimal.valueOf(Double.valueOf("24"));
final BigDecimal defaultAnnualNominalInterestRate = BigDecimal.valueOf(Double.parseDouble("24"));
final InterestMethod interestMethod = InterestMethod.DECLINING_BALANCE;
final InterestCalculationPeriodMethod interestCalculationPeriodMethod = InterestCalculationPeriodMethod.SAME_AS_REPAYMENT_PERIOD;
@@ -91,12 +91,12 @@ public final class LoanProductRelatedDetailTestHelper {
public static LoanProductRelatedDetail createSettingsForFlatQuarterly(final AmortizationMethod amortizationMethod) {
final MonetaryCurrency currency = new MonetaryCurrencyBuilder().withCode("USD").withDigitsAfterDecimal(2).build();
final BigDecimal defaultPrincipal = BigDecimal.valueOf(Double.valueOf("200000"));
final BigDecimal defaultPrincipal = BigDecimal.valueOf(Double.parseDouble("200000"));
// 2% per month, 24% per year
final BigDecimal defaultNominalInterestRatePerPeriod = BigDecimal.valueOf(Double.valueOf("2"));
final BigDecimal defaultNominalInterestRatePerPeriod = BigDecimal.valueOf(Double.parseDouble("2"));
final PeriodFrequencyType interestPeriodFrequencyType = PeriodFrequencyType.MONTHS;
final BigDecimal defaultAnnualNominalInterestRate = BigDecimal.valueOf(Double.valueOf("24"));
final BigDecimal defaultAnnualNominalInterestRate = BigDecimal.valueOf(Double.parseDouble("24"));
final InterestMethod interestMethod = InterestMethod.FLAT;
final InterestCalculationPeriodMethod interestCalculationPeriodMethod = InterestCalculationPeriodMethod.SAME_AS_REPAYMENT_PERIOD;
@@ -115,12 +115,12 @@ public final class LoanProductRelatedDetailTestHelper {
public static LoanProductRelatedDetail createSettingsForIrregularFlatEveryFourMonths() {
final MonetaryCurrency currency = new MonetaryCurrencyBuilder().withCode("KSH").withDigitsAfterDecimal(0).build();
final BigDecimal defaultPrincipal = BigDecimal.valueOf(Double.valueOf("15000"));
final BigDecimal defaultPrincipal = BigDecimal.valueOf(Double.parseDouble("15000"));
// 2% per month, 24% per year
final BigDecimal defaultNominalInterestRatePerPeriod = BigDecimal.valueOf(Double.valueOf("2"));
final BigDecimal defaultNominalInterestRatePerPeriod = BigDecimal.valueOf(Double.parseDouble("2"));
final PeriodFrequencyType interestPeriodFrequencyType = PeriodFrequencyType.MONTHS;
final BigDecimal defaultAnnualNominalInterestRate = BigDecimal.valueOf(Double.valueOf("24"));
final BigDecimal defaultAnnualNominalInterestRate = BigDecimal.valueOf(Double.parseDouble("24"));
final InterestMethod interestMethod = InterestMethod.FLAT;
final InterestCalculationPeriodMethod interestCalculationPeriodMethod = InterestCalculationPeriodMethod.SAME_AS_REPAYMENT_PERIOD;
@@ -37,7 +37,7 @@ public class MoneyBuilder {
}
public MoneyBuilder with(final String withAmount) {
this.newAmount = BigDecimal.valueOf(Double.valueOf(withAmount));
this.newAmount = BigDecimal.valueOf(Double.parseDouble(withAmount));
return this;
}
}
@@ -204,8 +204,8 @@ public class AccountTransferTest {
this.accountTransferHelper.accountTransfer(fromClientID, fromSavingsID, fromClientID, toSavingsID, FROM_SAVINGS_ACCOUNT_TYPE,
TO_SAVINGS_ACCOUNT_TYPE, ACCOUNT_TRANSFER_AMOUNT);
fromSavingsBalance -= Float.valueOf(ACCOUNT_TRANSFER_AMOUNT);
toSavingsBalance += Float.valueOf(ACCOUNT_TRANSFER_AMOUNT);
fromSavingsBalance -= Float.parseFloat(ACCOUNT_TRANSFER_AMOUNT);
toSavingsBalance += Float.parseFloat(ACCOUNT_TRANSFER_AMOUNT);
HashMap fromSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(fromSavingsID);
assertEquals(fromSavingsBalance, fromSavingsSummaryAfter.get("accountBalance"),
@@ -215,9 +215,9 @@ public class AccountTransferTest {
assertEquals(toSavingsBalance, toSavingsSummaryAfter.get("accountBalance"),
"Verifying To Savings Account Balance after Account Transfer");
final JournalEntry[] office1LiabilityEntries = {
new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT), JournalEntry.TransactionType.CREDIT) };
new JournalEntry(Float.parseFloat(ACCOUNT_TRANSFER_AMOUNT), JournalEntry.TransactionType.CREDIT) };
final JournalEntry[] office2LiabilityEntries = {
new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT), JournalEntry.TransactionType.DEBIT) };
new JournalEntry(Float.parseFloat(ACCOUNT_TRANSFER_AMOUNT), JournalEntry.TransactionType.DEBIT) };
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(fromOfficeId, liabilityTransferAccount,
AccountTransferHelper.ACCOUNT_TRANSFER_DATE, office1LiabilityEntries);
@@ -312,9 +312,9 @@ public class AccountTransferTest {
"Verifying To Loan Repayment Amount after Account Transfer");
final JournalEntry[] office1LiabilityEntries = {
new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT_ADJUST), JournalEntry.TransactionType.CREDIT) };
new JournalEntry(Float.parseFloat(ACCOUNT_TRANSFER_AMOUNT_ADJUST), JournalEntry.TransactionType.CREDIT) };
final JournalEntry[] office2LiabilityEntries = {
new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT_ADJUST), JournalEntry.TransactionType.DEBIT) };
new JournalEntry(Float.parseFloat(ACCOUNT_TRANSFER_AMOUNT_ADJUST), JournalEntry.TransactionType.DEBIT) };
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(fromOfficeId, liabilityTransferAccount,
AccountTransferHelper.ACCOUNT_TRANSFER_DATE, office1LiabilityEntries);
@@ -433,9 +433,9 @@ public class AccountTransferTest {
"Verifying From Savings Account Balance after Account Transfer");
final JournalEntry[] office1LiabilityEntries = {
new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT_ADJUST), JournalEntry.TransactionType.CREDIT) };
new JournalEntry(Float.parseFloat(ACCOUNT_TRANSFER_AMOUNT_ADJUST), JournalEntry.TransactionType.CREDIT) };
final JournalEntry[] office2LiabilityEntries = {
new JournalEntry(Float.valueOf(ACCOUNT_TRANSFER_AMOUNT_ADJUST), JournalEntry.TransactionType.DEBIT) };
new JournalEntry(Float.parseFloat(ACCOUNT_TRANSFER_AMOUNT_ADJUST), JournalEntry.TransactionType.DEBIT) };
this.journalEntryHelper.checkJournalEntryForLiabilityAccount(fromOfficeId, liabilityTransferAccount,
AccountTransferHelper.ACCOUNT_TRANSFER_DATE, office1LiabilityEntries);
@@ -803,7 +803,7 @@ public class AccountingScenarioIntegrationTest {
float totalInterest = (float) loanSchedule.get(1).get("interestOriginalDue");
DecimalFormat numberFormat = new DecimalFormat("#.00", new DecimalFormatSymbols(Locale.US));
float interest4Days = totalInterest / totalDaysInPeriod * 4;
interest4Days = Float.valueOf(numberFormat.format(interest4Days));
interest4Days = Float.parseFloat(numberFormat.format(interest4Days));
this.loanTransactionHelper.checkAccrualTransactionForRepayment(getDateAsLocalDate(currentDate), interest4Days, FEE_PORTION,
PENALTY_PORTION, loanID);
@@ -907,7 +907,7 @@ public class AccountingScenarioIntegrationTest {
float totalInterest = (float) loanSchedule.get(1).get("interestOriginalDue");
DecimalFormat numberFormat = new DecimalFormat("#.00", new DecimalFormatSymbols(Locale.US));
float interest3Days = totalInterest / totalDaysInPeriod * 3;
interest3Days = Float.valueOf(numberFormat.format(interest3Days));
interest3Days = Float.parseFloat(numberFormat.format(interest3Days));
this.loanTransactionHelper.checkAccrualTransactionForRepayment(getDateAsLocalDate(runOndate), interest3Days, FEE_PORTION,
PENALTY_PORTION, loanID);
@@ -915,7 +915,7 @@ public class AccountingScenarioIntegrationTest {
this.periodicAccrualAccountingHelper.runPeriodicAccrualAccounting(runOndate);
float interestPerDay = (totalInterest / totalDaysInPeriod * 4) - interest3Days;
interestPerDay = Float.valueOf(numberFormat.format(interestPerDay));
interestPerDay = Float.parseFloat(numberFormat.format(interestPerDay));
this.loanTransactionHelper.checkAccrualTransactionForRepayment(getDateAsLocalDate(runOndate), interestPerDay, NEXT_FEE_PORTION,
NEXT_PENALTY_PORTION, loanID);
@@ -250,7 +250,7 @@ public class ClientSavingsIntegrationTest {
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
Float balance = Float.valueOf(openningBalance);
Float balance = Float.parseFloat(openningBalance);
Float chargeAmt = 100f;
balance -= chargeAmt;
assertEquals(balance, summary.get("accountBalance"), "Verifying opening Balance");
@@ -267,15 +267,15 @@ public class ClientSavingsIntegrationTest {
Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, DEPOSIT_AMOUNT,
TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap depositTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, depositTransactionId);
balance += Float.valueOf(DEPOSIT_AMOUNT);
assertEquals(Float.valueOf(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
balance += Float.parseFloat(DEPOSIT_AMOUNT);
assertEquals(Float.parseFloat(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
assertEquals(balance, depositTransaction.get("runningBalance"), "Verifying Balance after Deposit");
Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, withdrawAmt,
TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
balance -= Float.valueOf(withdrawAmt);
assertEquals(Float.valueOf(withdrawAmt), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
balance -= Float.parseFloat(withdrawAmt);
assertEquals(Float.parseFloat(withdrawAmt), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
assertEquals(balance, withdrawTransaction.get("runningBalance"), "Verifying Balance after Withdrawal");
}
@@ -436,28 +436,28 @@ public class ClientSavingsIntegrationTest {
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
Float balance = Float.valueOf(MINIMUM_OPENING_BALANCE);
Float balance = Float.parseFloat(MINIMUM_OPENING_BALANCE);
assertEquals(balance, summary.get("accountBalance"), "Verifying opening Balance");
Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, DEPOSIT_AMOUNT,
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap depositTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, depositTransactionId);
balance += Float.valueOf(DEPOSIT_AMOUNT);
assertEquals(Float.valueOf(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
balance += Float.parseFloat(DEPOSIT_AMOUNT);
assertEquals(Float.parseFloat(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
assertEquals(balance, depositTransaction.get("runningBalance"), "Verifying Balance after Deposit");
Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT,
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
balance -= Float.valueOf(WITHDRAW_AMOUNT);
assertEquals(Float.valueOf(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
balance -= Float.parseFloat(WITHDRAW_AMOUNT);
assertEquals(Float.parseFloat(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
assertEquals(balance, withdrawTransaction.get("runningBalance"), "Verifying Balance after Withdrawal");
Integer newWithdrawTransactionId = this.savingsAccountHelper.updateSavingsAccountTransaction(savingsId, withdrawTransactionId,
WITHDRAW_AMOUNT_ADJUSTED);
HashMap newWithdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, newWithdrawTransactionId);
balance = balance + Float.valueOf(WITHDRAW_AMOUNT) - Float.valueOf(WITHDRAW_AMOUNT_ADJUSTED);
assertEquals(Float.valueOf(WITHDRAW_AMOUNT_ADJUSTED), newWithdrawTransaction.get("amount"), "Verifying adjusted Amount");
balance = balance + Float.parseFloat(WITHDRAW_AMOUNT) - Float.parseFloat(WITHDRAW_AMOUNT_ADJUSTED);
assertEquals(Float.parseFloat(WITHDRAW_AMOUNT_ADJUSTED), newWithdrawTransaction.get("amount"), "Verifying adjusted Amount");
assertEquals(balance, newWithdrawTransaction.get("runningBalance"), "Verifying Balance after adjust");
summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
assertEquals(balance, summary.get("accountBalance"), "Verifying Adjusted Balance");
@@ -468,7 +468,7 @@ public class ClientSavingsIntegrationTest {
newWithdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
Assertions.assertTrue((Boolean) newWithdrawTransaction.get("reversed"));
summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
balance += Float.valueOf(WITHDRAW_AMOUNT_ADJUSTED);
balance += Float.parseFloat(WITHDRAW_AMOUNT_ADJUSTED);
assertEquals(balance, summary.get("accountBalance"), "Verifying Balance After Undo Transaction");
error = (List) savingsAccountHelperValidationError.withdrawalFromSavingsAccount(savingsId, "5000",
@@ -729,7 +729,7 @@ public class ClientSavingsIntegrationTest {
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
assertEquals(summaryBefore, summary);
Float balance = Float.valueOf(zeroOpeningBalance);
Float balance = Float.parseFloat(zeroOpeningBalance);
/***
* Perform withdraw transaction, verify account balance(account balance will go to negative as no deposits are
@@ -738,8 +738,8 @@ public class ClientSavingsIntegrationTest {
Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT,
ACTIVATION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
balance -= Float.valueOf(WITHDRAW_AMOUNT);
assertEquals(Float.valueOf(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
balance -= Float.parseFloat(WITHDRAW_AMOUNT);
assertEquals(Float.parseFloat(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
assertEquals(balance, withdrawTransaction.get("runningBalance"), "Verifying Balance after Withdrawal");
/***
@@ -751,8 +751,8 @@ public class ClientSavingsIntegrationTest {
Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, DEPOSIT_AMOUNT,
TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap depositTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, depositTransactionId);
balance += Float.valueOf(DEPOSIT_AMOUNT);
assertEquals(Float.valueOf(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
balance += Float.parseFloat(DEPOSIT_AMOUNT);
assertEquals(Float.parseFloat(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
assertEquals(balance, depositTransaction.get("runningBalance"), "Verifying Balance after Deposit");
/***
@@ -761,13 +761,13 @@ public class ClientSavingsIntegrationTest {
this.savingsAccountHelper.postInterestForSavings(savingsId);
HashMap accountDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountDetails.get("summary");
Float actualInterestPosted = Float.valueOf(summary.get("totalInterestPosted").toString());
Float actualInterestPosted = Float.parseFloat(summary.get("totalInterestPosted").toString());
/***
* Calculate expected interest to be posted, interest should be posted for one day only because deposit
* transaction happened on last day of month before this account balance is negative.
*/
final Float nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
final Float nominalAnnualInterest = Float.parseFloat(accountDetails.get("nominalAnnualInterestRate").toString());
final HashMap interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
final Integer daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
double interestRateInFraction = nominalAnnualInterest / 100;
@@ -780,8 +780,8 @@ public class ClientSavingsIntegrationTest {
*/
DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
actualInterestPosted = Float.valueOf(decimalFormat.format(actualInterestPosted));
interestPosted = Float.parseFloat(decimalFormat.format(interestPosted));
actualInterestPosted = Float.parseFloat(decimalFormat.format(actualInterestPosted));
assertEquals(interestPosted, actualInterestPosted, "Verifying interest posted");
todaysDate = Calendar.getInstance();
@@ -860,7 +860,7 @@ public class ClientSavingsIntegrationTest {
final Integer lastDayOfMonth = todaysDate.getActualMaximum(Calendar.DAY_OF_MONTH);
todaysDate.set(Calendar.DAY_OF_MONTH, lastDayOfMonth);
final String WITHDRAWAL_DATE = dateFormat.format(todaysDate.getTime());
Float balance = Float.valueOf(zeroOpeningBalance);
Float balance = Float.parseFloat(zeroOpeningBalance);
// DateFormat transactionDateFormat = new SimpleDateFormat("dd MMMM
// yyyy",Locale.US);
@@ -877,8 +877,8 @@ public class ClientSavingsIntegrationTest {
Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, DEPOSIT_AMOUNT,
WITHDRAWAL_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap depositTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, depositTransactionId);
balance += Float.valueOf(DEPOSIT_AMOUNT);
assertEquals(Float.valueOf(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
balance += Float.parseFloat(DEPOSIT_AMOUNT);
assertEquals(Float.parseFloat(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
assertEquals(balance, depositTransaction.get("runningBalance"), "Verifying Balance after Deposit");
/***
@@ -888,9 +888,9 @@ public class ClientSavingsIntegrationTest {
this.savingsAccountHelper.postInterestForSavings(savingsId);
HashMap accountDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountDetails.get("summary");
Float accountDetailsPostInterestPosted = Float.valueOf(summary.get("totalInterestPosted").toString());
Float accountDetailsPostInterestPosted = Float.parseFloat(summary.get("totalInterestPosted").toString());
Float nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
Float nominalAnnualInterest = Float.parseFloat(accountDetails.get("nominalAnnualInterestRate").toString());
HashMap interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
Integer daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
double interestRateInFraction = nominalAnnualInterest / 100;
@@ -903,16 +903,16 @@ public class ClientSavingsIntegrationTest {
*/
DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
interestPosted = Float.parseFloat(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.parseFloat(decimalFormat.format(accountDetailsPostInterestPosted));
assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
this.savingsAccountHelper.postInterestAsOnSavings(savingsId, transactionDateValue);
HashMap accountTransactionDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountDetails.get("summary");
Float accountDetailsPostInterest = Float.valueOf(summary.get("totalInterestPosted").toString());
Float accountDetailsPostInterest = Float.parseFloat(summary.get("totalInterestPosted").toString());
nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
nominalAnnualInterest = Float.parseFloat(accountDetails.get("nominalAnnualInterestRate").toString());
interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
interestRateInFraction = nominalAnnualInterest / 100;
@@ -925,8 +925,8 @@ public class ClientSavingsIntegrationTest {
*/
decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
interestPosted = Float.parseFloat(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.parseFloat(decimalFormat.format(accountDetailsPostInterestPosted));
assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("-----Post Interest As on Successfully Worked----------");
@@ -936,9 +936,9 @@ public class ClientSavingsIntegrationTest {
this.savingsAccountHelper.postInterestAsOnSavings(savingsId, transactionDateValue);
accountTransactionDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountDetails.get("summary");
accountDetailsPostInterest = Float.valueOf(summary.get("totalInterestPosted").toString());
accountDetailsPostInterest = Float.parseFloat(summary.get("totalInterestPosted").toString());
nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
nominalAnnualInterest = Float.parseFloat(accountDetails.get("nominalAnnualInterestRate").toString());
interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
interestRateInFraction = nominalAnnualInterest / 100;
@@ -951,8 +951,8 @@ public class ClientSavingsIntegrationTest {
*/
decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
interestPosted = Float.parseFloat(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.parseFloat(decimalFormat.format(accountDetailsPostInterestPosted));
assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("-----Post Interest As on Successfully Worked-------");
@@ -966,9 +966,9 @@ public class ClientSavingsIntegrationTest {
this.savingsAccountHelper.postInterestAsOnSavings(savingsId, transactionDateValue);
accountTransactionDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountTransactionDetails.get("summary");
accountDetailsPostInterest = Float.valueOf(summary.get("totalInterestPosted").toString());
accountDetailsPostInterest = Float.parseFloat(summary.get("totalInterestPosted").toString());
nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
nominalAnnualInterest = Float.parseFloat(accountDetails.get("nominalAnnualInterestRate").toString());
interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
interestRateInFraction = nominalAnnualInterest / 100;
@@ -981,8 +981,8 @@ public class ClientSavingsIntegrationTest {
*/
decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
interestPosted = Float.parseFloat(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.parseFloat(decimalFormat.format(accountDetailsPostInterestPosted));
assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("-----Post Interest As on Successfully Worked----------");
}
@@ -996,9 +996,9 @@ public class ClientSavingsIntegrationTest {
this.savingsAccountHelper.postInterestAsOnSavings(savingsId, transactionDateValue);
accountTransactionDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountTransactionDetails.get("summary");
accountDetailsPostInterest = Float.valueOf(summary.get("totalInterestPosted").toString());
accountDetailsPostInterest = Float.parseFloat(summary.get("totalInterestPosted").toString());
nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
nominalAnnualInterest = Float.parseFloat(accountDetails.get("nominalAnnualInterestRate").toString());
interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
interestRateInFraction = nominalAnnualInterest / 100;
@@ -1011,8 +1011,8 @@ public class ClientSavingsIntegrationTest {
*/
decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
interestPosted = Float.parseFloat(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.parseFloat(decimalFormat.format(accountDetailsPostInterestPosted));
assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("-----Post Interest As on Successfully Worked----------");
@@ -1022,9 +1022,9 @@ public class ClientSavingsIntegrationTest {
this.savingsAccountHelper.postInterestAsOnSavings(savingsId, transactionDateValue);
accountTransactionDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountTransactionDetails.get("summary");
accountDetailsPostInterest = Float.valueOf(summary.get("totalInterestPosted").toString());
accountDetailsPostInterest = Float.parseFloat(summary.get("totalInterestPosted").toString());
nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
nominalAnnualInterest = Float.parseFloat(accountDetails.get("nominalAnnualInterestRate").toString());
interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
interestRateInFraction = nominalAnnualInterest / 100;
@@ -1037,8 +1037,8 @@ public class ClientSavingsIntegrationTest {
*/
decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
interestPosted = Float.parseFloat(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.parseFloat(decimalFormat.format(accountDetailsPostInterestPosted));
assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("-----Post Interest As on Successfully Worked----------");
@@ -1111,7 +1111,7 @@ public class ClientSavingsIntegrationTest {
final Integer lastDayOfMonth = todaysDate.getActualMaximum(Calendar.DAY_OF_MONTH);
todaysDate.set(Calendar.DAY_OF_MONTH, lastDayOfMonth);
final String WITHDRAWAL_DATE = dateFormat.format(todaysDate.getTime());
Float balance = Float.valueOf(zeroOpeningBalance);
Float balance = Float.parseFloat(zeroOpeningBalance);
// DateFormat transactionDateFormat = new SimpleDateFormat("dd MMMM
// yyyy", Locale.US);
@@ -1126,8 +1126,8 @@ public class ClientSavingsIntegrationTest {
Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT,
ACTIVATION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
balance -= Float.valueOf(WITHDRAW_AMOUNT);
assertEquals(Float.valueOf(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
balance -= Float.parseFloat(WITHDRAW_AMOUNT);
assertEquals(Float.parseFloat(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
assertEquals(balance, withdrawTransaction.get("runningBalance"), "Verifying Balance after Withdrawal");
/***
@@ -1139,8 +1139,8 @@ public class ClientSavingsIntegrationTest {
Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, DEPOSIT_AMOUNT,
WITHDRAWAL_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap depositTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, depositTransactionId);
balance += Float.valueOf(DEPOSIT_AMOUNT);
assertEquals(Float.valueOf(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
balance += Float.parseFloat(DEPOSIT_AMOUNT);
assertEquals(Float.parseFloat(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
assertEquals(balance, depositTransaction.get("runningBalance"), "Verifying Balance after Deposit");
/***
@@ -1150,9 +1150,9 @@ public class ClientSavingsIntegrationTest {
this.savingsAccountHelper.postInterestForSavings(savingsId);
HashMap accountDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountDetails.get("summary");
Float accountDetailsPostInterestPosted = Float.valueOf(summary.get("totalInterestPosted").toString());
Float accountDetailsPostInterestPosted = Float.parseFloat(summary.get("totalInterestPosted").toString());
Float nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
Float nominalAnnualInterest = Float.parseFloat(accountDetails.get("nominalAnnualInterestRate").toString());
HashMap interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
Integer daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
double interestRateInFraction = nominalAnnualInterest / 100;
@@ -1165,16 +1165,16 @@ public class ClientSavingsIntegrationTest {
*/
DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
interestPosted = Float.parseFloat(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.parseFloat(decimalFormat.format(accountDetailsPostInterestPosted));
assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
this.savingsAccountHelper.postInterestAsOnSavings(savingsId, transactionDateValue);
HashMap accountTransactionDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountDetails.get("summary");
Float accountDetailsPostInterest = Float.valueOf(summary.get("totalInterestPosted").toString());
Float accountDetailsPostInterest = Float.parseFloat(summary.get("totalInterestPosted").toString());
nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
nominalAnnualInterest = Float.parseFloat(accountDetails.get("nominalAnnualInterestRate").toString());
interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
interestRateInFraction = nominalAnnualInterest / 100;
@@ -1187,8 +1187,8 @@ public class ClientSavingsIntegrationTest {
*/
decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
interestPosted = Float.parseFloat(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.parseFloat(decimalFormat.format(accountDetailsPostInterestPosted));
assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("-----Post Interest As on Successfully Worked----------");
@@ -1198,9 +1198,9 @@ public class ClientSavingsIntegrationTest {
this.savingsAccountHelper.postInterestAsOnSavings(savingsId, transactionDateValue);
accountTransactionDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountDetails.get("summary");
accountDetailsPostInterest = Float.valueOf(summary.get("totalInterestPosted").toString());
accountDetailsPostInterest = Float.parseFloat(summary.get("totalInterestPosted").toString());
nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
nominalAnnualInterest = Float.parseFloat(accountDetails.get("nominalAnnualInterestRate").toString());
interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
interestRateInFraction = nominalAnnualInterest / 100;
@@ -1213,8 +1213,8 @@ public class ClientSavingsIntegrationTest {
*/
decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
interestPosted = Float.parseFloat(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.parseFloat(decimalFormat.format(accountDetailsPostInterestPosted));
assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("-----Post Interest As on Successfully Worked-------");
@@ -1228,9 +1228,9 @@ public class ClientSavingsIntegrationTest {
this.savingsAccountHelper.postInterestAsOnSavings(savingsId, transactionDateValue);
accountTransactionDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountTransactionDetails.get("summary");
accountDetailsPostInterest = Float.valueOf(summary.get("totalInterestPosted").toString());
accountDetailsPostInterest = Float.parseFloat(summary.get("totalInterestPosted").toString());
nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
nominalAnnualInterest = Float.parseFloat(accountDetails.get("nominalAnnualInterestRate").toString());
interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
interestRateInFraction = nominalAnnualInterest / 100;
@@ -1243,8 +1243,8 @@ public class ClientSavingsIntegrationTest {
*/
decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
interestPosted = Float.parseFloat(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.parseFloat(decimalFormat.format(accountDetailsPostInterestPosted));
assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("-----Post Interest As on Successfully Worked----------");
}
@@ -1258,9 +1258,9 @@ public class ClientSavingsIntegrationTest {
this.savingsAccountHelper.postInterestAsOnSavings(savingsId, transactionDateValue);
accountTransactionDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountTransactionDetails.get("summary");
accountDetailsPostInterest = Float.valueOf(summary.get("totalInterestPosted").toString());
accountDetailsPostInterest = Float.parseFloat(summary.get("totalInterestPosted").toString());
nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
nominalAnnualInterest = Float.parseFloat(accountDetails.get("nominalAnnualInterestRate").toString());
interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
interestRateInFraction = nominalAnnualInterest / 100;
@@ -1273,8 +1273,8 @@ public class ClientSavingsIntegrationTest {
*/
decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
interestPosted = Float.parseFloat(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.parseFloat(decimalFormat.format(accountDetailsPostInterestPosted));
assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("-----Post Interest As on Successfully Worked----------");
@@ -1284,9 +1284,9 @@ public class ClientSavingsIntegrationTest {
this.savingsAccountHelper.postInterestAsOnSavings(savingsId, transactionDateValue);
accountTransactionDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountTransactionDetails.get("summary");
accountDetailsPostInterest = Float.valueOf(summary.get("totalInterestPosted").toString());
accountDetailsPostInterest = Float.parseFloat(summary.get("totalInterestPosted").toString());
nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
nominalAnnualInterest = Float.parseFloat(accountDetails.get("nominalAnnualInterestRate").toString());
interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
interestRateInFraction = nominalAnnualInterest / 100;
@@ -1299,8 +1299,8 @@ public class ClientSavingsIntegrationTest {
*/
decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
interestPosted = Float.parseFloat(decimalFormat.format(interestPosted));
accountDetailsPostInterestPosted = Float.parseFloat(decimalFormat.format(accountDetailsPostInterestPosted));
assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("-----Post Interest As on Successfully Worked----------");
}
@@ -1379,7 +1379,7 @@ public class ClientSavingsIntegrationTest {
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
assertEquals(summaryBefore, summary);
Float balance = Float.valueOf(zeroOpeningBalance);
Float balance = Float.parseFloat(zeroOpeningBalance);
/***
* Perform withdraw transaction, verify account balance(account balance will go to negative as no deposits are
@@ -1388,8 +1388,8 @@ public class ClientSavingsIntegrationTest {
Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT,
ACTIVATION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
balance -= Float.valueOf(WITHDRAW_AMOUNT);
assertEquals(Float.valueOf(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
balance -= Float.parseFloat(WITHDRAW_AMOUNT);
assertEquals(Float.parseFloat(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
assertEquals(balance, withdrawTransaction.get("runningBalance"), "Verifying Balance after Withdrawal");
/***
@@ -1401,8 +1401,8 @@ public class ClientSavingsIntegrationTest {
Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, DEPOSIT_AMOUNT,
TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap depositTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, depositTransactionId);
balance += Float.valueOf(DEPOSIT_AMOUNT);
assertEquals(Float.valueOf(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
balance += Float.parseFloat(DEPOSIT_AMOUNT);
assertEquals(Float.parseFloat(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
assertEquals(balance, depositTransaction.get("runningBalance"), "Verifying Balance after Deposit");
/***
@@ -1411,7 +1411,7 @@ public class ClientSavingsIntegrationTest {
this.savingsAccountHelper.postInterestForSavings(savingsId);
HashMap accountDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountDetails.get("summary");
Float actualInterestPosted = Float.valueOf(summary.get("totalInterestPosted").toString());
Float actualInterestPosted = Float.parseFloat(summary.get("totalInterestPosted").toString());
/***
* Calculate expected interest to be posted, interest should be posted for one day only because deposit
@@ -1421,13 +1421,13 @@ public class ClientSavingsIntegrationTest {
HashMap accountDetailsPostInterest = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountDetails.get("summary");
ArrayList interestPostingTransaction = (ArrayList) ((HashMap) ((ArrayList) accountDetails.get("transactions")).get(0)).get("date");
Float accountDetailsPostInterestPosted = Float.valueOf(summary.get("totalInterestPosted").toString());
Float accountDetailsPostInterestPosted = Float.parseFloat(summary.get("totalInterestPosted").toString());
/***
* Calculate expected interest to be posted, interest should be posted for one day only because deposit
* transaction happened on last day of month before this account balance is negative.
*/
final Float nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
final Float nominalAnnualInterest = Float.parseFloat(accountDetails.get("nominalAnnualInterestRate").toString());
final HashMap interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
final Integer daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
double interestRateInFraction = nominalAnnualInterest / 100;
@@ -1440,9 +1440,9 @@ public class ClientSavingsIntegrationTest {
*/
DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
interestPosted = Float.parseFloat(decimalFormat.format(interestPosted));
// actualInterestPosted =
// Float.valueOf(decimalFormat.format(accountDetailsPostInterestPosted));
// Float.parseFloat(decimalFormat.format(accountDetailsPostInterestPosted));
assertEquals(interestPosted, accountDetailsPostInterestPosted, "Verifying interest posted");
LOG.info("------Post Interest As On After doing a post interest Successfully worked--------");
@@ -1552,7 +1552,7 @@ public class ClientSavingsIntegrationTest {
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
assertEquals(summaryBefore, summary);
Float balance = Float.valueOf(zeroOpeningBalance);
Float balance = Float.parseFloat(zeroOpeningBalance);
/***
* Perform withdraw transaction, verify account balance(account balance will go to negative as no deposits are
@@ -1561,8 +1561,8 @@ public class ClientSavingsIntegrationTest {
Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT,
ACTIVATION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
balance -= Float.valueOf(WITHDRAW_AMOUNT);
assertEquals(Float.valueOf(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
balance -= Float.parseFloat(WITHDRAW_AMOUNT);
assertEquals(Float.parseFloat(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
assertEquals(balance, withdrawTransaction.get("runningBalance"), "Verifying Balance after Withdrawal");
/***
@@ -1574,8 +1574,8 @@ public class ClientSavingsIntegrationTest {
Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, DEPOSIT_AMOUNT,
TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap depositTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, depositTransactionId);
balance += Float.valueOf(DEPOSIT_AMOUNT);
assertEquals(Float.valueOf(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
balance += Float.parseFloat(DEPOSIT_AMOUNT);
assertEquals(Float.parseFloat(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
assertEquals(balance, depositTransaction.get("runningBalance"), "Verifying Balance after Deposit");
/***
@@ -1584,13 +1584,13 @@ public class ClientSavingsIntegrationTest {
this.savingsAccountHelper.postInterestAsOnSavings(savingsId, POSTED_TRANSACTION_DATE);
HashMap accountDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountDetails.get("summary");
Float actualInterestPosted = Float.valueOf(summary.get("totalInterestPosted").toString());
Float actualInterestPosted = Float.parseFloat(summary.get("totalInterestPosted").toString());
/***
* Calculate expected interest to be posted, interest should be posted for one day only because deposit
* transaction happened on last day of month before this account balance is negative.
*/
final Float nominalAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
final Float nominalAnnualInterest = Float.parseFloat(accountDetails.get("nominalAnnualInterestRate").toString());
final HashMap interestCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
final Integer daysInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
double interestRateInFraction = nominalAnnualInterest / 100;
@@ -1603,17 +1603,17 @@ public class ClientSavingsIntegrationTest {
*/
DecimalFormat decimalFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalFormat.applyPattern("#.###");
interestPosted = Float.valueOf(decimalFormat.format(interestPosted));
actualInterestPosted = Float.valueOf(decimalFormat.format(actualInterestPosted));
interestPosted = Float.parseFloat(decimalFormat.format(interestPosted));
actualInterestPosted = Float.parseFloat(decimalFormat.format(actualInterestPosted));
assertEquals(interestPosted, actualInterestPosted, "Verifying interest posted");
LOG.info("------Post Interest As On Successful Worked--------");
this.savingsAccountHelper.postInterestAsOnSavings(savingsId, POSTED_LAST_TRANSACTION_DATE);
HashMap accountLastDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
summary = (HashMap) accountLastDetails.get("summary");
Float actualLastInterestPosted = Float.valueOf(summary.get("totalInterestPosted").toString());
Float actualLastInterestPosted = Float.parseFloat(summary.get("totalInterestPosted").toString());
final Float nominalLastAnnualInterest = Float.valueOf(accountDetails.get("nominalAnnualInterestRate").toString());
final Float nominalLastAnnualInterest = Float.parseFloat(accountDetails.get("nominalAnnualInterestRate").toString());
final HashMap interestLastCalculationDaysInYearType = (HashMap) accountDetails.get("interestCalculationDaysInYearType");
final Integer daysLastInYear = Integer.valueOf(interestCalculationDaysInYearType.get("id").toString());
double interestLastRateInFraction = nominalAnnualInterest / 100;
@@ -1623,8 +1623,8 @@ public class ClientSavingsIntegrationTest {
DecimalFormat decimalLastFormat = new DecimalFormat("", new DecimalFormatSymbols(Locale.US));
decimalLastFormat.applyPattern("#.###");
interestLastPosted = Float.valueOf(decimalLastFormat.format(interestLastPosted));
actualInterestPosted = Float.valueOf(decimalFormat.format(actualInterestPosted));
interestLastPosted = Float.parseFloat(decimalLastFormat.format(interestLastPosted));
actualInterestPosted = Float.parseFloat(decimalFormat.format(actualInterestPosted));
assertEquals(interestLastPosted, actualInterestPosted, "Verifying interest posted");
LOG.info("------Post Interest As On Successful Worked--------");
@@ -1924,7 +1924,7 @@ public class ClientSavingsIntegrationTest {
* private void verifySavingsInterest(final Object savingsInterest) { LOG.info(
* "--------------------VERIFYING THE BALANCE, INTEREST --------------------------" );
*
* assertEquals("Verifying Interest Calculation", Float.valueOf("238.3399"), savingsInterest); }
* assertEquals("Verifying Interest Calculation", Float.parseFloat("238.3399"), savingsInterest); }
*/
@SuppressWarnings("unchecked")
@@ -1957,7 +1957,7 @@ public class ClientSavingsIntegrationTest {
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
Float balance = Float.valueOf(MINIMUM_OPENING_BALANCE);
Float balance = Float.parseFloat(MINIMUM_OPENING_BALANCE);
savingsStatusHashMap = this.savingsAccountHelper.blockSavings(savingsId);
SavingsStatusChecker.verifySavingsSubStatusblock(savingsStatusHashMap);
@@ -1977,8 +1977,8 @@ public class ClientSavingsIntegrationTest {
Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, DEPOSIT_AMOUNT,
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap depositTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, depositTransactionId);
balance += Float.valueOf(DEPOSIT_AMOUNT);
assertEquals(Float.valueOf(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
balance += Float.parseFloat(DEPOSIT_AMOUNT);
assertEquals(Float.parseFloat(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
savingsStatusHashMap = this.savingsAccountHelper.blockDebit(savingsId);
SavingsStatusChecker.verifySavingsSubStatusIsDebitBlocked(savingsStatusHashMap);
@@ -1990,16 +1990,16 @@ public class ClientSavingsIntegrationTest {
depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, DEPOSIT_AMOUNT,
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
depositTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, depositTransactionId);
balance += Float.valueOf(DEPOSIT_AMOUNT);
assertEquals(Float.valueOf(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
balance += Float.parseFloat(DEPOSIT_AMOUNT);
assertEquals(Float.parseFloat(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
savingsStatusHashMap = this.savingsAccountHelper.unblockDebit(savingsId);
SavingsStatusChecker.verifySavingsSubStatusIsNone(savingsStatusHashMap);
Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT,
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
balance -= Float.valueOf(WITHDRAW_AMOUNT);
assertEquals(Float.valueOf(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
balance -= Float.parseFloat(WITHDRAW_AMOUNT);
assertEquals(Float.parseFloat(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
savingsStatusHashMap = this.savingsAccountHelper.blockCredit(savingsId);
SavingsStatusChecker.verifySavingsSubStatusIsCreditBlocked(savingsStatusHashMap);
@@ -2011,16 +2011,16 @@ public class ClientSavingsIntegrationTest {
withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT,
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
balance -= Float.valueOf(WITHDRAW_AMOUNT);
assertEquals(Float.valueOf(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
balance -= Float.parseFloat(WITHDRAW_AMOUNT);
assertEquals(Float.parseFloat(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
savingsStatusHashMap = this.savingsAccountHelper.unblockCredit(savingsId);
SavingsStatusChecker.verifySavingsSubStatusIsNone(savingsStatusHashMap);
depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, DEPOSIT_AMOUNT,
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
depositTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, depositTransactionId);
balance += Float.valueOf(DEPOSIT_AMOUNT);
assertEquals(Float.valueOf(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
balance += Float.parseFloat(DEPOSIT_AMOUNT);
assertEquals(Float.parseFloat(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
Integer holdTransactionId = (Integer) this.savingsAccountHelper.holdAmountInSavingsAccount(savingsId, String.valueOf(balance - 100),
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
@@ -2037,8 +2037,8 @@ public class ClientSavingsIntegrationTest {
withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, "300", todayDate,
CommonConstants.RESPONSE_RESOURCE_ID);
withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
balance -= Float.valueOf("300");
assertEquals(Float.valueOf("300"), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
balance -= Float.parseFloat("300");
assertEquals(Float.parseFloat("300"), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
}
@@ -2102,7 +2102,7 @@ public class ClientSavingsIntegrationTest {
HashMap summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
Float balance = Float.valueOf("-300");
Float balance = Float.parseFloat("-300");
assertEquals(balance, summary.get("accountBalance"), "Verifying opening Balance is -300");
@@ -584,21 +584,21 @@ public class GroupSavingsIntegrationTest {
Integer depositTransactionId = (Integer) this.savingsAccountHelper.depositToSavingsAccount(savingsId, DEPOSIT_AMOUNT,
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap depositTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, depositTransactionId);
balance += Float.valueOf(DEPOSIT_AMOUNT);
balance += Float.parseFloat(DEPOSIT_AMOUNT);
assertEquals(Float.valueOf(DEPOSIT_AMOUNT), depositTransaction.get("amount"), "Verifying Deposit Amount");
assertEquals(balance, depositTransaction.get("runningBalance"), "Verifying Balance after Deposit");
Integer withdrawTransactionId = (Integer) this.savingsAccountHelper.withdrawalFromSavingsAccount(savingsId, WITHDRAW_AMOUNT,
SavingsAccountHelper.TRANSACTION_DATE, CommonConstants.RESPONSE_RESOURCE_ID);
HashMap withdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
balance -= Float.valueOf(WITHDRAW_AMOUNT);
balance -= Float.parseFloat(WITHDRAW_AMOUNT);
assertEquals(Float.valueOf(WITHDRAW_AMOUNT), withdrawTransaction.get("amount"), "Verifying Withdrawal Amount");
assertEquals(balance, withdrawTransaction.get("runningBalance"), "Verifying Balance after Withdrawal");
Integer newWithdrawTransactionId = this.savingsAccountHelper.updateSavingsAccountTransaction(savingsId, withdrawTransactionId,
WITHDRAW_AMOUNT_ADJUSTED);
HashMap newWithdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, newWithdrawTransactionId);
balance = balance + Float.valueOf(WITHDRAW_AMOUNT) - Float.valueOf(WITHDRAW_AMOUNT_ADJUSTED);
balance = balance + Float.parseFloat(WITHDRAW_AMOUNT) - Float.parseFloat(WITHDRAW_AMOUNT_ADJUSTED);
assertEquals(Float.valueOf(WITHDRAW_AMOUNT_ADJUSTED), newWithdrawTransaction.get("amount"), "Verifying adjusted Amount");
assertEquals(balance, newWithdrawTransaction.get("runningBalance"), "Verifying Balance after adjust");
summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
@@ -610,7 +610,7 @@ public class GroupSavingsIntegrationTest {
newWithdrawTransaction = this.savingsAccountHelper.getSavingsTransaction(savingsId, withdrawTransactionId);
Assertions.assertTrue((Boolean) newWithdrawTransaction.get("reversed"));
summary = this.savingsAccountHelper.getSavingsSummary(savingsId);
balance += Float.valueOf(WITHDRAW_AMOUNT_ADJUSTED);
balance += Float.parseFloat(WITHDRAW_AMOUNT_ADJUSTED);
assertEquals(balance, summary.get("accountBalance"), "Verifying Balance After Undo Transaction");
error = (List) savingsAccountHelperValidationError.withdrawalFromSavingsAccount(savingsId, "5000",
@@ -210,21 +210,20 @@ public class LoanDisbursementDetailsIntegrationTest {
assertEquals(period.get("dueDate").toString(), expectedRepaymentSchedule.getDueDate());
assertEquals(period.get("principalLoanBalanceOutstanding"), expectedRepaymentSchedule.getPrincipalLoanBalanceOutstanding());
LOG.info("{}", period.get("totalOriginalDueForPeriod").toString());
assertEquals(Float.valueOf(period.get("totalOriginalDueForPeriod").toString()),
assertEquals(Float.parseFloat(period.get("totalOriginalDueForPeriod").toString()),
expectedRepaymentSchedule.getTotalOriginalDueForPeriod().floatValue(), 0.0f);
assertEquals(Float.valueOf(period.get("totalOutstandingForPeriod").toString()).floatValue(),
assertEquals(Float.parseFloat(period.get("totalOutstandingForPeriod").toString()),
expectedRepaymentSchedule.getTotalOutstandingForPeriod(), 0.0f);
if (position != 0 && position != 3) {
assertEquals(Float.valueOf(period.get("interestOutstanding").toString()).floatValue(),
expectedRepaymentSchedule.getInterestOutstanding(), 0.0f);
assertEquals(Float.valueOf(period.get("principalOutstanding").toString()).floatValue(),
expectedRepaymentSchedule.getPrincipalOutstanding(), 0.0f);
assertEquals(Float.valueOf(period.get("principalDue").toString()).floatValue(), expectedRepaymentSchedule.getPrincipalDue(),
assertEquals(Float.parseFloat(period.get("interestOutstanding").toString()), expectedRepaymentSchedule.getInterestOutstanding(),
0.0f);
assertEquals(Float.valueOf(period.get("principalOriginalDue").toString()).floatValue(),
assertEquals(Float.parseFloat(period.get("principalOutstanding").toString()),
expectedRepaymentSchedule.getPrincipalOutstanding(), 0.0f);
assertEquals(Float.parseFloat(period.get("principalDue").toString()), expectedRepaymentSchedule.getPrincipalDue(), 0.0f);
assertEquals(Float.parseFloat(period.get("principalOriginalDue").toString()),
expectedRepaymentSchedule.getPrincipalOriginalDue(), 0.0f);
assertEquals(period.get("fromDate").toString(), expectedRepaymentSchedule.getFromDate());
}
@@ -416,7 +415,7 @@ public class LoanDisbursementDetailsIntegrationTest {
/* Validate Edit */
ArrayList<HashMap> disbursementDetails = (ArrayList<HashMap>) this.loanTransactionHelper.getLoanDetail(this.requestSpec,
this.responseSpec, this.loanID, "disbursementDetails");
assertEquals(Float.valueOf(updatedPrincipal), disbursementDetails.get(0).get("principal"));
assertEquals(Float.parseFloat(updatedPrincipal), disbursementDetails.get(0).get("principal"));
ArrayList expectedDisbursementDate = (ArrayList) disbursementDetails.get(0).get("expectedDisbursementDate");
String date = formatExpectedDisbursementDate(expectedDisbursementDate.toString());
assertEquals(updatedExpectedDisbursementDate, date);
@@ -83,7 +83,7 @@ public class SchedulerJobsTestResults {
public static final String ACCOUNT_TYPE_INDIVIDUAL = "INDIVIDUAL";
public static final String MINIMUM_OPENING_BALANCE = "1000";
static Float SP_BALANCE = Float.valueOf(MINIMUM_OPENING_BALANCE);
static Float SP_BALANCE = Float.parseFloat(MINIMUM_OPENING_BALANCE);
private static ResponseSpecification responseSpec;
private static RequestSpecification requestSpec;
@@ -850,7 +850,7 @@ public class SchedulerJobsTestResults {
Integer clientId = ClientHelper.createClient(requestSpec, responseSpec);
Assertions.assertNotNull(clientId);
Float balance = Float.valueOf(MINIMUM_OPENING_BALANCE) + Float.valueOf(FixedDepositAccountHelper.DEPOSIT_AMOUNT);
Float balance = Float.parseFloat(MINIMUM_OPENING_BALANCE) + Float.parseFloat(FixedDepositAccountHelper.DEPOSIT_AMOUNT);
final Integer savingsProductID = createSavingsProduct(requestSpec, responseSpec, String.valueOf(balance));
Assertions.assertNotNull(savingsProductID);
@@ -886,22 +886,23 @@ public class SchedulerJobsTestResults {
fixedDepositAccountStatusHashMap = fixedDepositAccountHelper.activateFixedDeposit(fixedDepositAccountId, ACTIVATION_DATE);
FixedDepositAccountStatusChecker.verifyFixedDepositIsActive(fixedDepositAccountStatusHashMap);
summary = savingsAccountHelper.getSavingsSummary(savingsId);
balance = Float.valueOf(MINIMUM_OPENING_BALANCE);
balance = Float.parseFloat(MINIMUM_OPENING_BALANCE);
assertEquals(balance, summary.get("accountBalance"), "Verifying Balance");
fixedDepositAccountHelper.postInterestForFixedDeposit(fixedDepositAccountId);
HashMap fixedDepositSummary = savingsAccountHelper.getSavingsSummary(fixedDepositAccountId);
Float interestPosted = (Float) fixedDepositSummary.get("accountBalance") - Float.valueOf(FixedDepositAccountHelper.DEPOSIT_AMOUNT);
Float interestPosted = (Float) fixedDepositSummary.get("accountBalance")
- Float.parseFloat(FixedDepositAccountHelper.DEPOSIT_AMOUNT);
String JobName = "Transfer Interest To Savings";
this.schedulerJobHelper.executeAndAwaitJob(JobName);
fixedDepositSummary = savingsAccountHelper.getSavingsSummary(fixedDepositAccountId);
assertEquals(Float.valueOf(FixedDepositAccountHelper.DEPOSIT_AMOUNT), fixedDepositSummary.get("accountBalance"),
assertEquals(Float.parseFloat(FixedDepositAccountHelper.DEPOSIT_AMOUNT), fixedDepositSummary.get("accountBalance"),
"Verifying opening Balance");
summary = savingsAccountHelper.getSavingsSummary(savingsId);
balance = Float.valueOf(MINIMUM_OPENING_BALANCE) + interestPosted;
balance = Float.parseFloat(MINIMUM_OPENING_BALANCE) + interestPosted;
validateNumberForEqualExcludePrecission(String.valueOf(balance), String.valueOf(summary.get("accountBalance")));
}
@@ -994,7 +995,7 @@ public class SchedulerJobsTestResults {
private void validateNumberForEqualExcludePrecission(String val, String val2) {
DecimalFormat twoDForm = new DecimalFormat("#", new DecimalFormatSymbols(Locale.US));
Assertions.assertTrue(
Float.valueOf(twoDForm.format(Float.valueOf(val))).compareTo(Float.valueOf(twoDForm.format(Float.valueOf(val2)))) == 0);
Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.parseFloat(val)))
.compareTo(Float.valueOf(twoDForm.format(Float.parseFloat(val2)))) == 0);
}
}