Search in sources :

Example 56 with CreateLoanAccountSearchParameters

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

the class CreateLSIMClientLoanAccountTest method createWeeklyLoanAccountWithNonMeetingDatesForDisburseAndRepay.

// http://mifosforge.jira.com/browse/MIFOSTEST-121
@Test(enabled = true)
public void createWeeklyLoanAccountWithNonMeetingDatesForDisburseAndRepay() throws Exception {
    //Given
    setTime(2011, 02, 23);
    //When
    DefineNewLoanProductPage.SubmitFormParameters defineNewLoanProductformParameters = FormParametersHelper.getWeeklyLoanProductParameters();
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Stu1233171716380 Client1233171716380");
    searchParameters.setLoanProduct(defineNewLoanProductformParameters.getOfferingName());
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters = createSearchParameters("23", "02", "2011");
    submitAccountParameters.setLoanPurpose("0008-Animal Trading");
    EditLoanAccountStatusParameters editLoanAccountStatusParameters = new EditLoanAccountStatusParameters();
    editLoanAccountStatusParameters.setStatus(AccountStatus.LOAN_APPROVED.getStatusText());
    editLoanAccountStatusParameters.setNote("activate account");
    DisburseLoanParameters disburseLoanParameters = new DisburseLoanParameters();
    disburseLoanParameters = createDisubreseLoanParameters("24", "02", "2011");
    loanProductTestHelper.defineNewLoanProduct(defineNewLoanProductformParameters);
    String loanId = loanTestHelper.createLoanAccount(searchParameters, submitAccountParameters).getAccountId();
    loanTestHelper.changeLoanAccountStatus(loanId, editLoanAccountStatusParameters);
    //Then
    loanTestHelper.disburseLoanWithWrongParams(loanId, disburseLoanParameters, "Date of transaction can not be a future date.");
    disburseLoanParameters.setDisbursalDateDD("23");
    loanTestHelper.disburseLoan(loanId, disburseLoanParameters);
    //loanTestHelper.disburseLoan(loanId, disburseLoanParameters);
    loanTestHelper.repayLoan(loanId);
}
Also used : EditLoanAccountStatusParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters) DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) Test(org.testng.annotations.Test)

Example 57 with CreateLoanAccountSearchParameters

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

the class CreateLSIMClientLoanAccountTest method newMonthlyClientLoanAccountWithMeetingOnSpecificDayOfMonth.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
// one of the dependent methods throws Exception
@Test(enabled = true)
public void newMonthlyClientLoanAccountWithMeetingOnSpecificDayOfMonth() throws Exception {
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Client - Mary Monthly1");
    searchParameters.setLoanProduct("MonthlyClientFlatLoan1stOfMonth");
    expectedDate = "05-Feb-2010";
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters.setAmount("1234.0");
    submitAccountParameters.setLoanPurpose("0008-Animal Trading");
    // create LSIM loan that has repayments on 5th of every month
    submitAccountParameters.setLsimFrequencyMonths("on");
    submitAccountParameters.setLsimMonthTypeDayOfMonth("on");
    submitAccountParameters.setLsimDayOfMonth("5");
    submitAccountParameters.setLoanPurpose("0010-Camel");
    createLSIMLoanAndCheckAmountAndInstallmentDate(searchParameters, submitAccountParameters, expectedDate);
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) Test(org.testng.annotations.Test)

Example 58 with CreateLoanAccountSearchParameters

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

the class CreateLSIMClientLoanAccountTest method newWeeklyLSIMClientLoanAccount.

@Test(enabled = true, groups = { "loan", "acceptance", "ui" })
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public // http://mifosforge.jira.com/browse/MIFOSTEST-127
void newWeeklyLSIMClientLoanAccount() throws Exception {
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Stu1233171716380 Client1233171716380");
    searchParameters.setLoanProduct("WeeklyFlatLoanWithOneTimeFees");
    expectedDate = "29-Jan-2010";
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters.setAmount("9012.0");
    submitAccountParameters.setLsimFrequencyWeeks("on");
    submitAccountParameters.setLsimWeekFrequency("1");
    submitAccountParameters.setLsimWeekDay("Friday");
    submitAccountParameters.setLoanPurpose("0008-Animal Trading");
    createLSIMLoanAndCheckAmountAndInstallmentDate(searchParameters, submitAccountParameters, expectedDate);
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) Test(org.testng.annotations.Test)

Example 59 with CreateLoanAccountSearchParameters

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

the class ProperLoanProductCalculationsTest method verifyProperCalculationsFixedProductNonDefaultProperties.

/**
     * Verify declining balance, fixed payment interest loan with non-default
     * accounting rules for digits after decimals and rounding mode properties are
     * used to generate and present calculations accurately and are reflected in Admin System Information.
     * http://mifosforge.jira.com/browse/MIFOSTEST-70
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyProperCalculationsFixedProductNonDefaultProperties() throws Exception {
    customPropertiesHelper.setDigitsAfterDecimal(2);
    customPropertiesHelper.setCurrencyRoundingMode(CustomPropertiesHelper.ROUNDING_MODE_FLOOR);
    customPropertiesHelper.setInitialRoundingMode(CustomPropertiesHelper.ROUNDING_MODE_HALF_UP);
    customPropertiesHelper.setFinalRoundingMode(CustomPropertiesHelper.ROUNDING_MODE_HALF_UP);
    customPropertiesHelper.setInitialRoundOffMultiple("0.5");
    customPropertiesHelper.setFinalRoundOffMultiple("0.1");
    DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
    String productName = "LoanProduct" + StringUtil.getRandomString(5);
    productParams.setOfferingName(productName);
    productParams.setOfferingShortName(StringUtil.getRandomString(4));
    productParams.setDefaultInterestRate("9.5");
    productParams.setMinInterestRate("5");
    productParams.setInterestTypes(SubmitFormParameters.DECLINING_BALANCE_EPI);
    productParams.setDefaultLoanAmount("19999.9");
    productParams.setDefInstallments("79");
    productParams.setMaxInstallments("79");
    CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
    searchParams.setSearchString("Stu1233266063395 Client1233266063395");
    searchParams.setLoanProduct(productName);
    loanProductTestHelper.defineNewLoanProduct(productParams);
    LoanAccountPage loanAccountPage = loanTestHelper.createAndActivateDefaultLoanAccount(searchParams);
    loanAccountPage.verifyPrincipalOriginal("19,999.9");
    loanAccountPage.verifyInterestOriginal("1,457.5");
    loanAccountPage.verifyFeesOriginal("0");
    loanAccountPage.verifyPenaltyOriginal("0");
    loanAccountPage.verifyTotalOriginalLoan("21457.4");
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage)

Example 60 with CreateLoanAccountSearchParameters

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

the class ProperLoanProductCalculationsTest method verifyProperInterestAndPaymentWeeklyDecliningBalanceProduct.

/**
     * Declining balance, fixed payment type weekly loan calculates and
     * displays proper interest and payment information.
     * http://mifosforge.jira.com/browse/MIFOSTEST-66
     * @throws Exception
     */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyProperInterestAndPaymentWeeklyDecliningBalanceProduct() throws Exception {
    DefineNewLoanProductPage.SubmitFormParameters productParams = FormParametersHelper.getWeeklyLoanProductParameters();
    String productName = "LoanProduct" + StringUtil.getRandomString(5);
    productParams.setOfferingName(productName);
    productParams.setOfferingShortName(StringUtil.getRandomString(4));
    productParams.setDefaultInterestRate("15.3");
    productParams.setMaxInterestRate("50");
    productParams.setInterestTypes(SubmitFormParameters.DECLINING_BALANCE);
    productParams.setDefaultLoanAmount("13333");
    productParams.setDefInstallments("13");
    CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
    searchParams.setSearchString("Stu1233266063395 Client1233266063395");
    searchParams.setLoanProduct(productName);
    loanProductTestHelper.defineNewLoanProduct(productParams);
    LoanAccountPage loanAccountPage = loanTestHelper.createAndActivateDefaultLoanAccount(searchParams);
    loanAccountPage.verifyPrincipalOriginal("13,333");
    loanAccountPage.verifyInterestOriginal("276");
    loanAccountPage.verifyFeesOriginal("0");
    loanAccountPage.verifyPenaltyOriginal("0");
    loanAccountPage.verifyTotalOriginalLoan("13609.0");
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) SubmitFormParameters(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters) DefineNewLoanProductPage(org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage)

Aggregations

CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)95 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)50 Test (org.testng.annotations.Test)46 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)36 DateTime (org.joda.time.DateTime)35 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)26 CreateLoanAccountEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)22 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)22 SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)19 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)19 CreateLoanAccountConfirmationPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage)13 CreateLoanAccountPreviewPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage)12 CreateLoanAccountSearchPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchPage)12 ClientsAndAccountsHomepage (org.mifos.test.acceptance.framework.ClientsAndAccountsHomepage)11 CreateLoanAccountReviewInstallmentPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage)11 ArrayList (java.util.ArrayList)9 EditLoanAccountStatusParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)8 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)8 LoanProductDetailsPage (org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage)8 EditLoanAccountInformationPage (org.mifos.test.acceptance.framework.loan.EditLoanAccountInformationPage)7