use of org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters in project head by mifos.
the class AdditionalSavingsAccountTest method savingsAccountWith3monthInterestVoluntaryDeposits.
//http://mifosforge.jira.com/browse/MIFOSTEST-141
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void savingsAccountWith3monthInterestVoluntaryDeposits() throws Exception {
//Given
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 2, 15, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "acceptance_small_008_dbunit.xml", dataSource, selenium);
//When
SavingsProductParameters params = savingsProductHelper.getVoluntaryClients3MonthCalculactionPostingProductParameters(targetTime);
DefineNewSavingsProductConfirmationPage confirmationPage = savingsProductHelper.createSavingsProduct(params);
confirmationPage.navigateToSavingsProductDetails();
SavingsAccountDetailPage savingsAccountDetailPage = createSavingAccountWithCreatedProduct("Stu1233266079799 Client1233266079799", params.getProductInstanceName(), "100000.0");
String savingsId = savingsAccountDetailPage.getAccountId();
EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
editAccountStatusParameters.setAccountStatus(AccountStatus.SAVINGS_ACTIVE);
editAccountStatusParameters.setNote("change status to active");
savingsAccountHelper.changeStatus(savingsId, editAccountStatusParameters);
DepositWithdrawalSavingsParameters depositParams = new DepositWithdrawalSavingsParameters();
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "100000.0");
//Then
targetTime = new DateTime(2011, 5, 15, 22, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
navigationHelper.navigateToAdminPage();
runBatchJobsForSavingsIntPosting();
navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "602.7");
targetTime = new DateTime(2011, 9, 1, 22, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
navigationHelper.navigateToAdminPage();
runBatchJobsForSavingsIntPosting();
navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "1,254.1");
}
use of org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters in project head by mifos.
the class AdditionalSavingsAccountTest method savingsAccountsWithAdjustments.
//http://mifosforge.jira.com/browse/MIFOSTEST-722
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(groups = "no_db_unit")
public void savingsAccountsWithAdjustments() throws Exception {
//Given
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2012, 1, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
//When
SavingsProductParameters params = getVoluntaryGroupsMonthCalculactionProductParameters(targetTime);
DefineNewSavingsProductConfirmationPage confirmationPage = savingsProductHelper.createSavingsProduct(params);
confirmationPage.navigateToSavingsProductDetails();
//account1
SavingsAccountDetailPage savingsAccountDetailPage = createSavingAccountWithCreatedProduct("Default Group", params.getProductInstanceName(), "2000");
String savingsId = savingsAccountDetailPage.getAccountId();
EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
editAccountStatusParameters.setAccountStatus(AccountStatus.SAVINGS_ACTIVE);
editAccountStatusParameters.setNote("change status to active");
savingsAccountHelper.changeStatus(savingsId, editAccountStatusParameters);
DepositWithdrawalSavingsParameters depositParams = new DepositWithdrawalSavingsParameters();
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "2000");
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.WITHDRAWAL, "250");
targetTime = new DateTime(2012, 2, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
navigationHelper.navigateToAdminPage();
runBatchJobsForSavingsIntPostingWithCleanup();
//Then
navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "7.2");
//account2
//When
targetTime = new DateTime(2011, 3, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
savingsAccountDetailPage = createSavingAccountWithCreatedProduct("Default Group", params.getProductInstanceName(), "2000.0");
String savingsId2 = savingsAccountDetailPage.getAccountId();
editAccountStatusParameters = new EditAccountStatusParameters();
editAccountStatusParameters.setAccountStatus(AccountStatus.SAVINGS_ACTIVE);
editAccountStatusParameters.setNote("change status to active");
savingsAccountHelper.changeStatus(savingsId2, editAccountStatusParameters);
depositParams = new DepositWithdrawalSavingsParameters();
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId2, DepositWithdrawalSavingsParameters.DEPOSIT, "2000.0");
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId2, DepositWithdrawalSavingsParameters.WITHDRAWAL, "250.0");
targetTime = new DateTime(2011, 4, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
navigationHelper.navigateToAdminPage();
runBatchJobsForSavingsIntPostingWithCleanup();
//Then
navigationHelper.navigateToSavingsAccountDetailPage(savingsId2);
Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "7.2");
}
use of org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters in project head by mifos.
the class SavingsAccountHelper method createAndActivateSavingAccountWithDefaultAmountOfDeposit.
public SavingsAccountDetailPage createAndActivateSavingAccountWithDefaultAmountOfDeposit(String clientName) {
CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
searchParameters.setSavingsProduct("MonthlyClientSavingsAccount");
searchParameters.setSearchString(clientName);
CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
submitAccountParameters.setAmount("240.0");
EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
editAccountStatusParameters.setAccountStatus(AccountStatus.SAVINGS_ACTIVE);
editAccountStatusParameters.setNote("change status to active");
String SavingsAccountId = createSavingsAccount(searchParameters, submitAccountParameters).getAccountId();
SavingsAccountDetailPage savingsAccountDetailPage = changeStatus(SavingsAccountId, editAccountStatusParameters);
DepositWithdrawalSavingsParameters params = new DepositWithdrawalSavingsParameters();
params.setAmount("100");
params.setPaymentType("Cash");
params.setTrxnType("Deposit");
makeDepositOrWithdrawalOnSavingsAccount(SavingsAccountId, params);
return savingsAccountDetailPage;
}
Aggregations