You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by vo...@apache.org on 2020/07/03 14:25:14 UTC

[fineract] 03/03: FINERACT-822 Enable StaticAssignmentInConstructor check

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

vorburger pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git

commit 1102d5b58af185db393482e3f4b74f3bb0470f39
Author: percyashu <pe...@gmail.com>
AuthorDate: Thu Jul 2 01:32:59 2020 +0100

    FINERACT-822 Enable StaticAssignmentInConstructor check
---
 .../test/java/org/apache/fineract/common/RestAssuredFixture.java    | 6 ++++--
 .../src/test/java/org/apache/fineract/common/Utils.java             | 4 ++++
 .../infrastructure/core/boot/tests/SpringBootServerLoginTest.java   | 2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java b/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java
index 3dd5229..e10b3fe 100644
--- a/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java
+++ b/fineract-provider/src/test/java/org/apache/fineract/common/RestAssuredFixture.java
@@ -32,14 +32,16 @@ import io.restassured.specification.ResponseSpecification;
  */
 public class RestAssuredFixture {
 
-    private final int httpPort = 8443;
+    private final int httpPort;
 
     private ResponseSpecification responseSpec;
     private RequestSpecification requestSpec;
 
-    public RestAssuredFixture() {
+    public RestAssuredFixture(int http) {
         super();
+        this.httpPort = http;
         Utils.initializeRESTAssured();
+        Utils.initializeRESTAssuredPort(http);
         this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
         this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
         this.responseSpec = new ResponseSpecBuilder().expectStatusCode(200).build();
diff --git a/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java b/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java
index f1cf5c2..22c2d41 100644
--- a/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java
+++ b/fineract-provider/src/test/java/org/apache/fineract/common/Utils.java
@@ -53,6 +53,10 @@ public class Utils {
         RestAssured.useRelaxedHTTPSValidation();
     }
 
+    public static void initializeRESTAssuredPort(int http) {
+        RestAssured.port = http;
+    }
+
     public static String loginIntoServerAndGetBase64EncodedAuthenticationKey() {
         try {
             LOG.info("-----------------------------------LOGIN-----------------------------------------");
diff --git a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/core/boot/tests/SpringBootServerLoginTest.java b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/core/boot/tests/SpringBootServerLoginTest.java
index f17ab7c..922bc5f 100644
--- a/fineract-provider/src/test/java/org/apache/fineract/infrastructure/core/boot/tests/SpringBootServerLoginTest.java
+++ b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/core/boot/tests/SpringBootServerLoginTest.java
@@ -41,7 +41,7 @@ public class SpringBootServerLoginTest extends AbstractSpringBootWithMariaDB4jIn
     @Test
     @Disabled("Failing on Cloubees")
     public void hasPlatformStarted() {
-        util = new RestAssuredFixture();
+        util = new RestAssuredFixture(8443);
         List<Map<String, String>> response = util.httpGet("/users");
         assertThat(response.get(0).get("username"), is("mifos"));
     }