use of org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters in project head by mifos.
the class QuestionGroupSavingsAccountTest method verifyCapturingResponsesDuringSavingsClosing.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void verifyCapturingResponsesDuringSavingsClosing() throws Exception {
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 2, 28, 15, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
questionGroupTestHelper.markQuestionGroupAsActive("QGForCloseSavings");
try {
createClient("670");
CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
searchParameters.setSearchString("Joe670 Doe670");
searchParameters.setSavingsProduct("MonthlyClientSavingsAccount");
CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
submitAccountParameters.setAmount("248.0");
QuestionResponseParameters questionResponseParameters = new QuestionResponseParameters();
questionResponseParameters.addSingleSelectAnswer("questionGroups[0].sectionDetails[0].questions[0].valuesAsArray", "three");
questionResponseParameters.addTextAnswer("questionGroups[0].sectionDetails[0].questions[1].value", "20");
String savingsId = savingsAccountHelper.createSavingsAccount(searchParameters, submitAccountParameters).getAccountId();
EditAccountStatusParameters editAccountStatusParameters = new EditAccountStatusParameters();
editAccountStatusParameters.setAccountStatus(AccountStatus.SAVINGS_ACTIVE);
editAccountStatusParameters.setNote("test");
savingsAccountHelper.changeStatus(savingsId, editAccountStatusParameters);
String[] questionsExist = { "MultiSelect", "Number" };
savingsAccountHelper.fillQuestionGroupsDuringClosingSavingsAccount(savingsId, questionResponseParameters, questionsExist);
Map<String, String> questionsAndAnswers = new HashMap<String, String>();
questionsAndAnswers.put("MultiSelect", "three");
questionsAndAnswers.put("Number", "20");
verifyQuestionResponsesExistInDatabase(savingsId, "Close Savings", questionsAndAnswers);
} finally {
questionGroupTestHelper.markQuestionGroupAsInactive("QGForCloseSavings");
}
}
use of org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters in project head by mifos.
the class UpdateCustomPropertiesTest method verifyPropertyPendingApprovalStateEnabledForSavingsAndLoanAccounts.
/*
* FIXME - keithw - test passes when run individually but not as part of ci build. it appears that question groups data is not
* cleaned up right as instead of stepping to review installments, the questionnaire page is presented.
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
//http://mifosforge.jira.com/browse/MIFOSTEST-215
@Test(enabled = true)
public void verifyPropertyPendingApprovalStateEnabledForSavingsAndLoanAccounts() throws Exception {
//Given
propertiesHelper.setSavingsPendingApprovalStateEnabled("true");
propertiesHelper.setLoanPendingApprovalStateEnabled("true");
propertiesHelper.setGroupPendingApprovalStateEnabled("true");
//When
CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
searchParameters.setSearchString("UpdateCustomProperties TestClient");
searchParameters.setSavingsProduct("MonthlyClientSavingsAccount");
CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
submitAccountParameters.setAmount("248.0");
SavingsAccountDetailPage savingsAccountPage = savingsAccountHelper.createSavingsAccount(searchParameters, submitAccountParameters);
savingsAccountPage.verifyPage();
//Then
savingsAccountPage.verifySavingsAmount(submitAccountParameters.getAmount());
savingsAccountPage.verifySavingsProduct(searchParameters.getSavingsProduct());
savingsAccountPage.verifyStatus("Application Pending Approval");
//when
CreateLoanAccountSearchParameters searchParameters2 = new CreateLoanAccountSearchParameters();
searchParameters2.setSearchString("UpdateCustomProperties TestClient");
searchParameters2.setLoanProduct("ClientEmergencyLoan");
CreateLoanAccountSubmitParameters submitAccountParameters2 = new CreateLoanAccountSubmitParameters();
submitAccountParameters2.setAmount("2765.0");
submitAccountParameters2.setGracePeriodTypeNone(true);
LoanTestHelper loanTestHelper = new LoanTestHelper(selenium);
LoanAccountPage loanAccountPage = loanTestHelper.createLoanAccount(searchParameters2, submitAccountParameters2);
loanAccountPage.verifyStatus("Application Pending Approval");
}
use of org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters in project head by mifos.
the class ClientTest method addSavingsToCustomer.
private void addSavingsToCustomer(String searchString, boolean active, String savingsProduct) {
CreateSavingsAccountSubmitParameters submitParametes = new CreateSavingsAccountSubmitParameters();
submitParametes.setAmount("10");
CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
searchParameters.setSavingsProduct(savingsProduct);
searchParameters.setSearchString(searchString);
SavingsAccountDetailPage sadp = savingsAccountHelper.createSavingsAccount(searchParameters, submitParametes);
if (active) {
savingsAccountHelper.activateSavingsAccount(sadp.getAccountId());
}
}
use of org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters in project head by mifos.
the class ClientTest method addClientWithSavingToGroupWithSavingsCheckGroupCalculation.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
//blocked by http://mifosforge.jira.com/browse/MIFOS-4272 - ldomzalski
@Test(enabled = false)
public void addClientWithSavingToGroupWithSavingsCheckGroupCalculation() throws Exception {
String groupName = "group1";
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
ClientViewDetailsPage clientDetailsPage = clientTestHelper.createClientAndVerify("loan officer", "MyOfficeDHMFT");
clientTestHelper.changeCustomerStatus(clientDetailsPage, ClientStatus.ACTIVE);
String clientName = clientDetailsPage.getHeading();
searchParameters.setSavingsProduct("MonthlyClientSavingsAccount");
searchParameters.setSearchString(clientName);
String savingsId = savingsAccountHelper.createSavingsAccount(searchParameters, submitAccountParameters).getAccountId();
savingsAccountHelper.changeStatus(savingsId, editAccountStatusParameters);
SavingsProductParameters savingsProductParameters = savingsProductHelper.getGenericSavingsProductParameters(new DateTime(2009, 7, 13, 12, 0, 0, 0), SavingsProductParameters.MANDATORY, SavingsProductParameters.GROUPS);
savingsProductParameters.setShortName("M-45");
savingsProductParameters.setAmountAppliesTo(SavingsProductParameters.PER_INDIVIDUAL);
savingsProductHelper.createSavingsProduct(savingsProductParameters);
searchParameters.setSavingsProduct(savingsProductParameters.getProductInstanceName());
searchParameters.setSearchString(groupName);
savingsId = savingsAccountHelper.createSavingsAccount(searchParameters, submitAccountParameters).getAccountId();
savingsAccountHelper.changeStatus(savingsId, editAccountStatusParameters);
clientTestHelper.addClientToGroup(clientName, groupName);
// Then
Integer numberOfGroupMembers = Integer.parseInt(navigationHelper.navigateToGroupViewDetailsPage(groupName).getNumberOfClientsInGroup());
savingsAccountHelper.verifyTotalAmountDue(savingsId, numberOfGroupMembers, Float.parseFloat(submitAccountParameters.getAmount()));
}
use of org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters 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