fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vorbur...@apache.org
Subject [fineract] 01/03: FINERACT-822 Enforce StaticAssignmentInConstructor check
Date Fri, 03 Jul 2020 14:25:12 GMT
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 3f1673ea97db8609ac0f635d4479ac9e86d38553
Author: percyashu <percyayukashu@gmail.com>
AuthorDate: Tue Jun 30 05:40:43 2020 +0100

    FINERACT-822 Enforce StaticAssignmentInConstructor check
---
 fineract-provider/build.gradle                                     | 2 +-
 .../test/java/org/apache/fineract/common/RestAssuredFixture.java   | 7 ++-----
 .../infrastructure/core/boot/tests/SpringBootServerLoginTest.java  | 4 ++--
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle
index a829ddf..4e4b4d8 100644
--- a/fineract-provider/build.gradle
+++ b/fineract-provider/build.gradle
@@ -396,7 +396,6 @@ tasks.withType(JavaCompile) {
                 "ReturnFromVoid",
                 "AlmostJavadoc",
                 "ProtectedMembersInFinalClass",
-                "StaticAssignmentInConstructor",
                 "InvalidBlockTag",
         )
         //TODO gradually enable these checks
@@ -458,6 +457,7 @@ tasks.withType(JavaCompile) {
                 "NonCanonicalType",
                 "InvalidInlineTag",
                 "MutablePublicArray",
+                "StaticAssignmentInConstructor",
                 "OperatorPrecedence",
                 "EqualsGetClass",
                 "EqualsUnsafeCast",
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 91662ed..3dd5229 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
@@ -19,7 +19,6 @@
 package org.apache.fineract.common;
 
 import com.google.common.base.Preconditions;
-import io.restassured.RestAssured;
 import io.restassured.builder.RequestSpecBuilder;
 import io.restassured.builder.ResponseSpecBuilder;
 import io.restassured.http.ContentType;
@@ -33,16 +32,14 @@ import io.restassured.specification.ResponseSpecification;
  */
 public class RestAssuredFixture {
 
-    private final int httpPort;
+    private final int httpPort = 8443;
 
     private ResponseSpecification responseSpec;
     private RequestSpecification requestSpec;
 
-    public RestAssuredFixture(int httpPort) {
+    public RestAssuredFixture() {
         super();
-        this.httpPort = httpPort;
         Utils.initializeRESTAssured();
-        RestAssured.port = httpPort;
         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/infrastructure/core/boot/tests/SpringBootServerLoginTest.java
b/fineract-provider/src/test/java/org/apache/fineract/infrastructure/core/boot/tests/SpringBootServerLoginTest.java
index e5b69b0..f17ab7c 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,9 +41,9 @@ public class SpringBootServerLoginTest extends AbstractSpringBootWithMariaDB4jIn
     @Test
     @Disabled("Failing on Cloubees")
     public void hasPlatformStarted() {
-        util = new RestAssuredFixture(8443);
+        util = new RestAssuredFixture();
         List<Map<String, String>> response = util.httpGet("/users");
         assertThat(response.get(0).get("username"), is("mifos"));
     }
 
-}
\ No newline at end of file
+}


Mime
View raw message