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);
}
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);
}
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);
}
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();
}
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);
}
Aggregations