use of org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters in project head by mifos.
the class ClientTest method removeClientWithSavingsFromGroupWithSavingsCheckGroupCalculation.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
// https://mifosforge.jira.com/browse/MIFOS-5844
@Test(enabled = true)
public void removeClientWithSavingsFromGroupWithSavingsCheckGroupCalculation() throws Exception {
//Given
SavingsProductParameters savingsProductParameters = savingsProductHelper.getGenericSavingsProductParameters(new DateTime(2009, 7, 13, 12, 0, 0, 0), SavingsProductParameters.MANDATORY, SavingsProductParameters.GROUPS);
savingsProductParameters.setProductInstanceName("MandatoryGroupSavingProduct");
savingsProductParameters.setShortName("M-45");
savingsProductParameters.setAmountAppliesTo(SavingsProductParameters.PER_INDIVIDUAL);
savingsProductHelper.createSavingsProduct(savingsProductParameters);
String clientName = clientTestHelper.createClientAndVerify("loan officer", "MyOfficeDHMFT").getHeading();
clientTestHelper.activateClient(clientName);
clientTestHelper.addClientToGroup(clientName, "groupWithoutLoan");
String groupName = navigationHelper.navigateToClientViewDetailsPage(clientName).getGroupMembership();
CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
submitAccountParameters.setAmount("240.0");
EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
editAccountStatusParameters.setAccountStatus(AccountStatus.SAVINGS_ACTIVE);
editAccountStatusParameters.setNote("change status to active");
// When
searchParameters.setSearchString(clientName);
searchParameters.setSavingsProduct("MonthlyClientSavingsAccount");
String savingsId = savingsAccountHelper.createSavingsAccount(searchParameters, submitAccountParameters).getAccountId();
searchParameters.setSearchString(groupName);
searchParameters.setSavingsProduct("MandatoryGroupSavingProduct");
savingsAccountHelper.changeStatus(savingsId, editAccountStatusParameters);
savingsId = savingsAccountHelper.createSavingsAccount(searchParameters, submitAccountParameters).getAccountId();
savingsAccountHelper.changeStatus(savingsId, editAccountStatusParameters);
clientTestHelper.deleteClientGroupMembership(clientName, "remove group membership");
Integer numberOfGroupMembers = Integer.parseInt(navigationHelper.navigateToGroupViewDetailsPage(groupName).getNumberOfClientsInGroup());
// Then
savingsAccountHelper.verifyTotalAmountDue(savingsId, numberOfGroupMembers, Float.parseFloat(submitAccountParameters.getAmount()));
}
use of org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters in project head by mifos.
the class ClientTest method removeClientWithLoanFromGroup.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
//https://mifosforge.jira.com/browse/MIFOS-5843
@Test(enabled = true)
public void removeClientWithLoanFromGroup() throws Exception {
// Given
String clientName = clientTestHelper.createClientAndVerify("loan officer", "MyOfficeDHMFT").getHeading();
clientTestHelper.activateClient(clientName);
// Then
clientTestHelper.addClientToGroup(clientName, "groupWithoutLoan");
CreateLoanAccountSearchParameters searchParams = new CreateLoanAccountSearchParameters();
searchParams.setSearchString(clientName);
searchParams.setLoanProduct("WeeklyFlatLoanWithOneTimeFees");
CreateLoanAccountSubmitParameters submitLoanAccountParameters = new CreateLoanAccountSubmitParameters();
submitLoanAccountParameters.setDd("22");
submitLoanAccountParameters.setMm("01");
submitLoanAccountParameters.setYy("2010");
String loanAccounntID = loanTestHelper.createLoanAccount(searchParams, submitLoanAccountParameters).getAccountId();
loanTestHelper.activateLoanAccount(loanAccounntID);
String groupName = navigationHelper.navigateToClientViewDetailsPage(clientName).getGroupMembership();
SavingsProductParameters params = savingsProductHelper.getGenericSavingsProductParameters(new DateTime(2009, 7, 13, 12, 0, 0, 0), SavingsProductParameters.MANDATORY, SavingsProductParameters.GROUPS);
savingsProductHelper.createSavingsProduct(params);
CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
searchParameters.setSearchString(groupName);
searchParameters.setSavingsProduct(params.getProductInstanceName());
CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
submitAccountParameters.setAmount("250.0");
String savingsId = savingsAccountHelper.createSavingsAccount(searchParameters, submitAccountParameters).getAccountId();
EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
editAccountStatusParameters.setAccountStatus(AccountStatus.SAVINGS_ACTIVE);
editAccountStatusParameters.setNote("change status to active");
savingsAccountHelper.changeStatus(savingsId, editAccountStatusParameters);
// When / Then
clientTestHelper.deleteClientGroupMembership(clientName, "remove group membership");
}
use of org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters in project head by mifos.
the class AdditionalSavingsAccountTest method savingsAccountWithDailyInterestMandatoryDeposits.
//http://mifosforge.jira.com/browse/MIFOSTEST-712
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void savingsAccountWithDailyInterestMandatoryDeposits() throws Exception {
//Given
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 2, 10, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "acceptance_small_008_dbunit.xml", dataSource, selenium);
//When
SavingsProductParameters params = savingsProductHelper.getMandatoryClientsMinimumBalanceSavingsProductParameters(targetTime);
DefineNewSavingsProductConfirmationPage confirmationPage = savingsProductHelper.createSavingsProduct(params);
//"Stu1233266079799 Client1233266079799"
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();
make3StraightDeposit(savingsId);
depositParams = setDepositParams(depositParams, "01", "03", "2011");
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
//Then
targetTime = new DateTime(2011, 3, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
navigationHelper.navigateToAdminPage();
runBatchJobsForSavingsIntPosting();
navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "57.4");
//When
targetTime = new DateTime(2011, 3, 7, 13, 0, 0, 0);
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "100000.0");
targetTime = new DateTime(2011, 3, 14, 13, 0, 0, 0);
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "100000.0");
targetTime = new DateTime(2011, 3, 21, 13, 0, 0, 0);
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "100000.0");
targetTime = new DateTime(2011, 3, 28, 13, 0, 0, 0);
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "100000.0");
//Then
targetTime = new DateTime(2011, 4, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
navigationHelper.navigateToAdminPage();
runBatchJobsForSavingsIntPosting();
navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "402.7");
}
use of org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters in project head by mifos.
the class AdditionalSavingsAccountTest method savingsAccountsWithDifferentTransactionsOrdering.
//http://mifosforge.jira.com/browse/MIFOSTEST-721
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(groups = "no_db_unit")
public void savingsAccountsWithDifferentTransactionsOrdering() throws Exception {
//Given
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 2, 10, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
//When
SavingsProductParameters params = savingsProductHelper.getMandatoryClientsMinimumBalanceSavingsProductParameters(targetTime);
params.setTypeOfDeposits(SavingsProductParameters.VOLUNTARY);
DefineNewSavingsProductConfirmationPage confirmationPage = savingsProductHelper.createSavingsProduct(params);
confirmationPage.navigateToSavingsProductDetails();
//account1
SavingsAccountDetailPage savingsAccountDetailPage = createSavingAccountWithCreatedProduct("Stu1233171716380 Client1233171716380", 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");
targetTime = new DateTime(2011, 2, 15, 13, 0, 0, 0);
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.WITHDRAWAL, "100000.0");
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "100000.0");
//account2
targetTime = new DateTime(2011, 2, 10, 13, 0, 0, 0);
savingsAccountDetailPage = createSavingAccountWithCreatedProduct("Stu1233171716380 Client1233171716380", params.getProductInstanceName(), "100000.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();
targetTime = new DateTime(2011, 2, 15, 13, 0, 0, 0);
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId2, DepositWithdrawalSavingsParameters.DEPOSIT, "100000.0");
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId2, DepositWithdrawalSavingsParameters.DEPOSIT, "100000.0");
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId2, DepositWithdrawalSavingsParameters.WITHDRAWAL, "100000.0");
//Then
targetTime = new DateTime(2011, 4, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
navigationHelper.navigateToAdminPage();
runBatchJobsForSavingsIntPostingWithCleanup();
navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "48.6");
navigationHelper.navigateToSavingsAccountDetailPage(savingsId2);
Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "35.1");
}
use of org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters in project head by mifos.
the class AdditionalSavingsAccountTest method savingsProductUpdateableFields.
//http://mifosforge.jira.com/browse/MIFOSTEST-725
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void savingsProductUpdateableFields() throws Exception {
//Given
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 2, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "acceptance_small_008_dbunit.xml", dataSource, selenium);
//When
SavingsProductParameters params = savingsProductHelper.getMandatoryClientsMinimumBalanceSavingsProductParameters(targetTime);
params.setBalanceUsedForInterestCalculation(SavingsProductParameters.AVERAGE_BALANCE);
params.setTypeOfDeposits(SavingsProductParameters.VOLUNTARY);
params.setStartDateDD("1");
params.setStartDateMM("2");
params.setStartDateYYYY("2011");
String productName = params.getProductInstanceName();
String savingsId = createSavingsAccount(params);
DepositWithdrawalSavingsParameters depositParams = new DepositWithdrawalSavingsParameters();
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "2000");
//Then
targetTime = new DateTime(2011, 3, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
navigationHelper.navigateToAdminPage();
runBatchJobsForSavingsIntPosting();
navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "2.7");
AdminPage adminPage = navigationHelper.navigateToAdminPage();
ViewSavingsProductsPage viewSavingsProducts = adminPage.navigateToViewSavingsProducts();
viewSavingsProducts.verifyPage();
SavingsProductDetailsPage savingsProductDetailsPage = viewSavingsProducts.viewSavingsProductDetails(productName);
EditSavingsProductPage editSavingsProductPage = savingsProductDetailsPage.editSavingsProduct();
selenium.type("interestRate", "10");
selenium.type("minBalanceRequiredForInterestCalculation", "100");
EditSavingsProductPreviewPage editSavingsProductPreviewPage = editSavingsProductPage.editSubmit();
savingsProductDetailsPage = editSavingsProductPreviewPage.submit();
makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "2000");
targetTime = new DateTime(2011, 4, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
navigationHelper.navigateToAdminPage();
runBatchJobsForSavingsIntPosting();
navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "33.1");
}
Aggregations