public Integer getLoanProductId(final String loanProductJSON) {
   return Utils.performServerPost(
       this.requestSpec,
       this.responseSpec,
       CREATE_LOAN_PRODUCT_URL,
       loanProductJSON,
       "resourceId");
 }
 public Object createLoanAccount(
     final String loanApplicationJSON, final String responseAttribute) {
   return Utils.performServerPost(
       this.requestSpec,
       this.responseSpec,
       APPLY_LOAN_URL,
       loanApplicationJSON,
       responseAttribute);
 }
 public Integer addChargesForLoan(final Integer loanId, final String request) {
   System.out.println(
       "--------------------------------- ADD CHARGES FOR LOAN --------------------------------");
   final String ADD_CHARGES_URL =
       "/mifosng-provider/api/v1/loans/" + loanId + "/charges?" + Utils.TENANT_IDENTIFIER;
   final HashMap response =
       Utils.performServerPost(requestSpec, responseSpec, ADD_CHARGES_URL, request, "");
   return (Integer) response.get("resourceId");
 }
 private Object performLoanTransaction(
     final String postURLForLoanTransaction,
     final String jsonToBeSent,
     final String responseAttribute) {
   return Utils.performServerPost(
       this.requestSpec,
       this.responseSpec,
       postURLForLoanTransaction,
       jsonToBeSent,
       responseAttribute);
 }
 public Integer waiveInterestAndReturnTransactionId(
     final String date, final String amountToBeWaived, final Integer loanID) {
   Integer resourceId =
       Utils.performServerPost(
           this.requestSpec,
           this.responseSpec,
           createLoanTransactionURL(WAIVE_INTEREST_COMMAND, loanID),
           getWaiveBodyAsJSON(date, amountToBeWaived),
           "resourceId");
   return resourceId;
 }
示例#6
0
 public Account createExpenseAccount() {
   String assetAccountJSON = new GLAccountBuilder().withAccountTypeAsExpense().build();
   Integer accountID =
       Utils.performServerPost(
           requestSpec,
           responseSpec,
           CREATE_GL_ACCOUNT_URL,
           assetAccountJSON,
           GL_ACCOUNT_ID_RESPONSE);
   return new Account(accountID, Account.AccountType.EXPENSE);
 }
  private HashMap performLoanTransaction(
      final String postURLForLoanTransaction, final String jsonToBeSent) {

    final HashMap response =
        Utils.performServerPost(
            this.requestSpec,
            this.responseSpec,
            postURLForLoanTransaction,
            jsonToBeSent,
            "changes");
    return (HashMap) response.get("status");
  }
示例#8
0
  public static Object createCode(
      final RequestSpecification requestSpec,
      final ResponseSpecification responseSpec,
      final String codeName,
      final String jsonAttributeToGetback) {

    return Utils.performServerPost(
        requestSpec,
        responseSpec,
        CODE_URL + "?" + Utils.TENANT_IDENTIFIER,
        getTestCodeAsJSON(codeName),
        jsonAttributeToGetback);
  }
示例#9
0
  public static Object createCodeValue(
      final RequestSpecification requestSpec,
      final ResponseSpecification responseSpec,
      final Integer codeId,
      final String codeValueName,
      final Integer position,
      final String jsonAttributeToGetback) {

    return Utils.performServerPost(
        requestSpec,
        responseSpec,
        CODE_VALUE_URL.replace("[codeId]", codeId.toString()) + "?" + Utils.TENANT_IDENTIFIER,
        getTestCodeValueAsJSON(codeValueName, position),
        jsonAttributeToGetback);
  }
示例#10
0
 private Object adjustLoanTransaction(
     final Integer loanId,
     final Integer tansactionId,
     final String jsonToBeSent,
     final String responseAttribute) {
   final String URL =
       "/mifosng-provider/api/v1/loans/"
           + loanId
           + "/transactions/"
           + tansactionId
           + "?"
           + Utils.TENANT_IDENTIFIER;
   return Utils.performServerPost(
       this.requestSpec, this.responseSpec, URL, jsonToBeSent, responseAttribute);
 }
示例#11
0
 public Integer payChargesForLoan(
     final Integer loanId, final Integer loanchargeId, final String json) {
   System.out.println(
       "--------------------------------- WAIVE CHARGES FOR LOAN --------------------------------");
   final String CHARGES_URL =
       "/mifosng-provider/api/v1/loans/"
           + loanId
           + "/charges/"
           + loanchargeId
           + "?command=pay&"
           + Utils.TENANT_IDENTIFIER;
   final HashMap response =
       Utils.performServerPost(requestSpec, responseSpec, CHARGES_URL, json, "");
   return (Integer) response.get("resourceId");
 }
示例#12
0
 public Integer getLoanId(final String loanApplicationJSON) {
   return Utils.performServerPost(
       this.requestSpec, this.responseSpec, APPLY_LOAN_URL, loanApplicationJSON, "loanId");
 }