use of org.mifos.test.acceptance.framework.loan.DisburseLoanParameters in project head by mifos.
the class LoanAccountCycleTest method verifyAmountsByLastAmountAndInstallmentsByCycle.
/**
* Verify loan amount with number of installments by loan cycle can be used to create new loans.
* http://mifosforge.jira.com/browse/MIFOSTEST-114
*
* @throws Exception
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyAmountsByLastAmountAndInstallmentsByCycle() throws Exception {
DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
productParams.setOfferingName("product114");
productParams.setOfferingShortName("p114");
productParams.setCalculateLoanAmount(SubmitFormParameters.BY_LAST_LOAN_AMOUNT);
String[][] lastLoanAmount = getAmountsFromLastAmount();
productParams.setAmountsByLastLoanAmount(lastLoanAmount);
productParams.setCalculateInstallments(SubmitFormParameters.BY_LOAN_CYCLE);
String[][] calculateInstallments = getInstallmentsByCycle();
productParams.setCycleInstallments(calculateInstallments);
CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
searchParams.setSearchString("Stu1233171716380 Client1233171716380");
searchParams.setLoanProduct("product114");
DisburseLoanParameters disburseParams = DisburseLoanParameters.getDisbursalParameters("25", "02", "2011");
LoanProductDetailsPage loanProductDetailsPage = loanProductTestHelper.defineNewLoanProduct(productParams);
loanProductDetailsPage.verifyAmountTableTypeFromLastAmount(lastLoanAmount);
loanProductDetailsPage.verifyInstallmentsTableTypeFromCycle(calculateInstallments);
LoanAccountPage loanAccountPage = loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "500", "1,500", "1200.0" }, null, new String[] { "26", "52", "52" });
String loanFirstID = loanAccountPage.getAccountId();
loanAccountPage.disburseLoan(disburseParams);
loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "500", "1,500", "1200.0" }, null, new String[] { "20", "30", "30" });
loanTestHelper.repayLoan(loanFirstID);
loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "1,500", "2,500", "2200.0" }, null, new String[] { "20", "30", "30" });
}
use of org.mifos.test.acceptance.framework.loan.DisburseLoanParameters in project head by mifos.
the class LoanAccountCycleTest method verifyAmountByLastAmountAndInstallmentsSameForAll.
/**
* Verify loan amount with number of installments is same for all loan can be used to create new loans.
* http://mifosforge.jira.com/browse/MIFOSTEST-112
*
* @throws Exception
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyAmountByLastAmountAndInstallmentsSameForAll() throws Exception {
DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
productParams.setOfferingName("product112");
productParams.setOfferingShortName("p112");
productParams.setCalculateLoanAmount(SubmitFormParameters.BY_LAST_LOAN_AMOUNT);
String[][] lastLoanAmount = getAmountsFromLastAmount();
productParams.setAmountsByLastLoanAmount(lastLoanAmount);
productParams.setMinInstallemnts("10");
productParams.setMaxInstallments("100");
productParams.setDefInstallments("50");
CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
searchParams.setSearchString("Stu1233171716380 Client1233171716380");
searchParams.setLoanProduct("product112");
DisburseLoanParameters disburseParams = DisburseLoanParameters.getDisbursalParameters("25", "02", "2011");
LoanProductDetailsPage loanProductDetailsPage = loanProductTestHelper.defineNewLoanProduct(productParams);
loanProductDetailsPage.verifyAmountTableTypeFromLastAmount(lastLoanAmount);
loanProductDetailsPage.verifyInstallments("10", "100", "50");
LoanAccountPage loanAccountPage = loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "500", "1,500", "1200.0" }, null, null);
String loanFirstID = loanAccountPage.getAccountId();
loanAccountPage.disburseLoan(disburseParams);
loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "500", "1,500", "1200.0" }, null, null);
loanTestHelper.repayLoan(loanFirstID);
loanTestHelper.createWithVerificationAndActivationLoanAccount(searchParams, new String[] { "1,500", "2,500", "2200.0" }, null, null);
}
use of org.mifos.test.acceptance.framework.loan.DisburseLoanParameters in project head by mifos.
the class LoanAccountPerformanceHistoryTest method repayMultipleLoansAndVerifyPerformanceHistory.
// http://mifosforge.jira.com/browse/MIFOSTEST-359
@Test(enabled = true)
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void repayMultipleLoansAndVerifyPerformanceHistory() throws Exception {
//Given
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
searchParameters.setLoanProduct("WeeklyClientFlatLoanWithNoFee");
searchParameters.setSearchString("WeeklyOld Monday");
submitAccountParameters.setInterestRate("24.0");
submitAccountParameters.setNumberOfInstallments("10");
submitAccountParameters.setLoanPurpose("0008-Animal Trading");
DisburseLoanParameters disburseParameters = new DisburseLoanParameters();
disburseParameters.setDisbursalDateDD("04");
disburseParameters.setDisbursalDateMM("03");
disburseParameters.setDisbursalDateYYYY("2011");
disburseParameters.setPaymentType(PaymentParameters.CASH);
PerformanceHistoryAtributes performanceHistoryAtributes = new PerformanceHistoryAtributes();
performanceHistoryAtributes.setDelinquentPortfolio(0.0);
//When
Map<String, String> loanIds = new HashMap<String, String>();
submitAccountParameters.setAmount("2000.0");
loanIds.put(submitAccountParameters.getAmount(), loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters).getAccountId());
performanceHistoryAtributes.incrementLoanCycle();
performanceHistoryAtributes.incrementLoanCycleForProduct(searchParameters.getLoanProduct());
submitAccountParameters.setAmount("3000.0");
loanIds.put(submitAccountParameters.getAmount(), loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters).getAccountId());
performanceHistoryAtributes.incrementLoanCycle();
performanceHistoryAtributes.incrementLoanCycleForProduct(searchParameters.getLoanProduct());
submitAccountParameters.setAmount("5000.0");
searchParameters.setLoanProduct("AnotherWeeklyClientFlatLoanWithNoFee");
loanIds.put(submitAccountParameters.getAmount(), loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters).getAccountId());
performanceHistoryAtributes.incrementLoanCycle();
performanceHistoryAtributes.incrementLoanCycleForProduct(searchParameters.getLoanProduct());
EditLoanAccountStatusParameters params = new EditLoanAccountStatusParameters();
params.setStatus(EditLoanAccountStatusParameters.APPROVED);
params.setNote("Approved.");
Set<String> amounts = loanIds.keySet();
for (String accountid : loanIds.values()) {
loanTestHelper.changeLoanAccountStatus(accountid, params);
loanTestHelper.disburseLoan(accountid, disburseParameters);
performanceHistoryAtributes.incrementNoOfActiveLoan();
}
//Then
for (String amount : amounts) {
loanTestHelper.repayLoan(loanIds.get(amount));
String lastLoan = amount.substring(0, amount.length() - 2);
lastLoan = lastLoan.substring(0, 1) + "," + lastLoan.substring(1);
performanceHistoryAtributes.setAmountOfLastLoan(lastLoan);
performanceHistoryAtributes.decrementNoOfActiveLoan();
loanTestHelper.verifyPerformenceHistory(searchParameters.getSearchString(), performanceHistoryAtributes);
}
}
use of org.mifos.test.acceptance.framework.loan.DisburseLoanParameters in project head by mifos.
the class DecliningPrincipleLoanTest method verifyOverdue.
private void verifyOverdue() throws UnsupportedEncodingException {
propertiesHelper.setOverdueInterestPaidFirst("true");
DateTime testDateTime = new DateTime(2010, 10, 12, 0, 0, 0, 0);
loanTestHelper.setApplicationTime(testDateTime);
DisburseLoanParameters disburseParams = new DisburseLoanParameters();
disburseParams.setDisbursalDateDD("12");
disburseParams.setDisbursalDateMM("10");
disburseParams.setDisbursalDateYYYY("2010");
disburseParams.setPaymentType(DisburseLoanParameters.CASH);
LoanAccountPage loanAccountPage = loanTestHelper.createLoanAccount(clientName, "WeeklyPawdepLoan").changeAccountStatusToAccepted().disburseLoan(disburseParams);
String accountId = loanAccountPage.getAccountId();
loanTestHelper.setApplicationTime(testDateTime.plusWeeks(5));
verifyOverdueSummary(accountId);
verifyOverduePayment(accountId, testDateTime);
}
use of org.mifos.test.acceptance.framework.loan.DisburseLoanParameters in project head by mifos.
the class PenaltyTest method verifyRepaymentSchelude.
private void verifyRepaymentSchelude(LoanAccountPage loanAccountPage, String penalty, String payment, String diff) {
DisburseLoanParameters disburseLoanParameters = new DisburseLoanParameters();
disburseLoanParameters.setPaymentType(DisburseLoanParameters.CASH);
loanAccountPage.navigateToDisburseLoan().submitAndNavigateToDisburseLoanConfirmationPage(disburseLoanParameters).submitAndNavigateToLoanAccountPage();
ViewRepaymentSchedulePage repaymentSchedulePage = loanAccountPage.navigateToRepaymentSchedulePage();
repaymentSchedulePage.verifyRepaymentScheduleTablePenalties(3, penalty);
ApplyPaymentPage paymentPage = repaymentSchedulePage.navigateToApplyPaymentPage();
PaymentParameters paymentParameters = new PaymentParameters();
paymentParameters.setTransactionDateDD("28");
paymentParameters.setTransactionDateMM("02");
paymentParameters.setTransactionDateYYYY("2011");
paymentParameters.setAmount(payment);
paymentParameters.setPaymentType(PaymentParameters.CASH);
paymentPage.submitAndNavigateToApplyPaymentConfirmationPage(paymentParameters).submitAndNavigateToLoanAccountDetailsPage().navigateToRepaymentSchedulePage();
repaymentSchedulePage.verifyRepaymentScheduleTableRow(3, 6, payment);
repaymentSchedulePage.verifyRepaymentScheduleTableRow(3, 8, payment);
repaymentSchedulePage.verifyRepaymentScheduleTableRow(5, 6, diff);
repaymentSchedulePage.verifyRunningBalanceTableRow(3, 3, diff);
ApplyAdjustmentPage adjustmentPage = repaymentSchedulePage.navigateToApplyAdjustment();
adjustmentPage.fillAdjustmentFieldsAndSubmit(payment).navigateToRepaymentSchedulePage();
repaymentSchedulePage.verifyRepaymentScheduleTablePenalties(3, penalty);
}
Aggregations