Search in sources :

Example 6 with CreateHolidaySubmitParameters

use of org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters 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");
}
Also used : BatchJobHelper(org.mifos.test.acceptance.framework.testhelpers.BatchJobHelper) ArrayList(java.util.ArrayList) CreateHolidaySubmitParameters(org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters) DateTime(org.joda.time.DateTime) ChargeParameters(org.mifos.test.acceptance.framework.loan.ChargeParameters)

Example 7 with CreateHolidaySubmitParameters

use of org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters in project head by mifos.

the class AdditionalHolidayTest method getCreateHolidaySubmitParameters.

private CreateHolidaySubmitParameters getCreateHolidaySubmitParameters() {
    CreateHolidaySubmitParameters params = new CreateHolidayEntryPage.CreateHolidaySubmitParameters();
    params.setName("Holiday" + StringUtil.getRandomString(8));
    params.setFromDateDD("01");
    params.setFromDateMM("02");
    params.setFromDateYYYY("2011");
    params.setThruDateDD("14");
    params.setThruDateMM("02");
    params.setThruDateYYYY("2011");
    params.setRepaymentRule(CreateHolidaySubmitParameters.MORATORIUM);
    params.addOffice("MyOfficeDHMFT");
    return params;
}
Also used : CreateHolidaySubmitParameters(org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters)

Example 8 with CreateHolidaySubmitParameters

use of org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters in project head by mifos.

the class AdditionalHolidayTest method testHolidayLoanDisbursement.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void testHolidayLoanDisbursement() throws Exception {
    DateTime targetTime = new DateTime(2020, 8, 9, 0, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    String officeName = "MyOfficeDHMFT";
    String loanId = "000100000000035";
    CreateHolidaySubmitParameters holidayParams = new CreateHolidayEntryPage.CreateHolidaySubmitParameters();
    holidayParams.setName("Holiday" + StringUtil.getRandomString(8));
    holidayParams.setFromDateDD("16");
    holidayParams.setFromDateMM("08");
    holidayParams.setFromDateYYYY("2020");
    holidayParams.setRepaymentRule(CreateHolidaySubmitParameters.MORATORIUM);
    holidayParams.addOffice(officeName);
    holidayTestHelper.createHoliday(holidayParams);
    DateTime targetTime1 = new DateTime(2020, 8, 16, 0, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime1);
    DisburseLoanParameters disburseParams = new DisburseLoanParameters();
    disburseParams.setDisbursalDateDD("16");
    disburseParams.setDisbursalDateMM("08");
    disburseParams.setDisbursalDateYYYY("2020");
    disburseParams.setPaymentType(DisburseLoanParameters.CASH);
    loanTestHelper.prepareToDisburseLoan(loanId).submitAndNavigateToDisburseLoanConfirmationPage(disburseParams).submitButDisbursalFailed("Disbursement date must be on a working day.");
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateHolidaySubmitParameters(org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters) DateTime(org.joda.time.DateTime)

Example 9 with CreateHolidaySubmitParameters

use of org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters in project head by mifos.

the class HolidayTest method holidaysRepaymentRuleSameDayWithBatchJobs.

//http://mifosforge.jira.com/browse/MIFOSTEST-74
@Test(enabled = true)
public void holidaysRepaymentRuleSameDayWithBatchJobs() throws Exception {
    //Given
    dateTimeUpdaterRemoteTestingService.setDateTime(new DateTime(2035, 1, 1, 13, 0, 0, 0));
    //When
    CreateLoanAccountSearchParameters searchParameters = setSearchParameters();
    CreateLoanAccountSubmitParameters submitAccountParameters = setSubmitParameters();
    LoanAccountPage page = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters);
    String lid = page.getAccountId();
    page.navigateToRepaymentSchedulePage();
    loanTestHelper.verifyRepaymentScheduleForHolidays("12-Jan-2035", "19-Jan-2035", "26-Jan-2035", "02-Feb-2035", "09-Feb-2035", "16-Feb-2035", "23-Feb-2035", "02-Mar-2035", "09-Mar-2035", "16-Mar-2035");
    CreateHolidaySubmitParameters param = getHolidayParameters("2035");
    param.setRepaymentRule(CreateHolidaySubmitParameters.SAME_DAY);
    createHolidayForInstallments(param);
    //Then
    runBatchJobsForHoliday();
    navigationHelper.navigateToLoanAccountPage(lid).navigateToRepaymentSchedulePage();
    loanTestHelper.verifyRepaymentScheduleForHolidays("12-Jan-2035", "19-Jan-2035", "26-Jan-2035", "02-Feb-2035", "09-Feb-2035", "16-Feb-2035", "23-Feb-2035", "02-Mar-2035", "09-Mar-2035", "16-Mar-2035");
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) CreateHolidaySubmitParameters(org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Example 10 with CreateHolidaySubmitParameters

use of org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters in project head by mifos.

the class HolidayTest method getHolidayParameters.

private CreateHolidaySubmitParameters getHolidayParameters() {
    CreateHolidaySubmitParameters params = new CreateHolidayEntryPage.CreateHolidaySubmitParameters();
    params.setName("Holiday Test" + StringUtil.getRandomString(2));
    params.setFromDateDD("14");
    params.setFromDateMM("02");
    params.setFromDateYYYY("2010");
    params.setThruDateDD("28");
    params.setThruDateMM("02");
    params.setThruDateYYYY("2010");
    params.setRepaymentRule(CreateHolidaySubmitParameters.NEXT_MEETING_OR_REPAYMENT);
    params.addOffice("Mifos HO");
    return params;
}
Also used : CreateHolidaySubmitParameters(org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters)

Aggregations

CreateHolidaySubmitParameters (org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters)12 DateTime (org.joda.time.DateTime)9 Test (org.testng.annotations.Test)6 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)4 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)4 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)2 ArrayList (java.util.ArrayList)1 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)1 CreateHolidayConfirmationPage (org.mifos.test.acceptance.framework.holiday.CreateHolidayConfirmationPage)1 CreateHolidayEntryPage (org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage)1 ChargeParameters (org.mifos.test.acceptance.framework.loan.ChargeParameters)1 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)1 BatchJobHelper (org.mifos.test.acceptance.framework.testhelpers.BatchJobHelper)1