Search in sources :

Example 21 with DateTimeUpdaterRemoteTestingService

use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.

the class CreateClientLoanAccountTest method newMonthlyClientLoanAccountWithMeetingOnSameWeekAndWeekdayOfMonth.

@Test(singleThreaded = true, groups = { "loan", "acceptance", "ui" })
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public // (1,4,'test' to (1,4,'test','2011-02-01'
void newMonthlyClientLoanAccountWithMeetingOnSameWeekAndWeekdayOfMonth() throws Exception {
    //Given
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 2, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Client - Mia Monthly3rdFriday");
    searchParameters.setLoanProduct("MonthlyClientFlatLoanThirdFridayOfMonth");
    CreateLoanAccountSubmitParameters submitAccountParameters = new CreateLoanAccountSubmitParameters();
    submitAccountParameters.setAmount("2765.0");
    submitAccountParameters.setGracePeriodTypeNone(true);
    //Then
    String loanId = createLoanAndCheckAmount(searchParameters, submitAccountParameters, null);
    getLoanStatusActive(loanId);
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) Test(org.testng.annotations.Test)

Example 22 with DateTimeUpdaterRemoteTestingService

use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.

the class CreateClientLoanAccountTest method setAppDate.

private void setAppDate(DateTime dateTime) throws UnsupportedEncodingException {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    dateTimeUpdaterRemoteTestingService.setDateTime(dateTime);
}
Also used : DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)

Example 23 with DateTimeUpdaterRemoteTestingService

use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.

the class EditLoanAccountTest method setUp.

@Override
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@BeforeMethod
public void setUp() throws Exception {
    super.setUp();
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 2, 21, 17, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
}
Also used : DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 24 with DateTimeUpdaterRemoteTestingService

use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.

the class FeeTest method applyAndRemoveFees.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void applyAndRemoveFees() throws Exception {
    // this account has an approved but not disbursed loan.
    String pendingApprovalAccountId = "000100000000043";
    String partialApplicationAccountId = "000100000000044";
    String applicationApprovedAccountId = "000100000000045";
    String client = "WeeklyClient Monday";
    String oneTimeFee = feeTestHelper.createNoRateFee("oneTimeFee", FeesCreatePage.SubmitFormParameters.LOAN, "Upfront", 10);
    String periodicFee = feeTestHelper.createPeriodicRateFee("periodicFee", FeesCreatePage.SubmitFormParameters.LOAN, FeesCreatePage.SubmitFormParameters.PERIODIC_FEE_FREQUENCY, 1, 10, FeesCreatePage.SubmitFormParameters.LOAN_AMOUNT);
    ChargeParameters feeParameters = new ChargeParameters();
    feeParameters.setAmount("10");
    feeParameters.setType(oneTimeFee);
    // ONE TIME FEE
    // add and remove the fee from a pending approval account
    loanTestHelper.applyChargeUsingFeeLabel(pendingApprovalAccountId, feeParameters);
    loanTestHelper.verifyOneTimeFee(oneTimeFee, 1);
    loanTestHelper.removeOneTimeFee(1);
    loanTestHelper.verifyNoOneTimeFeesExist();
    // add and remove the fee from a partial application account
    loanTestHelper.applyChargeUsingFeeLabel(partialApplicationAccountId, feeParameters);
    loanTestHelper.verifyOneTimeFee(oneTimeFee, 1);
    loanTestHelper.removeOneTimeFee(1);
    loanTestHelper.verifyNoOneTimeFeesExist();
    // add and verify that the fee cannot be removed from an application approved account
    loanTestHelper.applyChargeUsingFeeLabel(applicationApprovedAccountId, feeParameters);
    loanTestHelper.verifyOneTimeFee(oneTimeFee, 1);
    loanTestHelper.verifyNoOneTimeFeeRemovalLinkExists(1);
    // PERIODIC FEE
    feeParameters.setType(periodicFee);
    CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
    searchParams.setSearchString(client);
    searchParams.setLoanProduct("WeeklyClientFlatLoanWithNoFee");
    DisburseLoanParameters disburseParams = new DisburseLoanParameters();
    disburseParams.setDisbursalDateDD("28");
    disburseParams.setDisbursalDateMM("02");
    disburseParams.setDisbursalDateYYYY("2011");
    disburseParams.setPaymentType(PaymentParameters.CASH);
    disburseParams.setAmount("10,000");
    // add and verify that the fee can be removed from an application approved account
    loanTestHelper.applyChargeUsingFeeLabel("000100000000047", feeParameters);
    loanTestHelper.verifyNoPeriodicFee(periodicFee, 1);
    loanTestHelper.removePeriodicFee(1);
    // add and verify that the fee can't be removed from an application approved account
    // after repay of first instalment
    PaymentParameters paymentParams = new PaymentParameters();
    paymentParams.setTransactionDateDD("28");
    paymentParams.setTransactionDateMM("02");
    paymentParams.setTransactionDateYYYY("2011");
    paymentParams.setPaymentType(PaymentParameters.CASH);
    paymentParams.setAmount("3000");
    paymentParams.setReceiptId("");
    paymentParams.setReceiptDateDD("");
    paymentParams.setReceiptDateMM("");
    paymentParams.setReceiptDateYYYY("");
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 2, 28, 12, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    String accountWithDisburs = loanTestHelper.createActivateAndDisburseDefaultLoanAccount(searchParams, disburseParams).getAccountId();
    loanTestHelper.applyChargeUsingFeeLabel(accountWithDisburs, feeParameters);
    loanTestHelper.applyPayment(accountWithDisburs, paymentParams);
    loanTestHelper.removePeriodicFee(1);
    loanTestHelper.verifyValidationErrorAppear();
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) ChargeParameters(org.mifos.test.acceptance.framework.loan.ChargeParameters) DateTime(org.joda.time.DateTime) PaymentParameters(org.mifos.test.acceptance.framework.loan.PaymentParameters)

Example 25 with DateTimeUpdaterRemoteTestingService

use of org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService in project head by mifos.

the class FeeTest method canApplyOneTimeFeeAfterPaymentsHaveBeenMade.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void canApplyOneTimeFeeAfterPaymentsHaveBeenMade() throws Exception {
    String client = "WeeklyClient Monday";
    DateTime currentTime = new DateTime().withYear(2012).withDayOfMonth(3).withMonthOfYear(12);
    new DateTimeUpdaterRemoteTestingService(selenium).setDateTime(currentTime);
    String dd = Integer.toString(currentTime.getDayOfMonth());
    String mm = Integer.toString(currentTime.getMonthOfYear());
    String yy = Integer.toString(currentTime.getYear());
    applicationDatabaseOperation.updateLSIM(1);
    LoanAccountPage loanAccountPage = loanTestHelper.createActivateDisburstAndApplyPaymentForDefaultLoanAccount(client, dd, mm, yy);
    double feesBefore = Double.parseDouble(loanAccountPage.getFeesBalance());
    loanAccountPage = loanTestHelper.applyCharge("Misc Fees", "1");
    double feesAfter = Double.parseDouble(loanAccountPage.getFeesBalance());
    Assert.assertEquals(feesBefore + 1.0, feesAfter);
}
Also used : LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime)

Aggregations

DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)103 DateTime (org.joda.time.DateTime)81 BeforeMethod (org.testng.annotations.BeforeMethod)41 Test (org.testng.annotations.Test)22 LoanTestHelper (org.mifos.test.acceptance.framework.testhelpers.LoanTestHelper)21 NavigationHelper (org.mifos.test.acceptance.framework.testhelpers.NavigationHelper)20 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)19 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)16 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)10 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)9 SavingsAccountDetailPage (org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage)9 MifosPage (org.mifos.test.acceptance.framework.MifosPage)8 DepositWithdrawalSavingsParameters (org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters)8 SavingsProductParameters (org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters)8 AfterMethod (org.testng.annotations.AfterMethod)8 CustomPropertiesHelper (org.mifos.test.acceptance.framework.testhelpers.CustomPropertiesHelper)7 EditAccountStatusParameters (org.mifos.test.acceptance.framework.account.EditAccountStatusParameters)6 SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)6 SavingsAccountHelper (org.mifos.test.acceptance.framework.testhelpers.SavingsAccountHelper)6 AppLauncher (org.mifos.test.acceptance.framework.AppLauncher)5