Search in sources :

Example 1 with CreateHolidaySubmitParameters

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

the class AdditionalHolidayTest method testBranchSpecificMoratorium.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public //http://mifosforge.jira.com/browse/MIFOSTEST-280
void testBranchSpecificMoratorium() throws Exception {
    DateTime targetTime = new DateTime(2009, 3, 11, 0, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    //Given
    CreateHolidaySubmitParameters param = getCreateHolidaySubmitParameters();
    //When / Then
    holidayTestHelper.createHoliday(param);
}
Also used : CreateHolidaySubmitParameters(org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters) DateTime(org.joda.time.DateTime)

Example 2 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(String year) {
    CreateHolidaySubmitParameters params = new CreateHolidayEntryPage.CreateHolidaySubmitParameters();
    params.setName("Holiday Test" + StringUtil.getRandomString(2));
    params.setFromDateDD("14");
    params.setFromDateMM("02");
    params.setFromDateYYYY(year);
    params.setThruDateDD("28");
    params.setThruDateMM("02");
    params.setThruDateYYYY(year);
    params.setRepaymentRule(CreateHolidaySubmitParameters.NEXT_MEETING_OR_REPAYMENT);
    params.setSelectedOfficeIds("1");
    params.addOffice("Mifos HO");
    return params;
}
Also used : CreateHolidaySubmitParameters(org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters)

Example 3 with CreateHolidaySubmitParameters

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

the class HolidayTest method holidaysRepaymentRuleNextWorkingDay.

//http://mifosforge.jira.com/browse/MIFOSTEST-81
@Test(enabled = true)
public void holidaysRepaymentRuleNextWorkingDay() throws Exception {
    //Given
    dateTimeUpdaterRemoteTestingService.setDateTime(new DateTime(2033, 1, 1, 13, 0, 0, 0));
    //When
    CreateHolidaySubmitParameters param = getHolidayParameters("2033");
    param.setRepaymentRule(CreateHolidaySubmitParameters.NEXT_WORKING_DAY);
    createHolidayForInstallments(param);
    CreateLoanAccountSearchParameters searchParameters = setSearchParameters();
    CreateLoanAccountSubmitParameters submitAccountParameters = setSubmitParameters();
    //Then
    loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters).navigateToRepaymentSchedulePage();
    loanTestHelper.verifyRepaymentScheduleForHolidays("14-Jan-2033", "21-Jan-2033", "28-Jan-2033", "04-Feb-2033", "11-Feb-2033", "01-Mar-2033", "01-Mar-2033", "04-Mar-2033", "11-Mar-2033", "18-Mar-2033");
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) CreateHolidaySubmitParameters(org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Example 4 with CreateHolidaySubmitParameters

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

the class HolidayTest method holidaysRepaymentRuleSameDay.

//http://mifosforge.jira.com/browse/MIFOSTEST-78
@Test(enabled = true)
public void holidaysRepaymentRuleSameDay() throws Exception {
    //Given
    dateTimeUpdaterRemoteTestingService.setDateTime(new DateTime(2032, 1, 1, 13, 0, 0, 0));
    //When
    CreateHolidaySubmitParameters param = getHolidayParameters("2032");
    param.setRepaymentRule(CreateHolidaySubmitParameters.SAME_DAY);
    createHolidayForInstallments(param);
    CreateLoanAccountSearchParameters searchParameters = setSearchParameters();
    CreateLoanAccountSubmitParameters submitAccountParameters = setSubmitParameters();
    //Then
    loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters).navigateToRepaymentSchedulePage();
    loanTestHelper.verifyRepaymentScheduleForHolidays("09-Jan-2032", "16-Jan-2032", "23-Jan-2032", "30-Jan-2032", "06-Feb-2032", "13-Feb-2032", "20-Feb-2032", "27-Feb-2032", "05-Mar-2032", "12-Mar-2032");
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) CreateHolidaySubmitParameters(org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Example 5 with CreateHolidaySubmitParameters

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

the class HolidayTest method createHoliday.

// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void createHoliday() throws Exception {
    //Given
    dateTimeUpdaterRemoteTestingService.setDateTime(new DateTime(2010, 1, 1, 13, 0, 0, 0));
    AdminPage adminPage = loginAndNavigateToAdminPage();
    adminPage.verifyPage();
    CreateHolidayEntryPage createHolidayEntryPage = adminPage.navigateToDefineHolidayPage();
    CreateHolidaySubmitParameters params = this.getHolidayParameters();
    CreateHolidayConfirmationPage confirmationPage = createHolidayEntryPage.submitAndNavigateToHolidayConfirmationPage(params);
    confirmationPage.submitAndNavigateToViewHolidaysPage();
    // try to create second holiday with the same date
    createHolidayEntryPage = adminPage.navigateToDefineHolidayPage();
    params.setName("Test Holiday 2");
    confirmationPage = createHolidayEntryPage.submitAndNavigateToHolidayConfirmationPage(params);
    assertTextFoundOnPage("Holiday with the same date already exists:", "Text about duplicated holidays was not found.");
}
Also used : AdminPage(org.mifos.test.acceptance.framework.admin.AdminPage) CreateHolidayConfirmationPage(org.mifos.test.acceptance.framework.holiday.CreateHolidayConfirmationPage) CreateHolidayEntryPage(org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage) CreateHolidaySubmitParameters(org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

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