예제 #1
0
 public Integer getLoanProductId(final String loanProductJSON) {
   return Utils.performServerPost(
       this.requestSpec,
       this.responseSpec,
       CREATE_LOAN_PRODUCT_URL,
       loanProductJSON,
       "resourceId");
 }
예제 #2
0
 public Object createLoanAccount(
     final String loanApplicationJSON, final String responseAttribute) {
   return Utils.performServerPost(
       this.requestSpec,
       this.responseSpec,
       APPLY_LOAN_URL,
       loanApplicationJSON,
       responseAttribute);
 }
예제 #3
0
 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");
 }
예제 #4
0
 private Object performLoanTransaction(
     final String postURLForLoanTransaction,
     final String jsonToBeSent,
     final String responseAttribute) {
   return Utils.performServerPost(
       this.requestSpec,
       this.responseSpec,
       postURLForLoanTransaction,
       jsonToBeSent,
       responseAttribute);
 }
예제 #5
0
 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);
 }
예제 #7
0
  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");
 }