Search in sources :

Example 11 with RedoLoanDisbursalParameters

use of org.mifos.test.acceptance.framework.loan.RedoLoanDisbursalParameters in project head by mifos.

the class RedoLoanDisbursalTest method redoLoanOnPastDateWithLSIMAndGLIM.

/**
     * Verify whether a loan can be redone on a past date with GLIM and LSIM turned on.
     * http://mifosforge.jira.com/browse/MIFOSTEST-18
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void redoLoanOnPastDateWithLSIMAndGLIM() throws Exception {
    applicationDatabaseOperation.updateGLIM(1);
    applicationDatabaseOperation.updateLSIM(1);
    RedoLoanDisbursalParameters paramsPastDate = new RedoLoanDisbursalParameters();
    paramsPastDate.setDisbursalDateDD("21");
    paramsPastDate.setDisbursalDateMM("02");
    paramsPastDate.setDisbursalDateYYYY("2012");
    paramsPastDate.addClient(1, "3000.0", "0009-Horse");
    paramsPastDate.addClient(2, "3000.0", "0001-Cow Purchase");
    LoanAccountPage loanAccountPage = loanTestHelper.redoLoanDisbursalWithGLIMandLSIM("Default Group", "GroupEmergencyLoan", paramsPastDate);
    loanAccountPage.verifyStatus(LoanAccountPage.ACTIVE);
    loanAccountPage.verifyPrincipalOriginal("6,000");
}
Also used : RedoLoanDisbursalParameters(org.mifos.test.acceptance.framework.loan.RedoLoanDisbursalParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage)

Example 12 with RedoLoanDisbursalParameters

use of org.mifos.test.acceptance.framework.loan.RedoLoanDisbursalParameters in project head by mifos.

the class RedoLoanDisbursalTest method redoLoanDisbursalWithPastDateUnpaid.

/*
     * Verify that the status of the loan is Active in Good Standing
     * when the loan is not wholly paid off before current date.
     * Also verifies that loan cannot be redone on a date equal to
     * or greater than the current date.
     *
     * http://mifosforge.jira.com/browse/MIFOSTEST-15
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void redoLoanDisbursalWithPastDateUnpaid() throws Exception {
    // Testing redo loan
    RedoLoanDisbursalParameters paramsPastDate = new RedoLoanDisbursalParameters();
    paramsPastDate.setDisbursalDateDD("25");
    paramsPastDate.setDisbursalDateMM("02");
    paramsPastDate.setDisbursalDateYYYY("2011");
    paramsPastDate.setLoanAmount("3000.0");
    paramsPastDate.setInterestRate("10");
    paramsPastDate.setNumberOfInstallments("52");
    RedoLoanDisbursalParameters paramsCurrentDate = new RedoLoanDisbursalParameters();
    paramsCurrentDate.setDisbursalDateDD("22");
    paramsCurrentDate.setDisbursalDateMM("2");
    paramsCurrentDate.setDisbursalDateYYYY("2012");
    LoanAccountPage loanAccountPage = loanTestHelper.redoLoanDisbursal("Default Group", "WeeklyGroupFlatLoanWithOnetimeFee", paramsPastDate, paramsCurrentDate, 0, true);
    loanAccountPage.verifyStatus("Active in Good Standing");
    loanAccountPage.verifyPerformanceHistory("51", "0");
    // Testing multiple reverse payments
    String payAmount = "63";
    String reverseNote = "Reversed ";
    int loanBalance = (int) (Float.parseFloat(loanAccountPage.getTotalBalance()) + 63 * 3);
    for (int i = 0; i < 3; i++) {
        ApplyAdjustmentPage applyAdjustmentPage = loanAccountPage.navigateToApplyAdjustment();
        applyAdjustmentPage.verifyAdjustment(payAmount, reverseNote + (i + 1));
    }
    verifyMultipleReversePayments(loanAccountPage, payAmount, reverseNote, loanBalance);
}
Also used : ApplyAdjustmentPage(org.mifos.test.acceptance.framework.loan.ApplyAdjustmentPage) RedoLoanDisbursalParameters(org.mifos.test.acceptance.framework.loan.RedoLoanDisbursalParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage)

Aggregations

RedoLoanDisbursalParameters (org.mifos.test.acceptance.framework.loan.RedoLoanDisbursalParameters)12 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)8 RedoLoanDisbursalEntryPage (org.mifos.test.acceptance.framework.loan.RedoLoanDisbursalEntryPage)4 RedoLoanDisbursalSchedulePreviewPage (org.mifos.test.acceptance.framework.loan.RedoLoanDisbursalSchedulePreviewPage)3 DateTime (org.joda.time.DateTime)2 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)1 ApplyAdjustmentPage (org.mifos.test.acceptance.framework.loan.ApplyAdjustmentPage)1 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)1 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)1 RedoLoanAccountPreviewPage (org.mifos.test.acceptance.framework.loan.RedoLoanAccountPreviewPage)1 RedoLoanDisbursalChooseLoanInstancePage (org.mifos.test.acceptance.framework.loan.RedoLoanDisbursalChooseLoanInstancePage)1 RedoLoanDisbursalSearchPage (org.mifos.test.acceptance.framework.loan.RedoLoanDisbursalSearchPage)1 RedoLoanDisbursalSearchResultsPage (org.mifos.test.acceptance.framework.loan.RedoLoanDisbursalSearchResultsPage)1 TransactionHistoryPage (org.mifos.test.acceptance.framework.loan.TransactionHistoryPage)1 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)1 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)1 SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)1 Test (org.testng.annotations.Test)1