use of org.mifos.test.acceptance.framework.loan.ChargeParameters in project head by mifos.
the class AdditionalHolidayTest method testHolidayAffectsFeeSchedule.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public // http://mifosforge.jira.com/browse/MIFOSTEST-281
void testHolidayAffectsFeeSchedule() throws Exception {
DateTime targetTime = new DateTime(2009, 3, 11, 0, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
// Given
ChargeParameters chargeParameters = new ChargeParameters();
String officeName = "MyOfficeDHMFT";
String centerName = "Default Center";
String groupName = "Default Group";
String clientName = "Holiday TestClient";
String loanId = "000100000000035";
CreateHolidaySubmitParameters params = new CreateHolidayEntryPage.CreateHolidaySubmitParameters();
params.setName("Holiday" + StringUtil.getRandomString(8));
params.setFromDateDD("16");
params.setFromDateMM("03");
params.setFromDateYYYY("2009");
params.setRepaymentRule(CreateHolidaySubmitParameters.MORATORIUM);
params.addOffice(officeName);
// When
chargeParameters.setType("Misc Fees");
chargeParameters.setAmount("100");
centerTestHelper.applyCharge(centerName, chargeParameters);
String centerAmount = navigationHelper.navigateToCenterViewDetailsPage(centerName).getAmountDue();
chargeParameters.setType("Misc Fees");
chargeParameters.setAmount("100");
groupTestHelper.applyCharge(groupName, chargeParameters);
String groupAmount = navigationHelper.navigateToGroupViewDetailsPage(groupName).getAmountDue();
chargeParameters.setType("Misc Fees");
chargeParameters.setAmount("100");
clientTestHelper.applyCharge(clientName, chargeParameters);
String clientAmount = navigationHelper.navigateToClientViewDetailsPage(clientName).getAmountDue();
chargeParameters.setType("loanWeeklyFee");
chargeParameters.setAmount("100");
loanTestHelper.applyChargeUsingFeeLabel(loanId, chargeParameters);
holidayTestHelper.createHoliday(params);
navigationHelper.navigateToAdminPage();
applicationDatabaseOperation.cleanBatchJobTables();
List<String> jobsToRun = new ArrayList<String>();
jobsToRun.add("ApplyHolidayChangesTaskJob");
new BatchJobHelper(selenium).runSomeBatchJobs(jobsToRun);
targetTime = new DateTime(2009, 3, 17, 0, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
navigationHelper.navigateToCenterViewDetailsPage(centerName).verifyAmountDue(centerAmount);
navigationHelper.navigateToGroupViewDetailsPage(groupName).verifyAmountDue(groupAmount);
navigationHelper.navigateToClientViewDetailsPage(clientName).verifyAmountDue(clientAmount);
navigationHelper.navigateToLoanAccountPage(loanId).navigateToRepaymentSchedulePage().verifyScheduleNotContainDate("16-Mar-2009");
}
use of org.mifos.test.acceptance.framework.loan.ChargeParameters in project head by mifos.
the class LoanTestHelper method applyCharge.
public LoanAccountPage applyCharge(String feeName, String amount) {
ChargeParameters chargeParameters = new ChargeParameters();
chargeParameters.setType(feeName);
chargeParameters.setAmount(amount);
return new LoanAccountPage(selenium).navigateToApplyCharge().submitAndNavigateToApplyChargeConfirmationPage(chargeParameters);
}
use of org.mifos.test.acceptance.framework.loan.ChargeParameters in project head by mifos.
the class ApplyChargeGroupLoanTest method applyMiscPenalty.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void applyMiscPenalty() throws Exception {
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2013, 02, 8, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
searchParameters.setSearchString("Default Group");
searchParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
List<GLIMClient> glimClients = new ArrayList<GLIMClient>();
glimClients.add(new GLIMClient(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "1500", null));
glimClients.add(new GLIMClient(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "1500", null));
LoanAccountPage loanAccountPage = loanTestHelper.createGroupLoanAccount(searchParameters, glimClients);
String loanId = loanAccountPage.getAccountId();
String penaltyAmount = "100";
List<String> individualPenaltyAmounts = new ArrayList<String>();
individualPenaltyAmounts.add("20");
individualPenaltyAmounts.add("80");
ChargeParameters params = new ChargeParameters();
params.setType(ChargeParameters.MISC_PENALTY);
params.setAmount(penaltyAmount);
params.setGroupLoanIndividualAmounts(individualPenaltyAmounts);
loanAccountPage = loanTestHelper.applyChargeToGroupLoan(loanId, params);
verifyPenaltySummaryAndActivity(loanAccountPage, penaltyAmount, "Misc penalty applied", 2);
verifyRepaymentSchedulePage(loanAccountPage, penaltyAmount);
for (int i = 0; i < glimClients.size(); i++) {
LoanAccountPage individualLoanAccountPage = loanAccountPage.navigateToIndividualLoanAccountPageFromPendingApprovalGroupLoan(i);
verifyPenaltySummaryAndActivity(individualLoanAccountPage, individualPenaltyAmounts.get(i), "Misc penalty applied", 2);
verifyRepaymentSchedulePage(individualLoanAccountPage, individualPenaltyAmounts.get(i));
individualLoanAccountPage.navigateToGroupLoanPageFromIndividualLoanPage();
}
}
use of org.mifos.test.acceptance.framework.loan.ChargeParameters in project head by mifos.
the class ViewOriginalLoanScheduleTest method createLoanAccount.
private void createLoanAccount(DateTime creationDisbursalDate, DateTime actualDisbursalDate, boolean needApplyFee) throws UnsupportedEncodingException {
navigationHelper.navigateToHomePage();
loanTestHelper.navigateToCreateLoanAccountEntryPageWithoutLogout(setLoanSearchParameters()).setDisbursalDate(creationDisbursalDate).clickContinue().clickPreviewAndGoToReviewLoanAccountPage().submit().navigateToLoanAccountDetailsPage();
if (needApplyFee) {
ChargeParameters chargeParameters = new ChargeParameters();
chargeParameters.setType(feeName);
new LoanAccountPage(selenium).navigateToApplyCharge().applyFeeAndConfirm(chargeParameters);
}
loanTestHelper.applyCharge(ChargeParameters.MISC_FEES, "10");
loanTestHelper.applyCharge(ChargeParameters.MISC_PENALTY, "10");
loanTestHelper.approveLoan();
loanTestHelper.disburseLoan(actualDisbursalDate);
}
use of org.mifos.test.acceptance.framework.loan.ChargeParameters in project head by mifos.
the class ViewOriginalLoanScheduleTest method verifyForDecBalIntReCalcLoanEarlyDisbursalLSIMOn.
@Test(enabled = true)
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyForDecBalIntReCalcLoanEarlyDisbursalLSIMOn() throws Exception {
int interestType = DefineNewLoanProductPage.SubmitFormParameters.DECLINING_BALANCE_INTEREST_RECALCULATION;
applicationDatabaseOperation.updateLSIM(1);
createLoanProduct(interestType, false);
navigationHelper.navigateToHomePage();
loanTestHelper.navigateToCreateLoanAccountEntryPageWithoutLogout(setLoanSearchParameters()).setDisbursalDate(systemDateTime.plusDays(1)).clickContinue().clickPreviewAndGoToReviewLoanAccountPage().submit().navigateToLoanAccountDetailsPage();
ChargeParameters chargeParameters = new ChargeParameters();
chargeParameters.setType(feeName);
new LoanAccountPage(selenium).navigateToApplyCharge().applyFeeAndConfirm(chargeParameters);
loanTestHelper.applyCharge(ChargeParameters.MISC_FEES, "10");
loanTestHelper.applyCharge(ChargeParameters.MISC_PENALTY, "10");
loanTestHelper.approveLoan();
loanTestHelper.disburseLoan(systemDateTime);
String[][] tableOnOriginalInstallment = OriginalScheduleData.DEC_BAL_INT_RECALC_LOAN_EARLY_DISBURSAL_SCHEDULE_ON;
verifyOriginalSchedule(tableOnOriginalInstallment);
loanTestHelper.applyCharge(ChargeParameters.MISC_FEES, "10");
loanTestHelper.applyCharge(ChargeParameters.MISC_PENALTY, "10");
verifyOriginalSchedule(tableOnOriginalInstallment);
loanTestHelper.makePayment(systemDateTime.plusDays(15), "100");
verifyOriginalSchedule(tableOnOriginalInstallment);
// loanTestHelper.applyCharge(ChargeParameters.MISC_FEES, "10");
// loanTestHelper.applyCharge(ChargeParameters.MISC_PENALTY, "10");
// verifyOriginalSchedule(tableOnOriginalInstallment);
applicationDatabaseOperation.updateLSIM(0);
}
Aggregations