Search in sources :

Example 6 with DepositWithdrawalSavingsParameters

use of org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters in project head by mifos.

the class AdditionalSavingsAccountTest method savingsAdjustmentsForDepositsWithdrawals.

//http://mifosforge.jira.com/browse/MIFOSTEST-144
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void savingsAdjustmentsForDepositsWithdrawals() throws Exception {
    //Given
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 1, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "acceptance_small_008_dbunit.xml", dataSource, selenium);
    //When
    SavingsProductParameters params = getVoluntaryGroupsMonthCalculactionProductParameters(targetTime);
    params.setApplicableFor(SavingsProductParameters.CLIENTS);
    params.setInterestRate("10");
    String savingsId = createSavingsAccount(params);
    DepositWithdrawalSavingsParameters depositParams = new DepositWithdrawalSavingsParameters();
    depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "500");
    targetTime = new DateTime(2011, 2, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.WITHDRAWAL, "200");
    targetTime = new DateTime(2011, 3, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    navigationHelper.navigateToAdminPage();
    runBatchJobsForSavingsIntPosting();
    navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
    Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "4.1");
    targetTime = new DateTime(2011, 4, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    navigationHelper.navigateToAdminPage();
    runBatchJobsForSavingsIntPosting();
    navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
    Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "2.6");
    SavingsAccountDetailPage savingsAccountDetailPage = new SavingsAccountDetailPage(selenium);
    SavingsApplyAdjustmentPage savingsApplyAdjustmentPage = new SavingsApplyAdjustmentPage(selenium);
    depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "123");
    savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
    savingsApplyAdjustmentPage = savingsAccountDetailPage.navigateToApplyAdjustmentPage();
    savingsApplyAdjustmentPage.applyAdjustment("234", "adjustment");
    targetTime = new DateTime(2011, 5, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    navigationHelper.navigateToAdminPage();
    runBatchJobsForSavingsIntPosting();
    navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
    Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "4.4");
    depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.WITHDRAWAL, "45");
    savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
    savingsApplyAdjustmentPage = savingsAccountDetailPage.navigateToApplyAdjustmentPage();
    savingsApplyAdjustmentPage.applyAdjustment("55", "adjustment");
    targetTime = new DateTime(2011, 6, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    navigationHelper.navigateToAdminPage();
    runBatchJobsForSavingsIntPosting();
    navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
    Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "4.2");
    depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "555");
    savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
    savingsApplyAdjustmentPage = savingsAccountDetailPage.navigateToApplyAdjustmentPage();
    savingsApplyAdjustmentPage.applyAdjustment("444", "adjustment");
    targetTime = new DateTime(2011, 7, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    navigationHelper.navigateToAdminPage();
    runBatchJobsForSavingsIntPosting();
    navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
    Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "7.6");
    //step 12-15
    params = getVoluntaryGroupsMonthCalculactionProductParameters(targetTime);
    params.setApplicableFor(SavingsProductParameters.CLIENTS);
    String savingsId2 = createSavingsAccount(params);
    depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId2, DepositWithdrawalSavingsParameters.DEPOSIT, "555");
    depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId2, DepositWithdrawalSavingsParameters.WITHDRAWAL, "222");
    // month with last day is a non-working day
    targetTime = new DateTime(2011, 8, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    navigationHelper.navigateToAdminPage();
    runBatchJobsForSavingsIntPosting();
    navigationHelper.navigateToSavingsAccountDetailPage(savingsId2);
    Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "1.4");
}
Also used : SavingsApplyAdjustmentPage(org.mifos.test.acceptance.framework.savings.SavingsApplyAdjustmentPage) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) SavingsProductParameters(org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) DepositWithdrawalSavingsParameters(org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters)

Example 7 with DepositWithdrawalSavingsParameters

use of org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters in project head by mifos.

the class SavingsAccountPerformanceHistoryTest method savingsDepositWithdrawalAndVerifyPerformanceHistory.

// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void savingsDepositWithdrawalAndVerifyPerformanceHistory() throws Exception {
    initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "acceptance_small_008_dbunit.xml", dataSource, selenium);
    DepositWithdrawalSavingsParameters params = new DepositWithdrawalSavingsParameters();
    params.setTrxnDateMM("09");
    params.setTrxnDateDD("09");
    params.setTrxnDateYYYY("2009");
    params.setAmount("888.8");
    params.setPaymentType(DepositWithdrawalSavingsParameters.CASH);
    params.setTrxnType(DepositWithdrawalSavingsParameters.DEPOSIT);
    // deposit initial amount to savings account
    SavingsAccountDetailPage savingsAccountDetailPage = savingsAccountHelper.makeDepositOrWithdrawalOnSavingsAccount("000100000000119", params);
    savingsAccountDetailPage.verifyPage();
    // withdraw portion of savings
    params.setAmount("123.0");
    params.setTrxnType(DepositWithdrawalSavingsParameters.WITHDRAWAL);
    savingsAccountHelper.makeDepositOrWithdrawalOnSavingsAccount("000100000000119", params);
    // another deposit
    params.setAmount("10.0");
    params.setTrxnType(DepositWithdrawalSavingsParameters.DEPOSIT);
    savingsAccountHelper.makeDepositOrWithdrawalOnSavingsAccount("000100000000119", params);
    // another withdrawal
    params.setAmount("20.0");
    params.setTrxnType(DepositWithdrawalSavingsParameters.WITHDRAWAL);
    savingsAccountHelper.makeDepositOrWithdrawalOnSavingsAccount("000100000000119", params);
    // validate savings performance history
    Assert.assertEquals("Performance history", selenium.getTable("performanceHistoryTable.0.0"));
    Assert.assertEquals("Date account opened: 29/01/2009", selenium.getTable("performanceHistoryTable.2.0"));
    Assert.assertEquals(selenium.getTable("performanceHistoryTable.3.0"), "Total deposits: 898.8");
    Assert.assertEquals(selenium.getTable("performanceHistoryTable.4.0"), "Total interest earned: 0");
    Assert.assertEquals(selenium.getTable("performanceHistoryTable.5.0"), "Total withdrawals: 143");
}
Also used : SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) DepositWithdrawalSavingsParameters(org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters)

Example 8 with DepositWithdrawalSavingsParameters

use of org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters in project head by mifos.

the class SavingsPaymentTest method setUpSavingsAccount.

private String setUpSavingsAccount() {
    CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
    searchParameters.setSearchString(CLIENT_GLOBAL_NUM);
    searchParameters.setSavingsProduct("MonthlyClientSavingsAccount");
    CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
    submitAccountParameters.setAmount("100");
    SavingsAccountDetailPage savingsPage = savingsTestHelper.createSavingsAccount(searchParameters, submitAccountParameters);
    String savingsId = savingsPage.getAccountId();
    savingsTestHelper.activateSavingsAccount(savingsId);
    DepositWithdrawalSavingsParameters depositParams = new DepositWithdrawalSavingsParameters();
    depositParams.setAmount(String.valueOf(SAVINGS_START_BALANCE));
    depositParams.setPaymentType(DepositWithdrawalSavingsParameters.CASH);
    depositParams.setTrxnType(DepositWithdrawalSavingsParameters.DEPOSIT);
    savingsTestHelper.makeDepositOrWithdrawalOnSavingsAccount(savingsId, depositParams);
    return savingsId;
}
Also used : CreateSavingsAccountSearchParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchParameters) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) CreateSavingsAccountSubmitParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters) DepositWithdrawalSavingsParameters(org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters)

Example 9 with DepositWithdrawalSavingsParameters

use of org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters in project head by mifos.

the class SavingsDepositTest method makeDepositToClientSavingsAccount.

// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void makeDepositToClientSavingsAccount() throws Exception {
    initData();
    DepositWithdrawalSavingsParameters params = new DepositWithdrawalSavingsParameters();
    params.setTrxnDateMM("09");
    params.setTrxnDateDD("09");
    params.setTrxnDateYYYY("2009");
    params.setAmount("543.2");
    params.setPaymentType(DepositWithdrawalSavingsParameters.CASH);
    params.setTrxnType(DepositWithdrawalSavingsParameters.DEPOSIT);
    params.setReceiptDateDD("09");
    params.setReceiptDateMM("09");
    params.setReceiptDateYYYY("2009");
    SavingsAccountDetailPage accountDetailPage = savingsAccountHelper.makeDepositOrWithdrawalOnSavingsAccount("000100000000036", params);
    String[] tablesToRetrieve = { "SAVINGS_ACTIVITY_DETAILS", "SAVINGS_ACCOUNT", "SAVINGS_PERFORMANCE", "SAVINGS_TRXN_DETAIL" };
    String[] tablesToValidate = { "SAVINGS_ACTIVITY_DETAILS", "SAVINGS_ACCOUNT", "SAVINGS_PERFORMANCE" };
    IDataSet expectedDataSet = dbUnitUtilities.getDataSetFromDataSetDirectoryFile("SavingsDeposit_001_result_dbunit.xml");
    IDataSet databaseDataSet = dbUnitUtilities.getDataSetForTables(dataSource, tablesToRetrieve);
    dbUnitUtilities.verifyTables(tablesToValidate, databaseDataSet, expectedDataSet);
    // verify savings transaction table with sorting
    String[] orderSavingsTrxnByColumns = new String[] { "deposit_amount" };
    dbUnitUtilities.verifyTableWithSort(orderSavingsTrxnByColumns, SavingsDepositTest.SAVINGS_TRXN_DETAIL, expectedDataSet, databaseDataSet);
    // verify transaction history table
    TransactionHistoryPage historyPage = accountDetailPage.navigateToTransactionHistoryPage();
    historyPage.verifyTableTypeAfterDeposit(2);
}
Also used : TransactionHistoryPage(org.mifos.test.acceptance.framework.savings.TransactionHistoryPage) SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) IDataSet(org.dbunit.dataset.IDataSet) DepositWithdrawalSavingsParameters(org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters)

Example 10 with DepositWithdrawalSavingsParameters

use of org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters in project head by mifos.

the class AdditionalSavingsAccountTest method make3StraightDeposit.

private void make3StraightDeposit(String savingsId) throws Exception {
    DateTime targetTime = new DateTime(2011, 2, 10, 13, 0, 0, 0);
    DepositWithdrawalSavingsParameters depositParams = new DepositWithdrawalSavingsParameters();
    targetTime = new DateTime(2011, 2, 14, 13, 0, 0, 0);
    depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "100000.0");
    targetTime = new DateTime(2011, 2, 21, 13, 0, 0, 0);
    depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "100000.0");
    targetTime = new DateTime(2011, 2, 28, 13, 0, 0, 0);
    depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "100000.0");
}
Also used : DateTime(org.joda.time.DateTime) DepositWithdrawalSavingsParameters(org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters)

Aggregations

DepositWithdrawalSavingsParameters (org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters)13 SavingsAccountDetailPage (org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage)10 DateTime (org.joda.time.DateTime)9 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)8 EditAccountStatusParameters (org.mifos.test.acceptance.framework.account.EditAccountStatusParameters)6 SavingsProductParameters (org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters)6 DefineNewSavingsProductConfirmationPage (org.mifos.test.acceptance.framework.savingsproduct.DefineNewSavingsProductConfirmationPage)4 Test (org.testng.annotations.Test)3 CreateSavingsAccountSearchParameters (org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchParameters)2 CreateSavingsAccountSubmitParameters (org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters)2 IDataSet (org.dbunit.dataset.IDataSet)1 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)1 SavingsApplyAdjustmentPage (org.mifos.test.acceptance.framework.savings.SavingsApplyAdjustmentPage)1 TransactionHistoryPage (org.mifos.test.acceptance.framework.savings.TransactionHistoryPage)1 EditSavingsProductPage (org.mifos.test.acceptance.framework.savingsproduct.EditSavingsProductPage)1 EditSavingsProductPreviewPage (org.mifos.test.acceptance.framework.savingsproduct.EditSavingsProductPreviewPage)1 SavingsProductDetailsPage (org.mifos.test.acceptance.framework.savingsproduct.SavingsProductDetailsPage)1 ViewSavingsProductsPage (org.mifos.test.acceptance.framework.savingsproduct.ViewSavingsProductsPage)1