use of org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationParameters in project head by mifos.
the class CreateGLIMLoanAccountTest method checkGLIMLoanCreatedBySubmitForApproval.
/*
* This test is to verify that you can edit a GLIM loan account after it has been
* dibursed without getting an invalid disbursal date error. See MIFOS-2597.
*/
// http://mifosforge.jira.com/browse/MIFOSTEST-132
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
//TODO http://mifosforge.jira.com/browse/MIFOS-5081
@Test(enabled = false)
public void checkGLIMLoanCreatedBySubmitForApproval() throws Exception {
//Given
applicationDatabaseOperation.updateGLIM(1);
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 03, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
//When
ClientsAndAccountsHomepage clientsAndAccountsHomepage = navigationHelper.navigateToClientsAndAccountsPage();
CreateLoanAccountSearchPage createLoanAccountSearchPage = clientsAndAccountsHomepage.navigateToCreateLoanAccountUsingLeftMenu();
CreateLoanAccountSearchParameters formParameters = new CreateLoanAccountSearchParameters();
formParameters.setSearchString("Default Group");
formParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
CreateLoanAccountEntryPage createLoanAccountEntryPage = createLoanAccountSearchPage.searchAndNavigateToCreateLoanAccountPage(formParameters);
createLoanAccountEntryPage.navigateToReviewInstallmentsPage();
verifyGLIMErrorMessage();
createLoanAccountEntryPage.setDisbursalDate(new DateTime(2011, 3, 04, 15, 0, 0, 0));
createLoanAccountEntryPage.selectGLIMClients(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "9999.9", "0009-Horse");
createLoanAccountEntryPage.selectGLIMClients(1, "Stu1233266309851 Client1233266309851 Client Id: 0002-000000013", "9999.9", "0001-Cow Purchase");
createLoanAccountEntryPage.selectGLIMClients(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "9999.9", "0003-Goat Purchase");
createLoanAccountEntryPage.selectGLIMClients(3, "Holiday TestClient Client Id: 0002-000000023", "9999.9", "0003-Goat Purchase");
selectAdditionalFees();
CreateLoanAccountReviewInstallmentPage createLoanAccountReviewInstallmentPage = createLoanAccountEntryPage.navigateToReviewInstallmentsPage();
verifyFirstInstallmentAndDisbursalDateOnReviewPage();
verifyAdditionalFeesOnReviewPage();
CreateLoanAccountPreviewPage createLoanAccountPreviewPage = createLoanAccountReviewInstallmentPage.clickPreviewAndGoToReviewLoanAccountPage();
verifyFirstInstallmentAndDisbursalDateOnPreviewPage();
CreateLoanAccountConfirmationPage createLoanAccountConfirmationPage = createLoanAccountPreviewPage.submitForApprovalAndNavigateToConfirmationPage();
LoanAccountPage loanAccountPage = createLoanAccountConfirmationPage.navigateToLoanAccountDetailsPage();
String loanId = loanAccountPage.getAccountId();
loanAccountPage.verifyLoanIsPendingApproval();
loanAccountPage.verifyNumberOfInstallments("4");
loanAccountPage.verifyDisbursalDate("04/03/2011");
loanAccountPage.verifyPrincipalOriginal("39999.6");
loanAccountPage.verifyLoanTotalBalance("41147.0");
loanAccountPage.verifyFeesOriginal("410.0");
loanAccountPage.verifyInterestOriginal("737.4");
verifyFees();
ViewRepaymentSchedulePage viewRepaymentSchedulePage = loanAccountPage.navigateToViewRepaymentSchedule();
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(3, "11-Mar-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(4, "18-Mar-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(5, "25-Mar-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableDueDate(6, "01-Apr-2011");
viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(3, "9999.9");
viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(4, "9999.9");
viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(5, "9999.9");
viewRepaymentSchedulePage.verifyRepaymentScheduleTablePrincipal(6, "9999.9");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(3, "110.0");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(4, "100.0");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(5, "100.0");
viewRepaymentSchedulePage.verifyRepaymentScheduleTableFees(6, "100.0");
viewRepaymentSchedulePage.navigateToLoanAccountPage();
loanId = loanAccountPage.getAccountId();
dateTimeUpdaterRemoteTestingService.setDateTime(new LocalDate(2011, 3, 8).toDateTimeAtStartOfDay());
EditLoanAccountStatusParameters statusParameters = new EditLoanAccountStatusParameters();
statusParameters.setStatus(EditLoanAccountStatusParameters.APPROVED);
statusParameters.setNote("Test");
loanTestHelper.changeLoanAccountStatus(loanId, statusParameters);
DisburseLoanParameters params = new DisburseLoanParameters();
params.setDisbursalDateDD("8");
params.setDisbursalDateMM("3");
params.setDisbursalDateYYYY("2011");
params.setPaymentType(DisburseLoanParameters.CASH);
loanTestHelper.disburseLoan(loanId, params);
dateTimeUpdaterRemoteTestingService.setDateTime(new LocalDate(2011, 3, 15).toDateTimeAtStartOfDay());
EditLoanAccountInformationParameters editLoanAccountInformationParameters = new EditLoanAccountInformationParameters();
editLoanAccountInformationParameters.setExternalID("ID2323ID");
loanTestHelper.changeLoanAccountInformation(loanId, new CreateLoanAccountSubmitParameters(), editLoanAccountInformationParameters);
applicationDatabaseOperation.updateGLIM(0);
}
Aggregations