/*
  * 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-234
 @Test(enabled = true)
 public void verifyPropertyGroupCanApplyLoansTrue() throws Exception {
   // Given
   propertiesHelper.setGroupCanApplyLoans("true");
   LoanTestHelper helper = new LoanTestHelper(selenium);
   CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
   searchParameters.setSearchString("UpdateCustomPropertiesTestGroup");
   searchParameters.setLoanProduct("GroupEmergencyLoan");
   CreateLoanAccountSubmitParameters submitAccountParameters =
       new CreateLoanAccountSubmitParameters();
   submitAccountParameters.setAmount("2000.0");
   // When Then
   helper.createLoanAccount(searchParameters, submitAccountParameters);
 }
  /*
   * 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");
  }