Search in sources :

Example 1 with EditAccountStatusParameters

use of org.mifos.test.acceptance.framework.account.EditAccountStatusParameters 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()));
}
Also used : CreateSavingsAccountSearchParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchParameters) SavingsProductParameters(org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters) DateTime(org.joda.time.DateTime) CreateSavingsAccountSubmitParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters) EditAccountStatusParameters(org.mifos.test.acceptance.framework.account.EditAccountStatusParameters) Test(org.testng.annotations.Test)

Example 2 with EditAccountStatusParameters

use of org.mifos.test.acceptance.framework.account.EditAccountStatusParameters 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");
}
Also used : CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) CreateSavingsAccountSearchParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchParameters) CreateLoanAccountSubmitParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters) SavingsProductParameters(org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters) DateTime(org.joda.time.DateTime) CreateSavingsAccountSubmitParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters) EditAccountStatusParameters(org.mifos.test.acceptance.framework.account.EditAccountStatusParameters) Test(org.testng.annotations.Test)

Example 3 with EditAccountStatusParameters

use of org.mifos.test.acceptance.framework.account.EditAccountStatusParameters 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");
    }
}
Also used : HashMap(java.util.HashMap) CreateSavingsAccountSearchParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchParameters) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) QuestionResponseParameters(org.mifos.test.acceptance.framework.loan.QuestionResponseParameters) CreateSavingsAccountSubmitParameters(org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters) EditAccountStatusParameters(org.mifos.test.acceptance.framework.account.EditAccountStatusParameters) Test(org.testng.annotations.Test)

Example 4 with EditAccountStatusParameters

use of org.mifos.test.acceptance.framework.account.EditAccountStatusParameters in project head by mifos.

the class AdditionalSavingsAccountTest method restrictionsSavingsTransactions.

//http://mifosforge.jira.com/browse/MIFOSTEST-1070
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(groups = "no_db_unit")
public void restrictionsSavingsTransactions() throws Exception {
    //Given
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 2, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    //When
    SavingsAccountDetailPage savingsAccountDetailPage = createSavingAccountWithCreatedProduct("Stu1233171716380 Client1233171716380", "SavingsProductWithInterestOnMonthlyAvgBalance", "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);
    make3StraightDeposit(savingsId);
    targetTime = new DateTime(2012, 1, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    navigationHelper.navigateToAdminPage();
    runBatchJobsForSavingsIntPostingWithCleanup();
    navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
    Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "20,594.9");
    //Then
    DepositWithdrawalSavingsParameters depositParams = new DepositWithdrawalSavingsParameters();
    DateTime badDate = new DateTime(2011, 5, 5, 13, 0, 0, 0);
    makeDefaultDepositWithdrawal(badDate, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "100000");
    Assert.assertTrue(selenium.isTextPresent("Date of transaction is invalid. It can not be prior to the last meeting date of the customer or prior to activation date of the savings account."));
}
Also used : SavingsAccountDetailPage(org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime) EditAccountStatusParameters(org.mifos.test.acceptance.framework.account.EditAccountStatusParameters) DepositWithdrawalSavingsParameters(org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters) Test(org.testng.annotations.Test)

Example 5 with EditAccountStatusParameters

use of org.mifos.test.acceptance.framework.account.EditAccountStatusParameters 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");
}
Also used : DefineNewSavingsProductConfirmationPage(org.mifos.test.acceptance.framework.savingsproduct.DefineNewSavingsProductConfirmationPage) 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) EditAccountStatusParameters(org.mifos.test.acceptance.framework.account.EditAccountStatusParameters) DepositWithdrawalSavingsParameters(org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters)

Aggregations

EditAccountStatusParameters (org.mifos.test.acceptance.framework.account.EditAccountStatusParameters)17 Test (org.testng.annotations.Test)11 DateTime (org.joda.time.DateTime)9 SavingsAccountDetailPage (org.mifos.test.acceptance.framework.savings.SavingsAccountDetailPage)8 SavingsProductParameters (org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters)7 CreateSavingsAccountSearchParameters (org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSearchParameters)6 CreateSavingsAccountSubmitParameters (org.mifos.test.acceptance.framework.savings.CreateSavingsAccountSubmitParameters)6 DepositWithdrawalSavingsParameters (org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters)6 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)6 DefineNewSavingsProductConfirmationPage (org.mifos.test.acceptance.framework.savingsproduct.DefineNewSavingsProductConfirmationPage)5 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)4 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)4 HashMap (java.util.HashMap)3 QuestionResponseParameters (org.mifos.test.acceptance.framework.loan.QuestionResponseParameters)3 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)2 QuestionResponsePage (org.mifos.test.acceptance.framework.questionnaire.QuestionResponsePage)2 ArrayList (java.util.ArrayList)1 LocalDate (org.joda.time.LocalDate)1 AdminPage (org.mifos.test.acceptance.framework.admin.AdminPage)1 DefineAcceptedPaymentTypesPage (org.mifos.test.acceptance.framework.admin.DefineAcceptedPaymentTypesPage)1