diff --git a/build.gradle b/build.gradle index d56dde4e6..6dce5b6ee 100644 --- a/build.gradle +++ b/build.gradle @@ -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 { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/DataValidatorBuilder.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/DataValidatorBuilder.java index 5401508dd..2b3e0260c 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/DataValidatorBuilder.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/data/DataValidatorBuilder.java @@ -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"); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java index 1e3032719..4a43db0c9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java @@ -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; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultPaymentPeriodsInOneYearCalculator.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultPaymentPeriodsInOneYearCalculator.java index a1f7fe4c5..0af3bf6c7 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultPaymentPeriodsInOneYearCalculator.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/DefaultPaymentPeriodsInOneYearCalculator.java @@ -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"); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java index 0415ee107..80d8ffa20 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java @@ -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) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductMinMaxConstraints.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductMinMaxConstraints.java index de4c3567c..60f0515d4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductMinMaxConstraints.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductMinMaxConstraints.java @@ -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() { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductRelatedDetail.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductRelatedDetail.java index 28146174f..3a3dd8c57 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductRelatedDetail.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/domain/LoanProductRelatedDetail.java @@ -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 diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/service/TaxUtils.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/service/TaxUtils.java index 7ccb0418c..fcc8242c3 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/service/TaxUtils.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/tax/service/TaxUtils.java @@ -39,7 +39,7 @@ public final class TaxUtils { Map 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(); diff --git a/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/LoanProductRelatedDetailTestHelper.java b/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/LoanProductRelatedDetailTestHelper.java index 6341321c4..962a29232 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/LoanProductRelatedDetailTestHelper.java +++ b/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/LoanProductRelatedDetailTestHelper.java @@ -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; diff --git a/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/MoneyBuilder.java b/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/MoneyBuilder.java index f1637d372..37af782b8 100644 --- a/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/MoneyBuilder.java +++ b/fineract-provider/src/test/java/org/apache/fineract/portfolio/loanaccount/MoneyBuilder.java @@ -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; } } diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/AccountTransferTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/AccountTransferTest.java index 481f517ca..8d7ef09af 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/AccountTransferTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/AccountTransferTest.java @@ -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); diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/AccountingScenarioIntegrationTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/AccountingScenarioIntegrationTest.java index 841eb5d38..a66e491c5 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/AccountingScenarioIntegrationTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/AccountingScenarioIntegrationTest.java @@ -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); diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java index a952540d1..2ffdf1e36 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java @@ -727,7 +727,7 @@ public class ClientLoanIntegrationTest { LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); HashMap summary = 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"); // DISBURSE @@ -736,7 +736,7 @@ public class ClientLoanIntegrationTest { LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); summary = savingsAccountHelper.getSavingsSummary(savingsId); - balance = Float.valueOf(MINIMUM_OPENING_BALANCE) + Float.valueOf("12000"); + balance = Float.parseFloat(MINIMUM_OPENING_BALANCE) + Float.parseFloat("12000"); assertEquals(balance, summary.get("accountBalance"), "Verifying opening Balance"); loanStatusHashMap = this.loanTransactionHelper.undoDisbursal(loanID); @@ -744,7 +744,7 @@ public class ClientLoanIntegrationTest { LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); summary = savingsAccountHelper.getSavingsSummary(savingsId); - balance = Float.valueOf(MINIMUM_OPENING_BALANCE); + balance = Float.parseFloat(MINIMUM_OPENING_BALANCE); assertEquals(balance, summary.get("accountBalance"), "Verifying opening Balance"); } @@ -816,7 +816,7 @@ public class ClientLoanIntegrationTest { LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); HashMap summary = 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"); // DISBURSE first Tranche @@ -825,7 +825,7 @@ public class ClientLoanIntegrationTest { LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); summary = savingsAccountHelper.getSavingsSummary(savingsId); - balance = Float.valueOf(MINIMUM_OPENING_BALANCE) + Float.valueOf("25000"); + balance = Float.parseFloat(MINIMUM_OPENING_BALANCE) + Float.parseFloat("25000"); assertEquals(balance, summary.get("accountBalance"), "Verifying opening Balance"); // DISBURSE Second Tranche @@ -834,7 +834,7 @@ public class ClientLoanIntegrationTest { LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); summary = savingsAccountHelper.getSavingsSummary(savingsId); - balance = Float.valueOf(MINIMUM_OPENING_BALANCE) + Float.valueOf("25000") + Float.valueOf("20000"); + balance = Float.parseFloat(MINIMUM_OPENING_BALANCE) + Float.parseFloat("25000") + Float.parseFloat("20000"); assertEquals(balance, summary.get("accountBalance"), "Verifying opening Balance"); loanStatusHashMap = this.loanTransactionHelper.undoDisbursal(loanID); @@ -842,7 +842,7 @@ public class ClientLoanIntegrationTest { LoanStatusChecker.verifyLoanIsWaitingForDisbursal(loanStatusHashMap); summary = savingsAccountHelper.getSavingsSummary(savingsId); - balance = Float.valueOf(MINIMUM_OPENING_BALANCE); + balance = Float.parseFloat(MINIMUM_OPENING_BALANCE); assertEquals(balance, summary.get("accountBalance"), "Verifying opening Balance"); } @@ -862,13 +862,13 @@ public class ClientLoanIntegrationTest { DecimalFormat twoDForm = new DecimalFormat("#"); HashMap chargeDetail = getloanCharge(amountPercentage, loanCharges); Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(amount))) - .compareTo(Float.valueOf(twoDForm.format(Float.valueOf(String.valueOf(chargeDetail.get("amountOrPercentage")))))) == 0); + .compareTo(Float.parseFloat(twoDForm.format(Float.valueOf(String.valueOf(chargeDetail.get("amountOrPercentage")))))) == 0); Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(outstanding))) - .compareTo(Float.valueOf(twoDForm.format(Float.valueOf(String.valueOf(chargeDetail.get("amountOutstanding")))))) == 0); - Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(amountPaid))) - .compareTo(Float.valueOf(twoDForm.format(Float.valueOf(String.valueOf(chargeDetail.get("amountPaid")))))) == 0); - Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.valueOf(amountWaived))) - .compareTo(Float.valueOf(twoDForm.format(Float.valueOf(String.valueOf(chargeDetail.get("amountWaived")))))) == 0); + .compareTo(Float.valueOf(twoDForm.format(Float.parseFloat(String.valueOf(chargeDetail.get("amountOutstanding")))))) == 0); + Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.parseFloat(amountPaid))) + .compareTo(Float.valueOf(twoDForm.format(Float.parseFloat(String.valueOf(chargeDetail.get("amountPaid")))))) == 0); + Assertions.assertTrue(Float.valueOf(twoDForm.format(Float.parseFloat(amountWaived))) + .compareTo(Float.valueOf(twoDForm.format(Float.parseFloat(String.valueOf(chargeDetail.get("amountWaived")))))) == 0); } private void validateNumberForEqual(String val, String val2) { @@ -1071,69 +1071,73 @@ public class ClientLoanIntegrationTest { assertEquals(new ArrayList<>(Arrays.asList(2011, 10, 20)), loanSchedule.get(1).get("dueDate"), "Checking for Due Date for 1st Month"); - assertEquals(Float.valueOf("2911.49"), loanSchedule.get(1).get("principalOriginalDue"), "Checking for Principal Due for 1st Month"); - assertEquals(Float.valueOf("240.00"), loanSchedule.get(1).get("interestOriginalDue"), "Checking for Interest Due for 1st Month"); + assertEquals(Float.parseFloat("2911.49"), loanSchedule.get(1).get("principalOriginalDue"), + "Checking for Principal Due for 1st Month"); + assertEquals(Float.parseFloat("240.00"), loanSchedule.get(1).get("interestOriginalDue"), "Checking for Interest Due for 1st Month"); assertEquals(new ArrayList<>(Arrays.asList(2011, 11, 20)), loanSchedule.get(2).get("dueDate"), "Checking for Due Date for 2nd Month"); - assertEquals(Float.valueOf("2969.72"), loanSchedule.get(2).get("principalDue"), "Checking for Principal Due for 2nd Month"); - assertEquals(Float.valueOf("181.77"), loanSchedule.get(2).get("interestOriginalDue"), "Checking for Interest Due for 2nd Month"); + assertEquals(Float.parseFloat("2969.72"), loanSchedule.get(2).get("principalDue"), "Checking for Principal Due for 2nd Month"); + assertEquals(Float.parseFloat("181.77"), loanSchedule.get(2).get("interestOriginalDue"), "Checking for Interest Due for 2nd Month"); assertEquals(new ArrayList<>(Arrays.asList(2011, 12, 20)), loanSchedule.get(3).get("dueDate"), "Checking for Due Date for 3rd Month"); - assertEquals(Float.valueOf("3029.11"), loanSchedule.get(3).get("principalDue"), "Checking for Principal Due for 3rd Month"); - assertEquals(Float.valueOf("122.38"), loanSchedule.get(3).get("interestOriginalDue"), "Checking for Interest Due for 3rd Month"); + assertEquals(Float.parseFloat("3029.11"), loanSchedule.get(3).get("principalDue"), "Checking for Principal Due for 3rd Month"); + assertEquals(Float.parseFloat("122.38"), loanSchedule.get(3).get("interestOriginalDue"), "Checking for Interest Due for 3rd Month"); assertEquals(new ArrayList<>(Arrays.asList(2012, 1, 20)), loanSchedule.get(4).get("dueDate"), "Checking for Due Date for 4th Month"); - assertEquals(Float.valueOf("3089.68"), loanSchedule.get(4).get("principalDue"), "Checking for Principal Due for 4th Month"); - assertEquals(Float.valueOf("61.79"), loanSchedule.get(4).get("interestOriginalDue"), "Checking for Interest Due for 4th Month"); + assertEquals(Float.parseFloat("3089.68"), loanSchedule.get(4).get("principalDue"), "Checking for Principal Due for 4th Month"); + assertEquals(Float.parseFloat("61.79"), loanSchedule.get(4).get("interestOriginalDue"), "Checking for Interest Due for 4th Month"); } private void verifyLoanRepaymentScheduleForEqualPrincipal(final ArrayList loanSchedule) { LOG.info("--------------------VERIFYING THE PRINCIPAL DUES,INTEREST DUE AND DUE DATE--------------------------"); assertEquals(new ArrayList<>(Arrays.asList(2014, 7, 2)), loanSchedule.get(1).get("dueDate"), "Checking for Due Date for 1st Month"); - assertEquals(Float.valueOf("416700"), loanSchedule.get(1).get("principalOriginalDue"), "Checking for Principal Due for 1st Month"); - assertEquals(Float.valueOf("200000"), loanSchedule.get(1).get("interestOriginalDue"), "Checking for Interest Due for 1st Month"); + assertEquals(Float.parseFloat("416700"), loanSchedule.get(1).get("principalOriginalDue"), + "Checking for Principal Due for 1st Month"); + assertEquals(Float.parseFloat("200000"), loanSchedule.get(1).get("interestOriginalDue"), "Checking for Interest Due for 1st Month"); assertEquals(new ArrayList<>(Arrays.asList(2014, 8, 2)), loanSchedule.get(2).get("dueDate"), "Checking for Due Date for 2nd Month"); - assertEquals(Float.valueOf("416700"), loanSchedule.get(2).get("principalDue"), "Checking for Principal Due for 2nd Month"); - assertEquals(Float.valueOf("191700"), loanSchedule.get(2).get("interestOriginalDue"), "Checking for Interest Due for 2nd Month"); + assertEquals(Float.parseFloat("416700"), loanSchedule.get(2).get("principalDue"), "Checking for Principal Due for 2nd Month"); + assertEquals(Float.parseFloat("191700"), loanSchedule.get(2).get("interestOriginalDue"), "Checking for Interest Due for 2nd Month"); assertEquals(new ArrayList<>(Arrays.asList(2014, 9, 2)), loanSchedule.get(3).get("dueDate"), "Checking for Due Date for 3rd Month"); - assertEquals(Float.valueOf("416700"), loanSchedule.get(3).get("principalDue"), "Checking for Principal Due for 3rd Month"); - assertEquals(Float.valueOf("183300"), loanSchedule.get(3).get("interestOriginalDue"), "Checking for Interest Due for 3rd Month"); + assertEquals(Float.parseFloat("416700"), loanSchedule.get(3).get("principalDue"), "Checking for Principal Due for 3rd Month"); + assertEquals(Float.parseFloat("183300"), loanSchedule.get(3).get("interestOriginalDue"), "Checking for Interest Due for 3rd Month"); assertEquals(new ArrayList<>(Arrays.asList(2014, 10, 2)), loanSchedule.get(4).get("dueDate"), "Checking for Due Date for 4th Month"); - assertEquals(Float.valueOf("416700"), loanSchedule.get(4).get("principalDue"), "Checking for Principal Due for 4th Month"); - assertEquals(Float.valueOf("175000"), loanSchedule.get(4).get("interestOriginalDue"), "Checking for Interest Due for 4th Month"); + assertEquals(Float.parseFloat("416700"), loanSchedule.get(4).get("principalDue"), "Checking for Principal Due for 4th Month"); + assertEquals(Float.parseFloat("175000"), loanSchedule.get(4).get("interestOriginalDue"), "Checking for Interest Due for 4th Month"); assertEquals(new ArrayList<>(Arrays.asList(2014, 11, 2)), loanSchedule.get(5).get("dueDate"), "Checking for Due Date for 5th Month"); - assertEquals(Float.valueOf("416700"), loanSchedule.get(5).get("principalDue"), "Checking for Principal Due for 5th Month"); - assertEquals(Float.valueOf("166700"), loanSchedule.get(5).get("interestOriginalDue"), "Checking for Interest Due for 5th Month"); + assertEquals(Float.parseFloat("416700"), loanSchedule.get(5).get("principalDue"), "Checking for Principal Due for 5th Month"); + assertEquals(Float.parseFloat("166700"), loanSchedule.get(5).get("interestOriginalDue"), "Checking for Interest Due for 5th Month"); assertEquals(new ArrayList<>(Arrays.asList(2014, 12, 2)), loanSchedule.get(6).get("dueDate"), "Checking for Due Date for 6th Month"); - assertEquals(Float.valueOf("416700"), loanSchedule.get(6).get("principalDue"), "Checking for Principal Due for 6th Month"); - assertEquals(Float.valueOf("158300"), loanSchedule.get(6).get("interestOriginalDue"), "Checking for Interest Due for 6th Month"); + assertEquals(Float.parseFloat("416700"), loanSchedule.get(6).get("principalDue"), "Checking for Principal Due for 6th Month"); + assertEquals(Float.parseFloat("158300"), loanSchedule.get(6).get("interestOriginalDue"), "Checking for Interest Due for 6th Month"); assertEquals(new ArrayList<>(Arrays.asList(2015, 4, 2)), loanSchedule.get(10).get("dueDate"), "Checking for Due Date for 10th Month"); - assertEquals(Float.valueOf("416700"), loanSchedule.get(10).get("principalDue"), "Checking for Principal Due for 10th Month"); - assertEquals(Float.valueOf("125000"), loanSchedule.get(10).get("interestOriginalDue"), "Checking for Interest Due for 10th Month"); + assertEquals(Float.parseFloat("416700"), loanSchedule.get(10).get("principalDue"), "Checking for Principal Due for 10th Month"); + assertEquals(Float.parseFloat("125000"), loanSchedule.get(10).get("interestOriginalDue"), + "Checking for Interest Due for 10th Month"); assertEquals(new ArrayList<>(Arrays.asList(2016, 2, 2)), loanSchedule.get(20).get("dueDate"), "Checking for Due Date for 20th Month"); - assertEquals(Float.valueOf("416700"), loanSchedule.get(20).get("principalDue"), "Checking for Principal Due for 20th Month"); - assertEquals(Float.valueOf("41700"), loanSchedule.get(20).get("interestOriginalDue"), "Checking for Interest Due for 20th Month"); + assertEquals(Float.parseFloat("416700"), loanSchedule.get(20).get("principalDue"), "Checking for Principal Due for 20th Month"); + assertEquals(Float.parseFloat("41700"), loanSchedule.get(20).get("interestOriginalDue"), + "Checking for Interest Due for 20th Month"); assertEquals(new ArrayList<>(Arrays.asList(2016, 6, 2)), loanSchedule.get(24).get("dueDate"), "Checking for Due Date for 24th Month"); - assertEquals(Float.valueOf("415900"), loanSchedule.get(24).get("principalDue"), "Checking for Principal Due for 24th Month"); - assertEquals(Float.valueOf("8300"), loanSchedule.get(24).get("interestOriginalDue"), "Checking for Interest Due for 24th Month"); + assertEquals(Float.parseFloat("415900"), loanSchedule.get(24).get("principalDue"), "Checking for Principal Due for 24th Month"); + assertEquals(Float.parseFloat("8300"), loanSchedule.get(24).get("interestOriginalDue"), "Checking for Interest Due for 24th Month"); } @@ -1143,53 +1147,56 @@ public class ClientLoanIntegrationTest { assertEquals(new ArrayList<>(Arrays.asList(2014, 7, 2)), loanSchedule.get(1).get("dueDate"), "Checking for Due Date for 1st Month"); validateNumberForEqualWithMsg("Checking for Principal Due for 1st Month", String.valueOf(loanSchedule.get(1).get("principalOriginalDue")), "0.0"); - assertEquals(Float.valueOf("200000"), loanSchedule.get(1).get("interestOriginalDue"), "Checking for Interest Due for 1st Month"); + assertEquals(Float.parseFloat("200000"), loanSchedule.get(1).get("interestOriginalDue"), "Checking for Interest Due for 1st Month"); assertEquals(new ArrayList<>(Arrays.asList(2014, 8, 2)), loanSchedule.get(2).get("dueDate"), "Checking for Due Date for 2nd Month"); validateNumberForEqualWithMsg("Checking for Principal Due for 2nd Month", "0.0", String.valueOf(loanSchedule.get(2).get("principalOriginalDue"))); - assertEquals(Float.valueOf("200000"), loanSchedule.get(2).get("interestOriginalDue"), "Checking for Interest Due for 2nd Month"); + assertEquals(Float.parseFloat("200000"), loanSchedule.get(2).get("interestOriginalDue"), "Checking for Interest Due for 2nd Month"); assertEquals(new ArrayList<>(Arrays.asList(2014, 9, 2)), loanSchedule.get(3).get("dueDate"), "Checking for Due Date for 3rd Month"); validateNumberForEqualWithMsg("Checking for Principal Due for 3rd Month", "0.0", String.valueOf(loanSchedule.get(3).get("principalDue"))); - assertEquals(Float.valueOf("200000"), loanSchedule.get(3).get("interestOriginalDue"), "Checking for Interest Due for 3rd Month"); + assertEquals(Float.parseFloat("200000"), loanSchedule.get(3).get("interestOriginalDue"), "Checking for Interest Due for 3rd Month"); assertEquals(new ArrayList<>(Arrays.asList(2014, 10, 2)), loanSchedule.get(4).get("dueDate"), "Checking for Due Date for 4th Month"); validateNumberForEqualWithMsg("Checking for Principal Due for 4th Month", "0", String.valueOf(loanSchedule.get(4).get("principalDue"))); - assertEquals(Float.valueOf("200000"), loanSchedule.get(4).get("interestOriginalDue"), "Checking for Interest Due for 4th Month"); + assertEquals(Float.parseFloat("200000"), loanSchedule.get(4).get("interestOriginalDue"), "Checking for Interest Due for 4th Month"); assertEquals(new ArrayList<>(Arrays.asList(2014, 11, 2)), loanSchedule.get(5).get("dueDate"), "Checking for Due Date for 5th Month"); validateNumberForEqualWithMsg("Checking for Principal Due for 5th Month", "0", String.valueOf(loanSchedule.get(5).get("principalDue"))); - assertEquals(Float.valueOf("200000"), loanSchedule.get(5).get("interestOriginalDue"), "Checking for Interest Due for 5th Month"); + assertEquals(Float.parseFloat("200000"), loanSchedule.get(5).get("interestOriginalDue"), "Checking for Interest Due for 5th Month"); assertEquals(new ArrayList<>(Arrays.asList(2014, 12, 2)), loanSchedule.get(6).get("dueDate"), "Checking for Due Date for 6th Month"); - assertEquals(Float.valueOf("526300"), loanSchedule.get(6).get("principalDue"), "Checking for Principal Due for 6th Month"); - assertEquals(Float.valueOf("200000"), loanSchedule.get(6).get("interestOriginalDue"), "Checking for Interest Due for 6th Month"); + assertEquals(Float.parseFloat("526300"), loanSchedule.get(6).get("principalDue"), "Checking for Principal Due for 6th Month"); + assertEquals(Float.parseFloat("200000"), loanSchedule.get(6).get("interestOriginalDue"), "Checking for Interest Due for 6th Month"); assertEquals(new ArrayList<>(Arrays.asList(2015, 1, 2)), loanSchedule.get(7).get("dueDate"), "Checking for Due Date for 7th Month"); - assertEquals(Float.valueOf("526300"), loanSchedule.get(7).get("principalDue"), "Checking for Principal Due for 7th Month"); - assertEquals(Float.valueOf("189500"), loanSchedule.get(7).get("interestOriginalDue"), "Checking for Interest Due for 7th Month"); + assertEquals(Float.parseFloat("526300"), loanSchedule.get(7).get("principalDue"), "Checking for Principal Due for 7th Month"); + assertEquals(Float.parseFloat("189500"), loanSchedule.get(7).get("interestOriginalDue"), "Checking for Interest Due for 7th Month"); assertEquals(new ArrayList<>(Arrays.asList(2015, 4, 2)), loanSchedule.get(10).get("dueDate"), "Checking for Due Date for 10th Month"); - assertEquals(Float.valueOf("526300"), loanSchedule.get(10).get("principalDue"), "Checking for Principal Due for 10th Month"); - assertEquals(Float.valueOf("157900"), loanSchedule.get(10).get("interestOriginalDue"), "Checking for Interest Due for 10th Month"); + assertEquals(Float.parseFloat("526300"), loanSchedule.get(10).get("principalDue"), "Checking for Principal Due for 10th Month"); + assertEquals(Float.parseFloat("157900"), loanSchedule.get(10).get("interestOriginalDue"), + "Checking for Interest Due for 10th Month"); assertEquals(new ArrayList<>(Arrays.asList(2016, 2, 2)), loanSchedule.get(20).get("dueDate"), "Checking for Due Date for 20th Month"); - assertEquals(Float.valueOf("526300"), loanSchedule.get(20).get("principalDue"), "Checking for Principal Due for 20th Month"); - assertEquals(Float.valueOf("52600"), loanSchedule.get(20).get("interestOriginalDue"), "Checking for Interest Due for 20th Month"); + assertEquals(Float.parseFloat("526300"), loanSchedule.get(20).get("principalDue"), "Checking for Principal Due for 20th Month"); + assertEquals(Float.parseFloat("52600"), loanSchedule.get(20).get("interestOriginalDue"), + "Checking for Interest Due for 20th Month"); assertEquals(new ArrayList<>(Arrays.asList(2016, 6, 2)), loanSchedule.get(24).get("dueDate"), "Checking for Due Date for 24th Month"); - assertEquals(Float.valueOf("526600"), loanSchedule.get(24).get("principalDue"), "Checking for Principal Due for 24th Month"); - assertEquals(Float.valueOf("10500"), loanSchedule.get(24).get("interestOriginalDue"), "Checking for Interest Due for 24th Month"); + assertEquals(Float.parseFloat("526600"), loanSchedule.get(24).get("principalDue"), "Checking for Principal Due for 24th Month"); + assertEquals(Float.parseFloat("10500"), loanSchedule.get(24).get("interestOriginalDue"), + "Checking for Interest Due for 24th Month"); } private void addCharges(List charges, Integer chargeId, String amount, String duedate) { @@ -1310,18 +1317,18 @@ public class ClientLoanIntegrationTest { loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); - final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) }; + final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat("100.00"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.DEBIT) }; this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011", assetAccountInitialEntry); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 September 2011", - new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("100.00"), JournalEntry.TransactionType.CREDIT)); loanCharges.clear(); loanCharges = this.loanTransactionHelper.getLoanCharges(loanID); validateCharge(flatDisbursement, loanCharges, "100", "0.00", "100.0", "0.0"); LOG.info("-------------Make repayment 1-----------"); - this.loanTransactionHelper.makeRepayment("20 October 2011", Float.valueOf("3301.49"), loanID); + this.loanTransactionHelper.makeRepayment("20 October 2011", Float.parseFloat("3301.49"), loanID); loanCharges.clear(); loanCharges = this.loanTransactionHelper.getLoanCharges(loanID); validateCharge(flatDisbursement, loanCharges, "100", "0.00", "100.0", "0.0"); @@ -1329,11 +1336,11 @@ public class ClientLoanIntegrationTest { validateCharge(flatInstallmentFee, loanCharges, "50", "150.00", "50.0", "0.0"); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 October 2011", - new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("2911.49"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3301.49"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("2911.49"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 October 2011", - new JournalEntry(Float.valueOf("150.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("240.00"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("150.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("240.00"), JournalEntry.TransactionType.CREDIT)); this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate), "29 October 2011", "100")); loanSchedule.clear(); @@ -1348,13 +1355,13 @@ public class ClientLoanIntegrationTest { validateCharge(flatInstallmentFee, loanCharges, "50", "100.00", "50.0", "50.0"); LOG.info("----------Make repayment 2------------"); - this.loanTransactionHelper.makeRepayment("20 November 2011", Float.valueOf("3251.49"), loanID); + this.loanTransactionHelper.makeRepayment("20 November 2011", Float.parseFloat("3251.49"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("3251.49"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("2969.72"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3251.49"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("2969.72"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 November 2011", - new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("181.77"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("100.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("181.77"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); secondInstallment = loanSchedule.get(2); @@ -1381,21 +1388,21 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("100", String.valueOf(secondInstallment.get("totalOutstandingForPeriod"))); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 October 2011", - new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("2811.49"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3301.49"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("2811.49"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 October 2011", - new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("150.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("240"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("100.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("150.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("240"), JournalEntry.TransactionType.CREDIT)); LOG.info("----------Make repayment 3 advance------------"); - this.loanTransactionHelper.makeRepayment("20 November 2011", Float.valueOf("3301.49"), loanID); + this.loanTransactionHelper.makeRepayment("20 November 2011", Float.parseFloat("3301.49"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3129.11"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3301.49"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3129.11"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 November 2011", - new JournalEntry(Float.valueOf("50.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("122.38"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("50.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("122.38"), JournalEntry.TransactionType.CREDIT)); this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), "10 January 2012", "100")); loanSchedule.clear(); @@ -1405,11 +1412,11 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("3239.68", String.valueOf(fourthInstallment.get("totalOutstandingForPeriod"))); LOG.info("----------Pay applied penalty ------------"); - this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("100"), loanID); + this.loanTransactionHelper.makeRepayment("20 January 2012", Float.parseFloat("100"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012", - new JournalEntry(Float.valueOf("100"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("100"), JournalEntry.TransactionType.DEBIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 January 2012", - new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("100.00"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); fourthInstallment = loanSchedule.get(4); @@ -1417,12 +1424,12 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("3139.68", String.valueOf(fourthInstallment.get("totalOutstandingForPeriod"))); LOG.info("----------Make repayment 4 ------------"); - this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("3139.68"), loanID); + this.loanTransactionHelper.makeRepayment("20 January 2012", Float.parseFloat("3139.68"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012", - new JournalEntry(Float.valueOf("3139.68"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3089.68"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3139.68"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3089.68"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 January 2012", - new JournalEntry(Float.valueOf("50.00"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("50.00"), JournalEntry.TransactionType.CREDIT)); } /*** @@ -1490,18 +1497,18 @@ public class ClientLoanIntegrationTest { loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); - final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) }; + final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat("120.00"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.DEBIT) }; this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011", assetAccountInitialEntry); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 September 2011", - new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("120.00"), JournalEntry.TransactionType.CREDIT)); loanCharges.clear(); loanCharges = this.loanTransactionHelper.getLoanCharges(loanID); validateCharge(percentageDisbursementCharge, loanCharges, "1", "0.0", "120.00", "0.0"); LOG.info("-------------Make repayment 1-----------"); - this.loanTransactionHelper.makeRepayment("20 October 2011", Float.valueOf("3300.60"), loanID); + this.loanTransactionHelper.makeRepayment("20 October 2011", Float.parseFloat("3300.60"), loanID); loanCharges.clear(); loanCharges = this.loanTransactionHelper.getLoanCharges(loanID); validateCharge(percentageDisbursementCharge, loanCharges, "1", "0.00", "120.00", "0.0"); @@ -1509,11 +1516,11 @@ public class ClientLoanIntegrationTest { validateCharge(percentageInstallmentFee, loanCharges, "1", "90.89", "29.11", "0.0"); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 October 2011", - new JournalEntry(Float.valueOf("3300.60"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("2911.49"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3300.60"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("2911.49"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 October 2011", - new JournalEntry(Float.valueOf("149.11"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("240.00"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("149.11"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("240.00"), JournalEntry.TransactionType.CREDIT)); this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentageSpecifiedDueDateCharge), "29 October 2011", "1")); loanSchedule.clear(); @@ -1528,13 +1535,13 @@ public class ClientLoanIntegrationTest { validateCharge(percentageInstallmentFee, loanCharges, "1", "61.19", "29.11", "29.70"); LOG.info("----------Make repayment 2------------"); - this.loanTransactionHelper.makeRepayment("20 November 2011", Float.valueOf("3271.49"), loanID); + this.loanTransactionHelper.makeRepayment("20 November 2011", Float.parseFloat("3271.49"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("3271.49"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("2969.72"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3271.49"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("2969.72"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 November 2011", - new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("181.77"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("120.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("181.77"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); secondInstallment = loanSchedule.get(2); @@ -1561,21 +1568,21 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("120", String.valueOf(secondInstallment.get("totalOutstandingForPeriod"))); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 October 2011", - new JournalEntry(Float.valueOf("3300.60"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("2791.49"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3300.60"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("2791.49"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 October 2011", - new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("149.11"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("240"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("120.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("149.11"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("240"), JournalEntry.TransactionType.CREDIT)); LOG.info("----------Make repayment 3 advance------------"); - this.loanTransactionHelper.makeRepayment("20 November 2011", Float.valueOf("3301.78"), loanID); + this.loanTransactionHelper.makeRepayment("20 November 2011", Float.parseFloat("3301.78"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("3301.78"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3149.11"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3301.78"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3149.11"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 November 2011", - new JournalEntry(Float.valueOf("30.29"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("122.38"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("30.29"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("122.38"), JournalEntry.TransactionType.CREDIT)); this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), "10 January 2012", "1")); loanSchedule.clear(); @@ -1585,11 +1592,11 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("3240.58", String.valueOf(fourthInstallment.get("totalOutstandingForPeriod"))); LOG.info("----------Pay applied penalty ------------"); - this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("120"), loanID); + this.loanTransactionHelper.makeRepayment("20 January 2012", Float.parseFloat("120"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012", - new JournalEntry(Float.valueOf("120"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("120"), JournalEntry.TransactionType.DEBIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 January 2012", - new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("120.00"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); fourthInstallment = loanSchedule.get(4); @@ -1597,12 +1604,12 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("3120.58", String.valueOf(fourthInstallment.get("totalOutstandingForPeriod"))); LOG.info("----------Make repayment 4 ------------"); - this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("3120.58"), loanID); + this.loanTransactionHelper.makeRepayment("20 January 2012", Float.parseFloat("3120.58"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012", - new JournalEntry(Float.valueOf("3120.58"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3089.68"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3120.58"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3089.68"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 January 2012", - new JournalEntry(Float.valueOf("30.90"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("30.90"), JournalEntry.TransactionType.CREDIT)); } /*** @@ -1670,18 +1677,18 @@ public class ClientLoanIntegrationTest { loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); - final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("126.06"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) }; + final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat("126.06"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.DEBIT) }; this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011", assetAccountInitialEntry); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 September 2011", - new JournalEntry(Float.valueOf("126.06"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("126.06"), JournalEntry.TransactionType.CREDIT)); loanCharges.clear(); loanCharges = this.loanTransactionHelper.getLoanCharges(loanID); validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, "1", "0.0", "126.06", "0.0"); LOG.info("-------------Make repayment 1-----------"); - this.loanTransactionHelper.makeRepayment("20 October 2011", Float.valueOf("3309.06"), loanID); + this.loanTransactionHelper.makeRepayment("20 October 2011", Float.parseFloat("3309.06"), loanID); loanCharges.clear(); loanCharges = this.loanTransactionHelper.getLoanCharges(loanID); validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, "1", "0.00", "126.06", "0.0"); @@ -1689,11 +1696,11 @@ public class ClientLoanIntegrationTest { validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, "1", "94.53", "31.51", "0.0"); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 October 2011", - new JournalEntry(Float.valueOf("3309.06"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("2911.49"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3309.06"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("2911.49"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 October 2011", - new JournalEntry(Float.valueOf("157.57"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("240.00"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("157.57"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("240.00"), JournalEntry.TransactionType.CREDIT)); this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON( String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), "29 October 2011", "1")); loanSchedule.clear(); @@ -1709,13 +1716,13 @@ public class ClientLoanIntegrationTest { validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, "1", "63.02", "31.51", "31.51"); LOG.info("----------Make repayment 2------------"); - this.loanTransactionHelper.makeRepayment("20 November 2011", Float.valueOf("3277.55"), loanID); + this.loanTransactionHelper.makeRepayment("20 November 2011", Float.parseFloat("3277.55"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("3277.55"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("2969.72"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3277.55"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("2969.72"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 November 2011", - new JournalEntry(Float.valueOf("126.06"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("181.77"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("126.06"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("181.77"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); secondInstallment = loanSchedule.get(2); @@ -1742,21 +1749,21 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("120", String.valueOf(secondInstallment.get("totalOutstandingForPeriod"))); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 October 2011", - new JournalEntry(Float.valueOf("3309.06"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("2791.49"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3309.06"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("2791.49"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 October 2011", - new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("157.57"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("240"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("120.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("157.57"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("240"), JournalEntry.TransactionType.CREDIT)); LOG.info("----------Make repayment 3 advance------------"); - this.loanTransactionHelper.makeRepayment("20 November 2011", Float.valueOf("3303"), loanID); + this.loanTransactionHelper.makeRepayment("20 November 2011", Float.parseFloat("3303"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("3303"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3149.11"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3303"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3149.11"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 November 2011", - new JournalEntry(Float.valueOf("31.51"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("122.38"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("31.51"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("122.38"), JournalEntry.TransactionType.CREDIT)); this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON( String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), "10 January 2012", "1")); loanSchedule.clear(); @@ -1766,11 +1773,11 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("3241.19", String.valueOf(fourthInstallment.get("totalOutstandingForPeriod"))); LOG.info("----------Pay applied penalty ------------"); - this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("120"), loanID); + this.loanTransactionHelper.makeRepayment("20 January 2012", Float.parseFloat("120"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012", - new JournalEntry(Float.valueOf("120"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("120"), JournalEntry.TransactionType.DEBIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 January 2012", - new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("120.00"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); fourthInstallment = loanSchedule.get(4); @@ -1778,12 +1785,12 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("3121.19", String.valueOf(fourthInstallment.get("totalOutstandingForPeriod"))); LOG.info("----------Make repayment 4 ------------"); - this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("3121.19"), loanID); + this.loanTransactionHelper.makeRepayment("20 January 2012", Float.parseFloat("3121.19"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012", - new JournalEntry(Float.valueOf("3121.19"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3089.68"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3121.19"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3089.68"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 January 2012", - new JournalEntry(Float.valueOf("31.51"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("31.51"), JournalEntry.TransactionType.CREDIT)); } /*** @@ -1847,16 +1854,16 @@ public class ClientLoanIntegrationTest { loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); - final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("605.94"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("200.00"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) }; + final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat("605.94"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("100.00"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("200.00"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.DEBIT) }; this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011", assetAccountInitialEntry); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 September 2011", - new JournalEntry(Float.valueOf("605.94"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("200.00"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("605.94"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("100.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("200.00"), JournalEntry.TransactionType.CREDIT)); this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate), "29 September 2011", "100")); @@ -1867,12 +1874,12 @@ public class ClientLoanIntegrationTest { validateCharge(flatSpecifiedDueDate, loanCharges, "100", "100.00", "0.0", "0.0"); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "29 September 2011", - new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("100.00"), JournalEntry.TransactionType.DEBIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "29 September 2011", - new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("100.00"), JournalEntry.TransactionType.CREDIT)); LOG.info("-------------Make repayment 1-----------"); - this.loanTransactionHelper.makeRepayment("20 October 2011", Float.valueOf("3301.49"), loanID); + this.loanTransactionHelper.makeRepayment("20 October 2011", Float.parseFloat("3301.49"), loanID); loanCharges.clear(); loanCharges = this.loanTransactionHelper.getLoanCharges(loanID); validateCharge(flatDisbursement, loanCharges, "100", "0.00", "100.0", "0.0"); @@ -1880,8 +1887,8 @@ public class ClientLoanIntegrationTest { validateCharge(flatInstallmentFee, loanCharges, "50", "150.00", "50.0", "0.0"); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 October 2011", - new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3301.49"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3301.49"), JournalEntry.TransactionType.CREDIT)); this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate), "29 October 2011", "100")); @@ -1898,15 +1905,15 @@ public class ClientLoanIntegrationTest { validateCharge(flatInstallmentFee, loanCharges, "50", "100.00", "50.0", "50.0"); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("50.0"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("50.0"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, "20 November 2011", - new JournalEntry(Float.valueOf("50.0"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("50.0"), JournalEntry.TransactionType.DEBIT)); LOG.info("----------Make repayment 2------------"); - this.loanTransactionHelper.makeRepayment("20 November 2011", Float.valueOf("3251.49"), loanID); + this.loanTransactionHelper.makeRepayment("20 November 2011", Float.parseFloat("3251.49"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("3251.49"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3251.49"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3251.49"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3251.49"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -1922,9 +1929,9 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("60.59", String.valueOf(thirdInstallment.get("interestOutstanding"))); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 December 2011", - new JournalEntry(Float.valueOf("61.79"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("61.79"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, "20 December 2011", - new JournalEntry(Float.valueOf("61.79"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("61.79"), JournalEntry.TransactionType.DEBIT)); Integer flatPenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, "100", true)); @@ -1941,14 +1948,14 @@ public class ClientLoanIntegrationTest { // checking the journal entry as applied penalty has been collected this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 October 2011", - new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3301.49"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3301.49"), JournalEntry.TransactionType.CREDIT)); LOG.info("----------Make repayment 3 advance------------"); - this.loanTransactionHelper.makeRepayment("20 November 2011", Float.valueOf("3301.49"), loanID); + this.loanTransactionHelper.makeRepayment("20 November 2011", Float.parseFloat("3301.49"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3301.49"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3301.49"), JournalEntry.TransactionType.CREDIT)); this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), "10 January 2012", "100")); loanSchedule.clear(); @@ -1958,10 +1965,10 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("3239.68", String.valueOf(fourthInstallment.get("totalOutstandingForPeriod"))); LOG.info("----------Pay applied penalty ------------"); - this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("100"), loanID); + this.loanTransactionHelper.makeRepayment("20 January 2012", Float.parseFloat("100"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012", - new JournalEntry(Float.valueOf("100"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("100"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("100"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("100"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); fourthInstallment = loanSchedule.get(4); @@ -1969,12 +1976,12 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("3139.68", String.valueOf(fourthInstallment.get("totalOutstandingForPeriod"))); LOG.info("----------Make over payment for repayment 4 ------------"); - this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("3220.60"), loanID); + this.loanTransactionHelper.makeRepayment("20 January 2012", Float.parseFloat("3220.60"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012", - new JournalEntry(Float.valueOf("3220.60"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3139.68"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3220.60"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3139.68"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForLiabilityAccount(overpaymentAccount, "20 January 2012", - new JournalEntry(Float.valueOf("80.92"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("80.92"), JournalEntry.TransactionType.CREDIT)); loanStatusHashMap = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec, loanID, "status"); LoanStatusChecker.verifyLoanAccountIsOverPaid(loanStatusHashMap); } @@ -2045,24 +2052,24 @@ public class ClientLoanIntegrationTest { loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); - final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("605.94"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) }; + final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat("605.94"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("120.00"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("120.00"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("120.00"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.DEBIT) }; this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011", assetAccountInitialEntry); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 September 2011", - new JournalEntry(Float.valueOf("605.94"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("605.94"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("120.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("120.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("120.00"), JournalEntry.TransactionType.CREDIT)); loanCharges.clear(); loanCharges = this.loanTransactionHelper.getLoanCharges(loanID); validateCharge(percentageDisbursementCharge, loanCharges, "1", "0.0", "120.00", "0.0"); LOG.info("-------------Make repayment 1-----------"); - this.loanTransactionHelper.makeRepayment("20 October 2011", Float.valueOf("3300.60"), loanID); + this.loanTransactionHelper.makeRepayment("20 October 2011", Float.parseFloat("3300.60"), loanID); loanCharges.clear(); loanCharges = this.loanTransactionHelper.getLoanCharges(loanID); validateCharge(percentageDisbursementCharge, loanCharges, "1", "0.00", "120.00", "0.0"); @@ -2070,8 +2077,8 @@ public class ClientLoanIntegrationTest { validateCharge(percentageInstallmentFee, loanCharges, "1", "90.89", "29.11", "0.0"); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 October 2011", - new JournalEntry(Float.valueOf("3300.60"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3300.60"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3300.60"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3300.60"), JournalEntry.TransactionType.CREDIT)); this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentageSpecifiedDueDateCharge), "29 October 2011", "1")); @@ -2088,15 +2095,15 @@ public class ClientLoanIntegrationTest { validateCharge(percentageInstallmentFee, loanCharges, "1", "61.19", "29.11", "29.70"); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("29.7"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("29.7"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, "20 November 2011", - new JournalEntry(Float.valueOf("29.7"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("29.7"), JournalEntry.TransactionType.DEBIT)); LOG.info("----------Make repayment 2------------"); - this.loanTransactionHelper.makeRepayment("20 November 2011", Float.valueOf("3271.49"), loanID); + this.loanTransactionHelper.makeRepayment("20 November 2011", Float.parseFloat("3271.49"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("3271.49"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3271.49"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3271.49"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3271.49"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -2112,9 +2119,9 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("60.59", String.valueOf(thirdInstallment.get("interestOutstanding"))); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 December 2011", - new JournalEntry(Float.valueOf("61.79"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("61.79"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, "20 December 2011", - new JournalEntry(Float.valueOf("61.79"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("61.79"), JournalEntry.TransactionType.DEBIT)); Integer percentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", true)); @@ -2131,14 +2138,14 @@ public class ClientLoanIntegrationTest { // checking the journal entry as applied penalty has been collected this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 October 2011", - new JournalEntry(Float.valueOf("3300.60"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3300.60"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3300.60"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3300.60"), JournalEntry.TransactionType.CREDIT)); LOG.info("----------Make repayment 3 advance------------"); - this.loanTransactionHelper.makeRepayment("20 November 2011", Float.valueOf("3301.78"), loanID); + this.loanTransactionHelper.makeRepayment("20 November 2011", Float.parseFloat("3301.78"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("3301.78"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3301.78"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3301.78"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3301.78"), JournalEntry.TransactionType.CREDIT)); this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), "10 January 2012", "1")); loanSchedule.clear(); @@ -2148,10 +2155,10 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("3240.58", String.valueOf(fourthInstallment.get("totalOutstandingForPeriod"))); LOG.info("----------Pay applied penalty ------------"); - this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("120"), loanID); + this.loanTransactionHelper.makeRepayment("20 January 2012", Float.parseFloat("120"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012", - new JournalEntry(Float.valueOf("120"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("120"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("120"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("120"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); fourthInstallment = loanSchedule.get(4); @@ -2159,12 +2166,12 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("3120.58", String.valueOf(fourthInstallment.get("totalOutstandingForPeriod"))); LOG.info("----------Make over payment for repayment 4 ------------"); - this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("3220.58"), loanID); + this.loanTransactionHelper.makeRepayment("20 January 2012", Float.parseFloat("3220.58"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012", - new JournalEntry(Float.valueOf("3220.58"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3120.58"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3220.58"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3120.58"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForLiabilityAccount(overpaymentAccount, "20 January 2012", - new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("100.00"), JournalEntry.TransactionType.CREDIT)); loanStatusHashMap = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec, loanID, "status"); LoanStatusChecker.verifyLoanAccountIsOverPaid(loanStatusHashMap); } @@ -2233,16 +2240,16 @@ public class ClientLoanIntegrationTest { loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); - final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("605.94"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("126.06"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("126.04"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) }; + final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat("605.94"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("126.06"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("126.04"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.DEBIT) }; this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011", assetAccountInitialEntry); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 September 2011", - new JournalEntry(Float.valueOf("605.94"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("126.06"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("126.04"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("605.94"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("126.06"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("126.04"), JournalEntry.TransactionType.CREDIT)); this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON( String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), "29 September 2011", "1")); @@ -2253,12 +2260,12 @@ public class ClientLoanIntegrationTest { validateCharge(amountPlusInterestPercentageSpecifiedDueDateCharge, loanCharges, "1", "126.06", "0.0", "0.0"); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "29 September 2011", - new JournalEntry(Float.valueOf("126.06"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("126.06"), JournalEntry.TransactionType.DEBIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "29 September 2011", - new JournalEntry(Float.valueOf("126.06"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("126.06"), JournalEntry.TransactionType.CREDIT)); LOG.info("-------------Make repayment 1-----------"); - this.loanTransactionHelper.makeRepayment("20 October 2011", Float.valueOf("3309.06"), loanID); + this.loanTransactionHelper.makeRepayment("20 October 2011", Float.parseFloat("3309.06"), loanID); loanCharges.clear(); loanCharges = this.loanTransactionHelper.getLoanCharges(loanID); validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, "1", "0.00", "126.06", "0.0"); @@ -2266,8 +2273,8 @@ public class ClientLoanIntegrationTest { validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, "1", "94.53", "31.51", "0.0"); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 October 2011", - new JournalEntry(Float.valueOf("3309.06"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3309.06"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3309.06"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3309.06"), JournalEntry.TransactionType.CREDIT)); this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON( String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), "29 October 2011", "1")); @@ -2285,15 +2292,15 @@ public class ClientLoanIntegrationTest { validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, "1", "63.02", "31.51", "31.51"); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("31.51"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("31.51"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, "20 November 2011", - new JournalEntry(Float.valueOf("31.51"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("31.51"), JournalEntry.TransactionType.DEBIT)); LOG.info("----------Make repayment 2------------"); - this.loanTransactionHelper.makeRepayment("20 November 2011", Float.valueOf("3277.55"), loanID); + this.loanTransactionHelper.makeRepayment("20 November 2011", Float.parseFloat("3277.55"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("3277.55"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3277.55"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3277.55"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3277.55"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -2309,9 +2316,9 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("60.59", String.valueOf(thirdInstallment.get("interestOutstanding"))); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 December 2011", - new JournalEntry(Float.valueOf("61.79"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("61.79"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, "20 December 2011", - new JournalEntry(Float.valueOf("61.79"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("61.79"), JournalEntry.TransactionType.DEBIT)); Integer amountPlusInterestPercentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", true)); @@ -2328,14 +2335,14 @@ public class ClientLoanIntegrationTest { // checking the journal entry as applied penalty has been collected this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 October 2011", - new JournalEntry(Float.valueOf("3309.06"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3309.06"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3309.06"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3309.06"), JournalEntry.TransactionType.CREDIT)); LOG.info("----------Make repayment 3 advance------------"); - this.loanTransactionHelper.makeRepayment("20 November 2011", Float.valueOf("3303"), loanID); + this.loanTransactionHelper.makeRepayment("20 November 2011", Float.parseFloat("3303"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("3303"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3303"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3303"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3303"), JournalEntry.TransactionType.CREDIT)); this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON( String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), "10 January 2012", "1")); loanSchedule.clear(); @@ -2345,10 +2352,10 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("3241.19", String.valueOf(fourthInstallment.get("totalOutstandingForPeriod"))); LOG.info("----------Pay applied penalty ------------"); - this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("120"), loanID); + this.loanTransactionHelper.makeRepayment("20 January 2012", Float.parseFloat("120"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012", - new JournalEntry(Float.valueOf("120"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("120"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("120"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("120"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); fourthInstallment = loanSchedule.get(4); @@ -2356,12 +2363,12 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("3121.19", String.valueOf(fourthInstallment.get("totalOutstandingForPeriod"))); LOG.info("----------Make over payment for repayment 4 ------------"); - this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("3221.61"), loanID); + this.loanTransactionHelper.makeRepayment("20 January 2012", Float.parseFloat("3221.61"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012", - new JournalEntry(Float.valueOf("3221.61"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3121.19"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3221.61"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3121.19"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForLiabilityAccount(overpaymentAccount, "20 January 2012", - new JournalEntry(Float.valueOf("100.42"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("100.42"), JournalEntry.TransactionType.CREDIT)); loanStatusHashMap = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec, loanID, "status"); LoanStatusChecker.verifyLoanAccountIsOverPaid(loanStatusHashMap); } @@ -2428,18 +2435,18 @@ public class ClientLoanIntegrationTest { loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); - final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) }; + final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat("100.00"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.DEBIT) }; this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011", assetAccountInitialEntry); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 September 2011", - new JournalEntry(Float.valueOf("100.00"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("100.00"), JournalEntry.TransactionType.CREDIT)); loanCharges.clear(); loanCharges = this.loanTransactionHelper.getLoanCharges(loanID); validateCharge(flatDisbursement, loanCharges, "100", "0.00", "100.0", "0.0"); LOG.info("-------------Make repayment 1-----------"); - this.loanTransactionHelper.makeRepayment("20 October 2011", Float.valueOf("3301.49"), loanID); + this.loanTransactionHelper.makeRepayment("20 October 2011", Float.parseFloat("3301.49"), loanID); loanCharges.clear(); loanCharges = this.loanTransactionHelper.getLoanCharges(loanID); validateCharge(flatDisbursement, loanCharges, "100", "0.00", "100.0", "0.0"); @@ -2447,8 +2454,8 @@ public class ClientLoanIntegrationTest { validateCharge(flatInstallmentFee, loanCharges, "50", "150.00", "50.0", "0.0"); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 October 2011", - new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3301.49"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3301.49"), JournalEntry.TransactionType.CREDIT)); this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatSpecifiedDueDate), "29 October 2011", "100")); @@ -2466,9 +2473,9 @@ public class ClientLoanIntegrationTest { /* * this.journalEntryHelper.checkJournalEntryForAssetAccount( assetAccount, "20 September 2011", new - * JournalEntry(Float.valueOf("50.0"), JournalEntry.TransactionType.CREDIT)); + * JournalEntry(Float.parseFloat("50.0"), JournalEntry.TransactionType.CREDIT)); * this.journalEntryHelper.checkJournalEntryForExpenseAccount (expenseAccount, "20 September 2011", new - * JournalEntry(Float.valueOf("50.0"), JournalEntry.TransactionType.DEBIT)); + * JournalEntry(Float.parseFloat("50.0"), JournalEntry.TransactionType.DEBIT)); */ final String jobName = "Add Accrual Transactions"; @@ -2479,10 +2486,10 @@ public class ClientLoanIntegrationTest { checkAccrualTransactions(loanSchedule, loanID); LOG.info("----------Make repayment 2------------"); - this.loanTransactionHelper.makeRepayment("20 November 2011", Float.valueOf("3251.49"), loanID); + this.loanTransactionHelper.makeRepayment("20 November 2011", Float.parseFloat("3251.49"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("3251.49"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3251.49"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3251.49"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3251.49"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -2498,9 +2505,9 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("60.59", String.valueOf(thirdInstallment.get("interestOutstanding"))); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 December 2011", - new JournalEntry(Float.valueOf("61.79"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("61.79"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, "20 December 2011", - new JournalEntry(Float.valueOf("61.79"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("61.79"), JournalEntry.TransactionType.DEBIT)); Integer flatPenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_FLAT, "100", true)); @@ -2517,14 +2524,14 @@ public class ClientLoanIntegrationTest { // checking the journal entry as applied penalty has been collected this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 October 2011", - new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3301.49"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3301.49"), JournalEntry.TransactionType.CREDIT)); LOG.info("----------Make repayment 3 advance------------"); - this.loanTransactionHelper.makeRepayment("20 November 2011", Float.valueOf("3301.49"), loanID); + this.loanTransactionHelper.makeRepayment("20 November 2011", Float.parseFloat("3301.49"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3301.49"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3301.49"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3301.49"), JournalEntry.TransactionType.CREDIT)); this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(flatPenaltySpecifiedDueDate), "10 January 2012", "100")); @@ -2535,10 +2542,10 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("3239.68", String.valueOf(fourthInstallment.get("totalOutstandingForPeriod"))); LOG.info("----------Pay applied penalty ------------"); - this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("100"), loanID); + this.loanTransactionHelper.makeRepayment("20 January 2012", Float.parseFloat("100"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012", - new JournalEntry(Float.valueOf("100"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("100"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("100"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("100"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); fourthInstallment = loanSchedule.get(4); @@ -2546,10 +2553,10 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("3139.68", String.valueOf(fourthInstallment.get("totalOutstandingForPeriod"))); LOG.info("----------Make repayment 4 ------------"); - this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("3139.68"), loanID); + this.loanTransactionHelper.makeRepayment("20 January 2012", Float.parseFloat("3139.68"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012", - new JournalEntry(Float.valueOf("3139.68"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3139.68"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3139.68"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3139.68"), JournalEntry.TransactionType.CREDIT)); loanStatusHashMap = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec, loanID, "status"); LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap); } @@ -2620,18 +2627,18 @@ public class ClientLoanIntegrationTest { loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); - final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) }; + final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat("120.00"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.DEBIT) }; this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011", assetAccountInitialEntry); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 September 2011", - new JournalEntry(Float.valueOf("120.00"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("120.00"), JournalEntry.TransactionType.CREDIT)); loanCharges.clear(); loanCharges = this.loanTransactionHelper.getLoanCharges(loanID); validateCharge(percentageDisbursementCharge, loanCharges, "1", "0.0", "120.00", "0.0"); LOG.info("-------------Make repayment 1-----------"); - this.loanTransactionHelper.makeRepayment("20 October 2011", Float.valueOf("3300.60"), loanID); + this.loanTransactionHelper.makeRepayment("20 October 2011", Float.parseFloat("3300.60"), loanID); loanCharges.clear(); loanCharges = this.loanTransactionHelper.getLoanCharges(loanID); validateCharge(percentageDisbursementCharge, loanCharges, "1", "0.00", "120.00", "0.0"); @@ -2639,8 +2646,8 @@ public class ClientLoanIntegrationTest { validateCharge(percentageInstallmentFee, loanCharges, "1", "90.89", "29.11", "0.0"); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 October 2011", - new JournalEntry(Float.valueOf("3300.60"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3300.60"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3300.60"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3300.60"), JournalEntry.TransactionType.CREDIT)); this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentageSpecifiedDueDateCharge), "29 October 2011", "1")); @@ -2658,9 +2665,9 @@ public class ClientLoanIntegrationTest { /* * this.journalEntryHelper.checkJournalEntryForAssetAccount( assetAccount, "20 September 2011", new - * JournalEntry(Float.valueOf("29.7"), JournalEntry.TransactionType.CREDIT)); + * JournalEntry(Float.parseFloat("29.7"), JournalEntry.TransactionType.CREDIT)); * this.journalEntryHelper.checkJournalEntryForExpenseAccount (expenseAccount, "20 September 2011", new - * JournalEntry(Float.valueOf("29.7"), JournalEntry.TransactionType.DEBIT)); + * JournalEntry(Float.parseFloat("29.7"), JournalEntry.TransactionType.DEBIT)); */ final String jobName = "Add Accrual Transactions"; @@ -2672,10 +2679,10 @@ public class ClientLoanIntegrationTest { checkAccrualTransactions(loanSchedule, loanID); LOG.info("----------Make repayment 2------------"); - this.loanTransactionHelper.makeRepayment("20 November 2011", Float.valueOf("3271.49"), loanID); + this.loanTransactionHelper.makeRepayment("20 November 2011", Float.parseFloat("3271.49"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("3271.49"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3271.49"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3271.49"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3271.49"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -2691,9 +2698,9 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("60.59", String.valueOf(thirdInstallment.get("interestOutstanding"))); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 December 2011", - new JournalEntry(Float.valueOf("61.79"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("61.79"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, "20 December 2011", - new JournalEntry(Float.valueOf("61.79"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("61.79"), JournalEntry.TransactionType.DEBIT)); Integer percentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", true)); @@ -2710,14 +2717,14 @@ public class ClientLoanIntegrationTest { // checking the journal entry as applied penalty has been collected this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 October 2011", - new JournalEntry(Float.valueOf("3300.60"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3300.60"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3300.60"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3300.60"), JournalEntry.TransactionType.CREDIT)); LOG.info("----------Make repayment 3 advance------------"); - this.loanTransactionHelper.makeRepayment("20 November 2011", Float.valueOf("3301.78"), loanID); + this.loanTransactionHelper.makeRepayment("20 November 2011", Float.parseFloat("3301.78"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("3301.78"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3301.78"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3301.78"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3301.78"), JournalEntry.TransactionType.CREDIT)); this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper .getSpecifiedDueDateChargesForLoanAsJSON(String.valueOf(percentagePenaltySpecifiedDueDate), "10 January 2012", "1")); @@ -2728,10 +2735,10 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("3240.58", String.valueOf(fourthInstallment.get("totalOutstandingForPeriod"))); LOG.info("----------Pay applied penalty ------------"); - this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("120"), loanID); + this.loanTransactionHelper.makeRepayment("20 January 2012", Float.parseFloat("120"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012", - new JournalEntry(Float.valueOf("120"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("120"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("120"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("120"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); fourthInstallment = loanSchedule.get(4); @@ -2739,10 +2746,10 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("3120.58", String.valueOf(fourthInstallment.get("totalOutstandingForPeriod"))); LOG.info("----------Make repayment 4 ------------"); - this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("3120.58"), loanID); + this.loanTransactionHelper.makeRepayment("20 January 2012", Float.parseFloat("3120.58"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012", - new JournalEntry(Float.valueOf("3120.58"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3120.58"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3120.58"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3120.58"), JournalEntry.TransactionType.CREDIT)); loanStatusHashMap = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec, loanID, "status"); LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap); } @@ -2813,18 +2820,18 @@ public class ClientLoanIntegrationTest { loanStatusHashMap = this.loanTransactionHelper.disburseLoan("20 September 2011", loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); - final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("126.06"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) }; + final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat("126.06"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.DEBIT) }; this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 September 2011", assetAccountInitialEntry); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, "20 September 2011", - new JournalEntry(Float.valueOf("126.06"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("126.06"), JournalEntry.TransactionType.CREDIT)); loanCharges.clear(); loanCharges = this.loanTransactionHelper.getLoanCharges(loanID); validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, "1", "0.0", "126.06", "0.0"); LOG.info("-------------Make repayment 1-----------"); - this.loanTransactionHelper.makeRepayment("20 October 2011", Float.valueOf("3309.06"), loanID); + this.loanTransactionHelper.makeRepayment("20 October 2011", Float.parseFloat("3309.06"), loanID); loanCharges.clear(); loanCharges = this.loanTransactionHelper.getLoanCharges(loanID); validateCharge(amountPlusInterestPercentageDisbursementCharge, loanCharges, "1", "0.00", "126.06", "0.0"); @@ -2832,8 +2839,8 @@ public class ClientLoanIntegrationTest { validateCharge(amountPlusInterestPercentageInstallmentFee, loanCharges, "1", "94.53", "31.51", "0.0"); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 October 2011", - new JournalEntry(Float.valueOf("3309.06"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3309.06"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3309.06"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3309.06"), JournalEntry.TransactionType.CREDIT)); this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON( String.valueOf(amountPlusInterestPercentageSpecifiedDueDateCharge), "29 October 2011", "1")); @@ -2852,9 +2859,9 @@ public class ClientLoanIntegrationTest { /* * this.journalEntryHelper.checkJournalEntryForAssetAccount( assetAccount, "20 September 2011", new - * JournalEntry( Float.valueOf("31.51"), JournalEntry.TransactionType.CREDIT)); + * JournalEntry( Float.parseFloat("31.51"), JournalEntry.TransactionType.CREDIT)); * this.journalEntryHelper.checkJournalEntryForExpenseAccount (expenseAccount, "20 September 2011", new - * JournalEntry(Float.valueOf("31.51"), JournalEntry.TransactionType.DEBIT)); + * JournalEntry(Float.parseFloat("31.51"), JournalEntry.TransactionType.DEBIT)); */ final String jobName = "Add Accrual Transactions"; @@ -2866,10 +2873,10 @@ public class ClientLoanIntegrationTest { checkAccrualTransactions(loanSchedule, loanID); LOG.info("----------Make repayment 2------------"); - this.loanTransactionHelper.makeRepayment("20 November 2011", Float.valueOf("3277.55"), loanID); + this.loanTransactionHelper.makeRepayment("20 November 2011", Float.parseFloat("3277.55"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("3277.55"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3277.55"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3277.55"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3277.55"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -2885,9 +2892,9 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("60.59", String.valueOf(thirdInstallment.get("interestOutstanding"))); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 December 2011", - new JournalEntry(Float.valueOf("61.79"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("61.79"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForExpenseAccount(expenseAccount, "20 December 2011", - new JournalEntry(Float.valueOf("61.79"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("61.79"), JournalEntry.TransactionType.DEBIT)); Integer amountPlusInterestPercentagePenaltySpecifiedDueDate = ChargesHelper.createCharges(requestSpec, responseSpec, ChargesHelper.getLoanSpecifiedDueDateJSON(ChargesHelper.CHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT, "1", true)); @@ -2904,14 +2911,14 @@ public class ClientLoanIntegrationTest { // checking the journal entry as applied penalty has been collected this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 October 2011", - new JournalEntry(Float.valueOf("3309.06"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3309.06"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3309.06"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3309.06"), JournalEntry.TransactionType.CREDIT)); LOG.info("----------Make repayment 3 advance------------"); - this.loanTransactionHelper.makeRepayment("20 November 2011", Float.valueOf("3303"), loanID); + this.loanTransactionHelper.makeRepayment("20 November 2011", Float.parseFloat("3303"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 November 2011", - new JournalEntry(Float.valueOf("3303"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3303"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3303"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3303"), JournalEntry.TransactionType.CREDIT)); this.loanTransactionHelper.addChargesForLoan(loanID, LoanTransactionHelper.getSpecifiedDueDateChargesForLoanAsJSON( String.valueOf(amountPlusInterestPercentagePenaltySpecifiedDueDate), "10 January 2012", "1")); @@ -2922,10 +2929,10 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("3241.19", String.valueOf(fourthInstallment.get("totalOutstandingForPeriod"))); LOG.info("----------Pay applied penalty ------------"); - this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("120"), loanID); + this.loanTransactionHelper.makeRepayment("20 January 2012", Float.parseFloat("120"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012", - new JournalEntry(Float.valueOf("120"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("120"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("120"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("120"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); fourthInstallment = loanSchedule.get(4); @@ -2933,10 +2940,10 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("3121.19", String.valueOf(fourthInstallment.get("totalOutstandingForPeriod"))); LOG.info("----------Make repayment 4 ------------"); - this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("3121.19"), loanID); + this.loanTransactionHelper.makeRepayment("20 January 2012", Float.parseFloat("3121.19"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, "20 January 2012", - new JournalEntry(Float.valueOf("3121.19"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("3121.19"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("3121.19"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("3121.19"), JournalEntry.TransactionType.CREDIT)); loanStatusHashMap = (HashMap) this.loanTransactionHelper.getLoanDetail(this.requestSpec, this.responseSpec, loanID, "status"); LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap); } @@ -3012,7 +3019,7 @@ public class ClientLoanIntegrationTest { /*** * Make payment for installment #1 */ - this.loanTransactionHelper.makeRepayment("20 October 2011", Float.valueOf("3200"), loanID); + this.loanTransactionHelper.makeRepayment("20 October 2011", Float.parseFloat("3200"), loanID); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); firstInstallment = loanSchedule.get(1); @@ -3033,7 +3040,7 @@ public class ClientLoanIntegrationTest { /*** * Make payment for installment #2 */ - this.loanTransactionHelper.makeRepayment("20 November 2011", Float.valueOf("3200"), loanID); + this.loanTransactionHelper.makeRepayment("20 November 2011", Float.parseFloat("3200"), loanID); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); /*** @@ -3057,7 +3064,7 @@ public class ClientLoanIntegrationTest { /*** * Make payment with due amount of 3rd installment on 4th installment date */ - this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("3200"), loanID); + this.loanTransactionHelper.makeRepayment("20 January 2012", Float.parseFloat("3200"), loanID); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -3074,7 +3081,7 @@ public class ClientLoanIntegrationTest { validateNumberForEqual("100", String.valueOf(fourthInstallment.get("interestPaid"))); validateNumberForEqual("0.00", String.valueOf(fourthInstallment.get("interestOutstanding"))); - this.loanTransactionHelper.makeRepayment("20 January 2012", Float.valueOf("3000"), loanID); + this.loanTransactionHelper.makeRepayment("20 January 2012", Float.parseFloat("3000"), loanID); /*** * verify loan is closed as we paid full amount @@ -3093,17 +3100,17 @@ public class ClientLoanIntegrationTest { final ArrayList dueDateAsArray = (ArrayList) repayment.get("dueDate"); final LocalDate transactionDate = LocalDate.of(dueDateAsArray.get(0), dueDateAsArray.get(1), dueDateAsArray.get(2)); - final Float interestPortion = BigDecimal.valueOf(Double.valueOf(repayment.get("interestDue").toString())) - .subtract(BigDecimal.valueOf(Double.valueOf(repayment.get("interestWaived").toString()))) - .subtract(BigDecimal.valueOf(Double.valueOf(repayment.get("interestWrittenOff").toString()))).floatValue(); + final Float interestPortion = BigDecimal.valueOf(Double.parseDouble(repayment.get("interestDue").toString())) + .subtract(BigDecimal.valueOf(Double.parseDouble(repayment.get("interestWaived").toString()))) + .subtract(BigDecimal.valueOf(Double.parseDouble(repayment.get("interestWrittenOff").toString()))).floatValue(); - final Float feePortion = BigDecimal.valueOf(Double.valueOf(repayment.get("feeChargesDue").toString())) - .subtract(BigDecimal.valueOf(Double.valueOf(repayment.get("feeChargesWaived").toString()))) - .subtract(BigDecimal.valueOf(Double.valueOf(repayment.get("feeChargesWrittenOff").toString()))).floatValue(); + final Float feePortion = BigDecimal.valueOf(Double.parseDouble(repayment.get("feeChargesDue").toString())) + .subtract(BigDecimal.valueOf(Double.parseDouble(repayment.get("feeChargesWaived").toString()))) + .subtract(BigDecimal.valueOf(Double.parseDouble(repayment.get("feeChargesWrittenOff").toString()))).floatValue(); - final Float penaltyPortion = BigDecimal.valueOf(Double.valueOf(repayment.get("penaltyChargesDue").toString())) - .subtract(BigDecimal.valueOf(Double.valueOf(repayment.get("penaltyChargesWaived").toString()))) - .subtract(BigDecimal.valueOf(Double.valueOf(repayment.get("penaltyChargesWrittenOff").toString()))).floatValue(); + final Float penaltyPortion = BigDecimal.valueOf(Double.parseDouble(repayment.get("penaltyChargesDue").toString())) + .subtract(BigDecimal.valueOf(Double.parseDouble(repayment.get("penaltyChargesWaived").toString()))) + .subtract(BigDecimal.valueOf(Double.parseDouble(repayment.get("penaltyChargesWrittenOff").toString()))).floatValue(); this.loanTransactionHelper.checkAccrualTransactionForRepayment(transactionDate, interestPortion, feePortion, penaltyPortion, loanID); @@ -3179,7 +3186,7 @@ public class ClientLoanIntegrationTest { addRepaymentValues(expectedvalues, todaysDate, 1, false, "2517.29", "11.62", "0.0", "0.0"); verifyLoanRepaymentSchedule(loanSchedule, expectedvalues); - Float earlyPayment = Float.valueOf("4000"); + Float earlyPayment = Float.parseFloat("4000"); todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant()); todaysDate.add(Calendar.DAY_OF_MONTH, -5); final String LOAN_SECOND_REPAYMENT_DATE = dateFormat.format(todaysDate.getTime()); @@ -3198,7 +3205,7 @@ public class ClientLoanIntegrationTest { validateNumberForEqualWithMsg("verify pre-close amount", "3551.93", prepayAmount); todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant()); final String loanRepaymentDate = dateFormat.format(todaysDate.getTime()); - this.loanTransactionHelper.makeRepayment(loanRepaymentDate, Float.valueOf(prepayAmount), loanID); + this.loanTransactionHelper.makeRepayment(loanRepaymentDate, Float.parseFloat(prepayAmount), loanID); loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap); } @@ -3292,7 +3299,7 @@ public class ClientLoanIntegrationTest { validateNumberForEqualWithMsg("verify pre-close amount", preCloseAmount, prepayAmount); todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant()); final String loanRepaymentDate = dateFormat.format(todaysDate.getTime()); - this.loanTransactionHelper.makeRepayment(loanRepaymentDate, Float.valueOf(prepayAmount), loanID); + this.loanTransactionHelper.makeRepayment(loanRepaymentDate, Float.parseFloat(prepayAmount), loanID); loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap); } @@ -3370,7 +3377,7 @@ public class ClientLoanIntegrationTest { addRepaymentValues(expectedvalues, todaysDate, 1, false, "2517.29", "11.62", "1.16", "0.0"); verifyLoanRepaymentSchedule(loanSchedule, expectedvalues); - Float earlyPayment = Float.valueOf("4000"); + Float earlyPayment = Float.parseFloat("4000"); todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant()); todaysDate.add(Calendar.DAY_OF_MONTH, -5); final String LOAN_SECOND_REPAYMENT_DATE = dateFormat.format(todaysDate.getTime()); @@ -3388,7 +3395,7 @@ public class ClientLoanIntegrationTest { String prepayAmount = String.valueOf(prepayDetail.get("amount")); todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant()); final String loanRepaymentDate = dateFormat.format(todaysDate.getTime()); - this.loanTransactionHelper.makeRepayment(loanRepaymentDate, Float.valueOf(prepayAmount), loanID); + this.loanTransactionHelper.makeRepayment(loanRepaymentDate, Float.parseFloat(prepayAmount), loanID); loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap); } @@ -3474,7 +3481,7 @@ public class ClientLoanIntegrationTest { addRepaymentValues(expectedvalues, todaysDate, 1, false, "2517.29", "11.62", "0.0", "0.0"); verifyLoanRepaymentSchedule(loanSchedule, expectedvalues); - Float earlyPayment = Float.valueOf("4000"); + Float earlyPayment = Float.parseFloat("4000"); todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant()); todaysDate.add(Calendar.DAY_OF_MONTH, -5); final String LOAN_SECOND_REPAYMENT_DATE = dateFormat.format(todaysDate.getTime()); @@ -3499,7 +3506,7 @@ public class ClientLoanIntegrationTest { String prepayAmount = String.valueOf(prepayDetail.get("amount")); todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant()); final String loanRepaymentDate = dateFormat.format(todaysDate.getTime()); - this.loanTransactionHelper.makeRepayment(loanRepaymentDate, Float.valueOf(prepayAmount), loanID); + this.loanTransactionHelper.makeRepayment(loanRepaymentDate, Float.parseFloat(prepayAmount), loanID); loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap); @@ -3597,7 +3604,7 @@ public class ClientLoanIntegrationTest { addRepaymentValues(expectedvalues, todaysDate, 1, false, "2517.29", "11.62", "0.0", "0.0"); verifyLoanRepaymentSchedule(loanSchedule, expectedvalues); - Float earlyPayment = Float.valueOf("5100"); + Float earlyPayment = Float.parseFloat("5100"); repaymentDate = Calendar.getInstance(Utils.getTimeZoneOfTenant()); repaymentDate.add(Calendar.DAY_OF_MONTH, -5); final String LOAN_SECOND_REPAYMENT_DATE = dateFormat.format(repaymentDate.getTime()); @@ -3616,7 +3623,7 @@ public class ClientLoanIntegrationTest { String prepayAmount = String.valueOf(prepayDetail.get("amount")); todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant()); final String loanRepaymentDate = dateFormat.format(todaysDate.getTime()); - this.loanTransactionHelper.makeRepayment(loanRepaymentDate, Float.valueOf(prepayAmount), loanID); + this.loanTransactionHelper.makeRepayment(loanRepaymentDate, Float.parseFloat(prepayAmount), loanID); loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap); @@ -3734,7 +3741,7 @@ public class ClientLoanIntegrationTest { validateNumberForEqualWithMsg("verify pre-close amount", preCloseAmount, prepayAmount); todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant()); final String loanRepaymentDate = dateFormat.format(todaysDate.getTime()); - this.loanTransactionHelper.makeRepayment(loanRepaymentDate, Float.valueOf(prepayAmount), loanID); + this.loanTransactionHelper.makeRepayment(loanRepaymentDate, Float.parseFloat(prepayAmount), loanID); loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap); } @@ -3823,7 +3830,7 @@ public class ClientLoanIntegrationTest { repaymentDate.add(Calendar.DAY_OF_MONTH, -7 * 2); final String LOAN_FIRST_REPAYMENT_DATE = dateFormat.format(repaymentDate.getTime()); Float totalDueForCurrentPeriod = (Float) loanSchedule.get(1).get("totalDueForPeriod"); - totalDueForCurrentPeriod = totalDueForCurrentPeriod - Float.valueOf("252.89"); + totalDueForCurrentPeriod = totalDueForCurrentPeriod - Float.parseFloat("252.89"); this.loanTransactionHelper.makeRepayment(LOAN_FIRST_REPAYMENT_DATE, totalDueForCurrentPeriod, loanID); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -3949,7 +3956,7 @@ public class ClientLoanIntegrationTest { String prepayAmount = String.valueOf(prepayDetail.get("amount")); todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant()); final String loanRepaymentDate = dateFormat.format(todaysDate.getTime()); - this.loanTransactionHelper.makeRepayment(loanRepaymentDate, Float.valueOf(prepayAmount), loanID); + this.loanTransactionHelper.makeRepayment(loanRepaymentDate, Float.parseFloat(prepayAmount), loanID); loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap); @@ -4192,7 +4199,7 @@ public class ClientLoanIntegrationTest { validateNumberForEqualWithMsg("verify pre-close amount", preCloseAmount, prepayAmount); todaysDate = Calendar.getInstance(Utils.getTimeZoneOfTenant()); final String loanRepaymentDate = dateFormat.format(todaysDate.getTime()); - this.loanTransactionHelper.makeRepayment(loanRepaymentDate, Float.valueOf(prepayAmount), loanID); + this.loanTransactionHelper.makeRepayment(loanRepaymentDate, Float.parseFloat(prepayAmount), loanID); loanStatusHashMap = LoanStatusChecker.getStatusOfLoan(this.requestSpec, this.responseSpec, loanID); LoanStatusChecker.verifyLoanAccountIsClosed(loanStatusHashMap); } @@ -4423,8 +4430,9 @@ public class ClientLoanIntegrationTest { loanStatusHashMap = this.loanTransactionHelper.disburseLoan(fourMonthsfromNow, loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); - final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) }; + final JournalEntry[] assetAccountInitialEntry = { + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.DEBIT) }; this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry); ArrayList loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -4437,7 +4445,7 @@ public class ClientLoanIntegrationTest { final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar); - this.loanTransactionHelper.makeRepayment(threeMonthsfromNow, Float.valueOf("2290"), loanID); + this.loanTransactionHelper.makeRepayment(threeMonthsfromNow, Float.parseFloat("2290"), loanID); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); firstInstallment = loanSchedule.get(1); @@ -4448,13 +4456,13 @@ public class ClientLoanIntegrationTest { final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar); - this.loanTransactionHelper.makeRepayment(twoMonthsfromNow, Float.valueOf("2290"), loanID); + this.loanTransactionHelper.makeRepayment(twoMonthsfromNow, Float.parseFloat("2290"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow, - new JournalEntry(Float.valueOf("2290"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("2000"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("2290"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("2000"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, twoMonthsfromNow, - new JournalEntry(Float.valueOf("50"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("240"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("50"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("240"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -4467,13 +4475,13 @@ public class ClientLoanIntegrationTest { final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar); - this.loanTransactionHelper.makeRepayment(oneMonthfromNow, Float.valueOf("4580"), loanID); + this.loanTransactionHelper.makeRepayment(oneMonthfromNow, Float.parseFloat("4580"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow, - new JournalEntry(Float.valueOf("4580"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("4000"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("4580"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("4000"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, oneMonthfromNow, - new JournalEntry(Float.valueOf("100"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("480"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("100"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("480"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -4493,10 +4501,10 @@ public class ClientLoanIntegrationTest { .setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(DateUtils.getDateTimeZoneOfTenant()).toInstant())); final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar); - this.loanTransactionHelper.makeRefundByCash(now, Float.valueOf("20"), loanID); + this.loanTransactionHelper.makeRefundByCash(now, Float.parseFloat("20"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, now, - new JournalEntry(Float.valueOf("20"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("20"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("20"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("20"), JournalEntry.TransactionType.DEBIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -4511,13 +4519,13 @@ public class ClientLoanIntegrationTest { // paid: principal 1980, interest 240, fees 50, penalty 0 // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0 - this.loanTransactionHelper.makeRefundByCash(now, Float.valueOf("2000"), loanID); + this.loanTransactionHelper.makeRefundByCash(now, Float.parseFloat("2000"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, now, - new JournalEntry(Float.valueOf("2000"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("1980"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("2000"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("1980"), JournalEntry.TransactionType.DEBIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, now, - new JournalEntry(Float.valueOf("20"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("20"), JournalEntry.TransactionType.DEBIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -4597,10 +4605,10 @@ public class ClientLoanIntegrationTest { loanStatusHashMap = this.loanTransactionHelper.disburseLoan(fourMonthsfromNow, loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); - final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("1440"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("300.00"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) }; + final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.parseFloat("1440"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("300.00"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.DEBIT) }; this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry); ArrayList loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -4613,7 +4621,7 @@ public class ClientLoanIntegrationTest { final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar); - this.loanTransactionHelper.makeRepayment(threeMonthsfromNow, Float.valueOf("2290"), loanID); + this.loanTransactionHelper.makeRepayment(threeMonthsfromNow, Float.parseFloat("2290"), loanID); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); firstInstallment = loanSchedule.get(1); @@ -4624,10 +4632,10 @@ public class ClientLoanIntegrationTest { final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar); - this.loanTransactionHelper.makeRepayment(twoMonthsfromNow, Float.valueOf("2290"), loanID); + this.loanTransactionHelper.makeRepayment(twoMonthsfromNow, Float.parseFloat("2290"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow, - new JournalEntry(Float.valueOf("2290"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("2290"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("2290"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("2290"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -4640,10 +4648,10 @@ public class ClientLoanIntegrationTest { final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar); - this.loanTransactionHelper.makeRepayment(oneMonthfromNow, Float.valueOf("4580"), loanID); + this.loanTransactionHelper.makeRepayment(oneMonthfromNow, Float.parseFloat("4580"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow, - new JournalEntry(Float.valueOf("4580"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("4580"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("4580"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("4580"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -4663,10 +4671,10 @@ public class ClientLoanIntegrationTest { .setTime(Date.from(Utils.getLocalDateOfTenant().atStartOfDay(DateUtils.getDateTimeZoneOfTenant()).toInstant())); final String now = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar); - this.loanTransactionHelper.makeRefundByCash(now, Float.valueOf("20"), loanID); + this.loanTransactionHelper.makeRefundByCash(now, Float.parseFloat("20"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, now, - new JournalEntry(Float.valueOf("20"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("20"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("20"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("20"), JournalEntry.TransactionType.DEBIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -4681,13 +4689,13 @@ public class ClientLoanIntegrationTest { // paid: principal 1980, interest 240, fees 50, penalty 0 // refund 2000 means paid: principal 0, interest 220, fees 50, penalty 0 - this.loanTransactionHelper.makeRefundByCash(now, Float.valueOf("2000"), loanID); + this.loanTransactionHelper.makeRefundByCash(now, Float.parseFloat("2000"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, now, - new JournalEntry(Float.valueOf("2000"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("1980"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("2000"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("1980"), JournalEntry.TransactionType.DEBIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, now, - new JournalEntry(Float.valueOf("20"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("20"), JournalEntry.TransactionType.DEBIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -4783,8 +4791,9 @@ public class ClientLoanIntegrationTest { loanStatusHashMap = this.loanTransactionHelper.disburseLoan(fourMonthsfromNow, loanID); LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); - final JournalEntry[] assetAccountInitialEntry = { new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("12000.00"), JournalEntry.TransactionType.DEBIT) }; + final JournalEntry[] assetAccountInitialEntry = { + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("12000.00"), JournalEntry.TransactionType.DEBIT) }; this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, fourMonthsfromNow, assetAccountInitialEntry); ArrayList loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -4797,7 +4806,7 @@ public class ClientLoanIntegrationTest { final String threeMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar); - this.loanTransactionHelper.makeRepayment(threeMonthsfromNow, Float.valueOf("2290"), loanID); + this.loanTransactionHelper.makeRepayment(threeMonthsfromNow, Float.parseFloat("2290"), loanID); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); firstInstallment = loanSchedule.get(1); @@ -4808,13 +4817,13 @@ public class ClientLoanIntegrationTest { final String twoMonthsfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar); - this.loanTransactionHelper.makeRepayment(twoMonthsfromNow, Float.valueOf("2290"), loanID); + this.loanTransactionHelper.makeRepayment(twoMonthsfromNow, Float.parseFloat("2290"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, twoMonthsfromNow, - new JournalEntry(Float.valueOf("2290"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("2000"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("2290"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("2000"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, twoMonthsfromNow, - new JournalEntry(Float.valueOf("50"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("240"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("50"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("240"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -4827,13 +4836,13 @@ public class ClientLoanIntegrationTest { final String oneMonthfromNow = Utils.convertDateToURLFormat(fourMonthsfromNowCalendar); - this.loanTransactionHelper.makeRepayment(oneMonthfromNow, Float.valueOf("4580"), loanID); + this.loanTransactionHelper.makeRepayment(oneMonthfromNow, Float.parseFloat("4580"), loanID); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, oneMonthfromNow, - new JournalEntry(Float.valueOf("4580"), JournalEntry.TransactionType.DEBIT), - new JournalEntry(Float.valueOf("4000"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("4580"), JournalEntry.TransactionType.DEBIT), + new JournalEntry(Float.parseFloat("4000"), JournalEntry.TransactionType.CREDIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, oneMonthfromNow, - new JournalEntry(Float.valueOf("100"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("480"), JournalEntry.TransactionType.CREDIT)); + new JournalEntry(Float.parseFloat("100"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("480"), JournalEntry.TransactionType.CREDIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -4861,7 +4870,7 @@ public class ClientLoanIntegrationTest { this.accountTransferHelper.refundLoanByTransfer(now, clientID, loanID, clientID, savingsId, FROM_LOAN_ACCOUNT_TYPE, TO_SAVINGS_ACCOUNT_TYPE, transferAmountValue.toString()); - Float toSavingsBalance = Float.valueOf(MINIMUM_OPENING_BALANCE); + Float toSavingsBalance = Float.parseFloat(MINIMUM_OPENING_BALANCE); HashMap toSavingsSummaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId); @@ -4872,8 +4881,8 @@ public class ClientLoanIntegrationTest { "Verifying From Savings Account Balance after Account Transfer"); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, now, - new JournalEntry(Float.valueOf("20"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("20"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("20"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("20"), JournalEntry.TransactionType.DEBIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -4903,11 +4912,11 @@ public class ClientLoanIntegrationTest { "Verifying From Savings Account Balance after Account Transfer"); this.journalEntryHelper.checkJournalEntryForAssetAccount(assetAccount, now, - new JournalEntry(Float.valueOf("2000"), JournalEntry.TransactionType.CREDIT), - new JournalEntry(Float.valueOf("1980"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("2000"), JournalEntry.TransactionType.CREDIT), + new JournalEntry(Float.parseFloat("1980"), JournalEntry.TransactionType.DEBIT)); this.journalEntryHelper.checkJournalEntryForIncomeAccount(incomeAccount, now, - new JournalEntry(Float.valueOf("20"), JournalEntry.TransactionType.DEBIT)); + new JournalEntry(Float.parseFloat("20"), JournalEntry.TransactionType.DEBIT)); loanSchedule.clear(); loanSchedule = this.loanTransactionHelper.getLoanRepaymentSchedule(this.requestSpec, this.responseSpec, loanID); @@ -5007,7 +5016,7 @@ public class ClientLoanIntegrationTest { LoanStatusChecker.verifyLoanIsActive(loanStatusHashMap); LOG.info("---------------------------------- Make repayment 1 --------------------------------------"); - this.loanTransactionHelper.makeRepayment("20 October 2011", Float.valueOf("2676.24"), loanID); + this.loanTransactionHelper.makeRepayment("20 October 2011", Float.parseFloat("2676.24"), loanID); LOG.info("---------------------------------- FORECLOSE LOAN ----------------------------------------"); this.loanTransactionHelper.forecloseLoan("08 November 2011", loanID); diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientSavingsIntegrationTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientSavingsIntegrationTest.java index f0876cf9f..b56918913 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientSavingsIntegrationTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientSavingsIntegrationTest.java @@ -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"); diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/GroupSavingsIntegrationTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/GroupSavingsIntegrationTest.java index 60327a338..e9b2b0367 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/GroupSavingsIntegrationTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/GroupSavingsIntegrationTest.java @@ -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", diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanDisbursementDetailsIntegrationTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanDisbursementDetailsIntegrationTest.java index 520a71e8f..0e83209ae 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanDisbursementDetailsIntegrationTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanDisbursementDetailsIntegrationTest.java @@ -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 disbursementDetails = (ArrayList) 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); diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/SchedulerJobsTestResults.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/SchedulerJobsTestResults.java index 18c160d8f..a4d9e6641 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/SchedulerJobsTestResults.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/SchedulerJobsTestResults.java @@ -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); } }