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/06/19 22:01:36 UTC
[fineract] branch develop updated: FINERACT-822 enable BadImport
error 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
The following commit(s) were added to refs/heads/develop by this push:
new cf4acff FINERACT-822 enable BadImport error check
cf4acff is described below
commit cf4acffb014f3a63b50854feddb08882bf5f0652
Author: percyashu <pe...@gmail.com>
AuthorDate: Sun Jun 14 04:06:12 2020 +0100
FINERACT-822 enable BadImport error check
---
fineract-provider/build.gradle | 4 ++--
.../fineract/integrationtests/common/CalendarHelper.java | 4 ++--
.../org/apache/fineract/integrationtests/common/Utils.java | 11 +++++------
.../integrationtests/common/organisation/CampaignsHelper.java | 4 ++--
.../infrastructure/gcm/service/NotificationSenderService.java | 3 +--
.../src/test/java/org/apache/fineract/common/Utils.java | 3 +--
6 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle
index 1dfcfd3..13d3ab3 100644
--- a/fineract-provider/build.gradle
+++ b/fineract-provider/build.gradle
@@ -338,7 +338,6 @@ tasks.withType(JavaCompile) {
"SameNameButDifferent",
"StringSplitter",
"ImmutableEnumChecker",
- "BadImport",
"UnusedMethod",
"ModifiedButNotUsed",
"TypeParameterUnusedInFormals",
@@ -379,6 +378,7 @@ tasks.withType(JavaCompile) {
"MixedArrayDimensions",
"PackageLocation",
"UseBinds",
+ "BadImport",
"IntLongMath",
"FloatCast",
"ReachabilityFenceUsage",
@@ -397,6 +397,7 @@ tasks.withType(JavaCompile) {
"PrivateConstructorForNoninstantiableModule",
"ClassCanBeStatic",
"ClassNewInstance",
+ "UnnecessaryStaticImport",
"UnsafeFinalization",
"JodaPlusMinusLong",
"MutableMethodReturnType",
@@ -419,7 +420,6 @@ tasks.withType(JavaCompile) {
// "MethodCanBeStatic",
// "Var",
// "ConstantField",
-// "UnnecessaryStaticImport",
// "ConstructorInvokesOverridable",
// "InjectOnConstructorOfAbstractClass",
// "StringSplitter",
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CalendarHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CalendarHelper.java
index 5d7e832..c64b4bd 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CalendarHelper.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/CalendarHelper.java
@@ -18,10 +18,10 @@
*/
package org.apache.fineract.integrationtests.common;
-import static io.restassured.path.json.JsonPath.from;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.google.gson.Gson;
+import io.restassured.path.json.JsonPath;
import io.restassured.specification.RequestSpecification;
import io.restassured.specification.ResponseSpecification;
import java.util.HashMap;
@@ -87,7 +87,7 @@ public class CalendarHelper {
final String CLIENT_URL = "/fineract-provider/api/v1/groups/" + generatedGroupId + "?associations=all&" + Utils.TENANT_IDENTIFIER;
final String responseCalendarDetailsinJSON = Utils.performServerGet(requestSpec, responseSpec, CLIENT_URL,
"collectionMeetingCalendar");
- final Integer responseCalendarId = from(responseCalendarDetailsinJSON).get("id");
+ final Integer responseCalendarId = JsonPath.from(responseCalendarDetailsinJSON).get("id");
assertEquals(generatedCalendarId, responseCalendarId, "ERROR IN CREATING THE CALENDAR");
}
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java
index d20ba5e..88eaee6 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java
@@ -19,7 +19,6 @@
package org.apache.fineract.integrationtests.common;
import static io.restassured.RestAssured.given;
-import static io.restassured.path.json.JsonPath.from;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.fail;
@@ -138,7 +137,7 @@ public class Utils {
if (jsonAttributeToGetBack == null) {
return (T) json;
}
- return (T) from(json).get(jsonAttributeToGetBack);
+ return (T) JsonPath.from(json).get(jsonAttributeToGetBack);
}
public static String performGetTextResponse(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
@@ -158,28 +157,28 @@ public class Utils {
if (jsonAttributeToGetBack == null) {
return (T) json;
}
- return (T) from(json).get(jsonAttributeToGetBack);
+ return (T) JsonPath.from(json).get(jsonAttributeToGetBack);
}
public static <T> T performServerPut(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final String putURL, final String jsonBodyToSend, final String jsonAttributeToGetBack) {
final String json = given().spec(requestSpec).body(jsonBodyToSend).expect().spec(responseSpec).log().ifError().when().put(putURL)
.andReturn().asString();
- return (T) from(json).get(jsonAttributeToGetBack);
+ return (T) JsonPath.from(json).get(jsonAttributeToGetBack);
}
public static <T> T performServerDelete(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final String deleteURL, final String jsonAttributeToGetBack) {
final String json = given().spec(requestSpec).expect().spec(responseSpec).log().ifError().when().delete(deleteURL).andReturn()
.asString();
- return (T) from(json).get(jsonAttributeToGetBack);
+ return (T) JsonPath.from(json).get(jsonAttributeToGetBack);
}
public static <T> T performServerDelete(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final String deleteURL, final String jsonBodyToSend, final String jsonAttributeToGetBack) {
final String json = given().spec(requestSpec).body(jsonBodyToSend).expect().spec(responseSpec).log().ifError().when()
.delete(deleteURL).andReturn().asString();
- return (T) (jsonAttributeToGetBack == null ? json : from(json).get(jsonAttributeToGetBack));
+ return (T) (jsonAttributeToGetBack == null ? json : JsonPath.from(json).get(jsonAttributeToGetBack));
}
public static String convertDateToURLFormat(final String dateToBeConvert) throws ParseException {
diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/CampaignsHelper.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/CampaignsHelper.java
index 31ab42b..3bb669d 100644
--- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/CampaignsHelper.java
+++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/organisation/CampaignsHelper.java
@@ -19,11 +19,11 @@
package org.apache.fineract.integrationtests.common.organisation;
import static io.restassured.RestAssured.given;
-import static io.restassured.path.json.JsonPath.from;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
+import io.restassured.path.json.JsonPath;
import io.restassured.specification.RequestSpecification;
import io.restassured.specification.ResponseSpecification;
import java.lang.reflect.Type;
@@ -178,7 +178,7 @@ public class CampaignsHelper {
.asString();
Assert.notNull(json, "json");
ArrayList<ReportData> reportsList = new ArrayList<>();
- String reportsString = new Gson().toJson(from(json).get(jsonAttributeToGetBack));
+ String reportsString = new Gson().toJson(JsonPath.from(json).get(jsonAttributeToGetBack));
Assert.notNull(reportsString, "reportsString");
final Gson gson = new Gson();
final Type typeOfHashMap = new TypeToken<List<ReportData>>() {}.getType();
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/service/NotificationSenderService.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/service/NotificationSenderService.java
index cf8f2bb..8a40cac 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/service/NotificationSenderService.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/service/NotificationSenderService.java
@@ -30,7 +30,6 @@ import org.apache.fineract.infrastructure.gcm.GcmConstants;
import org.apache.fineract.infrastructure.gcm.domain.DeviceRegistration;
import org.apache.fineract.infrastructure.gcm.domain.DeviceRegistrationRepositoryWrapper;
import org.apache.fineract.infrastructure.gcm.domain.Message;
-import org.apache.fineract.infrastructure.gcm.domain.Message.Builder;
import org.apache.fineract.infrastructure.gcm.domain.Message.Priority;
import org.apache.fineract.infrastructure.gcm.domain.Notification;
import org.apache.fineract.infrastructure.gcm.domain.NotificationConfigurationData;
@@ -94,7 +93,7 @@ public class NotificationSenderService {
try {
Notification notification = new Notification.Builder(GcmConstants.defaultIcon).title(GcmConstants.title)
.body(smsMessage.getMessage()).build();
- Builder b = new Builder();
+ Message.Builder b = new Message.Builder();
b.notification(notification);
b.dryRun(false);
b.contentAvailable(true);
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 92d15e8..84a5207 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
@@ -19,7 +19,6 @@
package org.apache.fineract.common;
import static io.restassured.RestAssured.given;
-import static io.restassured.path.json.JsonPath.from;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.fail;
@@ -75,7 +74,7 @@ public class Utils {
public static <T> T performServerGet(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final String getURL, final String jsonAttributeToGetBack) {
final String json = given().spec(requestSpec).expect().spec(responseSpec).log().ifError().when().get(getURL).andReturn().asString();
- return (T) from(json).get(jsonAttributeToGetBack);
+ return (T) JsonPath.from(json).get(jsonAttributeToGetBack);
}
}