This is an automated email from the ASF dual-hosted git repository.

vorburger pushed a commit to branch revert-592-Fineract-614
in repository https://gitbox.apache.org/repos/asf/fineract.git

commit 200c4e9152d18d1ea947ef3db232d3a9bb70210c
Author: Michael Vorburger ⛑️ <[email protected]>
AuthorDate: Fri Mar 13 17:15:42 2020 +0100

    Revert "Fineract-614: Updating Global Configurations Fixing some rebase 
conflicts Change to imports on IntegrationTest for CheckStyle"
    
    This reverts commit 8df44af628a171c2708997cc7125460d4f601f74.
---
 .../fineract/integrationtests/RatesTest.java       |  58 ++++++-----
 .../integrationtests/common/rates/RatesHelper.java | 109 ++++++++++-----------
 2 files changed, 79 insertions(+), 88 deletions(-)

diff --git 
a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RatesTest.java
 
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RatesTest.java
index 25c2600..0feb648 100644
--- 
a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RatesTest.java
+++ 
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/RatesTest.java
@@ -23,51 +23,49 @@ import com.jayway.restassured.builder.ResponseSpecBuilder;
 import com.jayway.restassured.http.ContentType;
 import com.jayway.restassured.specification.RequestSpecification;
 import com.jayway.restassured.specification.ResponseSpecification;
-import java.util.ArrayList;
-import java.util.HashMap;
 import org.apache.fineract.integrationtests.common.Utils;
 import org.apache.fineract.integrationtests.common.rates.RatesHelper;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+
 @SuppressWarnings({"rawtypes"})
 public class RatesTest {
 
-  private ResponseSpecification responseSpec;
-  private RequestSpecification requestSpec;
-
-  @Before
-  public void setup() {
-    Utils.initializeRESTAssured();
-    this.requestSpec = new 
RequestSpecBuilder().setContentType(ContentType.JSON).build();
-    this.requestSpec.header("Authorization",
-        "Basic " + 
Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
-    this.responseSpec = new 
ResponseSpecBuilder().expectStatusCode(200).build();
-  }
+    private ResponseSpecification responseSpec;
+    private RequestSpecification requestSpec;
 
-  @Test
-  public void testRatesForLoans() {
+    @Before
+    public void setup() {
+        Utils.initializeRESTAssured();
+        this.requestSpec = new 
RequestSpecBuilder().setContentType(ContentType.JSON).build();
+        this.requestSpec.header("Authorization", "Basic " + 
Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
+        this.responseSpec = new 
ResponseSpecBuilder().expectStatusCode(200).build();
+    }
 
-    // Retrieving all Rates
-    ArrayList<HashMap> allRatesData = RatesHelper.getRates(this.requestSpec, 
this.responseSpec);
-    Assert.assertNotNull(allRatesData);
+    @Test
+    public void testRatesForLoans() {
 
-    // Testing Creation and Update of Loan Rate
-    final Integer loanRateId = RatesHelper.createRates(this.requestSpec, 
this.responseSpec,
-        RatesHelper.getLoanRateJSON());
-    Assert.assertNotNull(loanRateId);
+        // Retrieving all Rates
+        ArrayList<HashMap> allRatesData = 
RatesHelper.getRates(this.requestSpec, this.responseSpec);
+        Assert.assertNotNull(allRatesData);
 
-    //Update Rate percentage
-    HashMap changes = RatesHelper.updateRates(this.requestSpec, 
this.responseSpec, loanRateId,
-        RatesHelper.getModifyRateJSON());
+        // Testing Creation and Update of Loan Rate
+        final Integer loanRateId = RatesHelper.createRates(this.requestSpec, 
this.responseSpec,
+                RatesHelper.getLoanRateJSON());
+        Assert.assertNotNull(loanRateId);
 
-    HashMap rateDataAfterChanges = RatesHelper
-        .getRateById(this.requestSpec, this.responseSpec, loanRateId);
-    Assert.assertEquals("Verifying Rate after modification", 
rateDataAfterChanges.get("percentage"),
-        changes.get("percentage"));
+        //Update Rate percentage
+        HashMap changes = RatesHelper.updateRates(this.requestSpec, 
this.responseSpec, loanRateId,
+                RatesHelper.getModifyRateJSON());
 
-  }
+        HashMap rateDataAfterChanges = 
RatesHelper.getRateById(this.requestSpec, this.responseSpec, loanRateId);
+        Assert.assertEquals("Verifying Rate after modification", 
rateDataAfterChanges.get("percentage"), changes.get("percentage"));
 
+    }
 
+   
 }
diff --git 
a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/rates/RatesHelper.java
 
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/rates/RatesHelper.java
index 01688b5..43fd0d7 100644
--- 
a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/rates/RatesHelper.java
+++ 
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/rates/RatesHelper.java
@@ -21,78 +21,71 @@ package org.apache.fineract.integrationtests.common.rates;
 import com.google.gson.Gson;
 import com.jayway.restassured.specification.RequestSpecification;
 import com.jayway.restassured.specification.ResponseSpecification;
-import java.util.ArrayList;
-import java.util.HashMap;
 import org.apache.fineract.integrationtests.common.CommonConstants;
 import org.apache.fineract.integrationtests.common.Utils;
 
-@SuppressWarnings({"rawtypes", "unchecked"})
+import java.util.ArrayList;
+import java.util.HashMap;
+
+@SuppressWarnings({ "rawtypes", "unchecked" })
 public class RatesHelper {
 
-  private static final String RATES_URL = "/fineract-provider/api/v1/rates";
-  private static final String CREATE_RATES_URL = RATES_URL + "?" + 
Utils.TENANT_IDENTIFIER;
-  private final static String PERCENTAGE = "10";
-  private final static Integer PRODUCT_APPLY_LOAN = 1;
-  private final static Boolean ACTIVE = true;
+    private static final String RATES_URL = "/fineract-provider/api/v1/rates";
+    private static final String CREATE_RATES_URL = RATES_URL + "?" + 
Utils.TENANT_IDENTIFIER;
+    private final static String PERCENTAGE = "10";
+    private final static Integer PRODUCT_APPLY_LOAN = 1;
+    private final static Boolean ACTIVE = true;
 
-  public static ArrayList<HashMap> getRates(final RequestSpecification 
requestSpec,
-      final ResponseSpecification responseSpec) {
-    return (ArrayList) Utils
-        .performServerGet(requestSpec, responseSpec, RATES_URL + "?" + 
Utils.TENANT_IDENTIFIER, "");
-  }
+    public static ArrayList<HashMap> getRates(final RequestSpecification 
requestSpec, final ResponseSpecification responseSpec) {
+        return (ArrayList) Utils.performServerGet(requestSpec, responseSpec, 
RATES_URL + "?" + Utils.TENANT_IDENTIFIER, "");
+    }
 
 
-  public static Integer createRates(final RequestSpecification requestSpec,
-      final ResponseSpecification responseSpec,
-      final String request) {
-    return Utils
-        .performServerPost(requestSpec, responseSpec, CREATE_RATES_URL, 
request, "resourceId");
-  }
+    public static Integer createRates(final RequestSpecification requestSpec, 
final ResponseSpecification responseSpec,
+                                      final String request) {
+        return Utils.performServerPost(requestSpec, responseSpec, 
CREATE_RATES_URL, request, "resourceId");
+    }
 
-  public static HashMap getRateById(final RequestSpecification requestSpec,
-      final ResponseSpecification responseSpec,
-      final Integer rateId) {
-    return Utils.performServerGet(requestSpec, responseSpec,
-        RATES_URL + "/" + rateId + "?" + Utils.TENANT_IDENTIFIER, "");
-  }
+    public static HashMap getRateById(final RequestSpecification requestSpec, 
final ResponseSpecification responseSpec,
+                                      final Integer rateId) {
+        return Utils.performServerGet(requestSpec, responseSpec, RATES_URL + 
"/" + rateId + "?" + Utils.TENANT_IDENTIFIER, "");
+    }
 
-  public static HashMap updateRates(final RequestSpecification requestSpec,
-      final ResponseSpecification responseSpec,
-      final Integer rateId, final String request) {
-    return Utils.performServerPut(requestSpec, responseSpec,
-        RATES_URL + "/" + rateId + "?" + Utils.TENANT_IDENTIFIER, request,
-        CommonConstants.RESPONSE_CHANGES);
-  }
+    public static HashMap updateRates(final RequestSpecification requestSpec, 
final ResponseSpecification responseSpec,
+                                      final Integer rateId, final String 
request) {
+        return Utils.performServerPut(requestSpec, responseSpec, RATES_URL + 
"/" + rateId + "?" + Utils.TENANT_IDENTIFIER, request,
+                CommonConstants.RESPONSE_CHANGES);
+    }
 
-  public static String getLoanRateJSON() {
-    return getLoanRateJSON(RatesHelper.PRODUCT_APPLY_LOAN, 
RatesHelper.PERCENTAGE);
-  }
+    public static String getLoanRateJSON() {
+        return getLoanRateJSON(RatesHelper.PRODUCT_APPLY_LOAN, 
RatesHelper.PERCENTAGE);
+    }
 
-  public static String getLoanRateJSON(final Integer productApply, final 
String percentage) {
-    final HashMap<String, Object> map = populateDefaultsForLoan();
-    map.put("percentage", percentage);
-    map.put("productApply", productApply);
-    String crateRateJSON = new Gson().toJson(map);
-    return crateRateJSON;
-  }
+    public static String getLoanRateJSON(final Integer productApply, final 
String percentage) {
+        final HashMap<String, Object> map = populateDefaultsForLoan();
+        map.put("percentage", percentage);
+        map.put("productApply", productApply);
+        String crateRateJSON = new Gson().toJson(map);
+        return crateRateJSON;
+    }
 
-  public static HashMap<String, Object> populateDefaultsForLoan() {
-    final HashMap<String, Object> map = new HashMap<>();
-    map.put("active", RatesHelper.ACTIVE);
-    map.put("percentage", RatesHelper.PERCENTAGE);
-    map.put("locale", "en");
-    map.put("productApply", RatesHelper.PRODUCT_APPLY_LOAN);
-    map.put("name", Utils.randomNameGenerator("Rate_Loans_", 6));
-    return map;
-  }
+    public static HashMap<String, Object> populateDefaultsForLoan() {
+        final HashMap<String, Object> map = new HashMap<>();
+        map.put("active", RatesHelper.ACTIVE);
+        map.put("percentage", RatesHelper.PERCENTAGE);
+        map.put("locale", "en");
+        map.put("productApply", RatesHelper.PRODUCT_APPLY_LOAN);
+        map.put("name", Utils.randomNameGenerator("Rate_Loans_", 6));
+        return map;
+    }
 
-  public static String getModifyRateJSON() {
-    final HashMap<String, Object> map = new HashMap<>();
-    map.put("percentage", "15.0");
-    map.put("locale", "en");
-    String json = new Gson().toJson(map);
-    return json;
-  }
+    public static String getModifyRateJSON() {
+        final HashMap<String, Object> map = new HashMap<>();
+        map.put("percentage", "15.0");
+        map.put("locale", "en");
+        String json = new Gson().toJson(map);
+        return json;
+    }
 
 }
 

Reply via email to