diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 25ceff933..e98fbf598 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -8,8 +8,13 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'zulu' - name: Build the image - run: ./gradlew :fineract-provider:jibDockerBuild -x test + run: ./gradlew :fineract-provider:clean :fineract-provider:jibDockerBuild -x test - name: Start the stack run: docker-compose up -d - name: Wait for stack to come up diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6ce6f08ce..7c14e86b9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,10 +36,10 @@ jobs: ${{ runner.os }}-gradle- - name: Checkout uses: actions/checkout@v2 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v2 with: - java-version: '11' + java-version: '17' distribution: 'zulu' - name: Validate Gradle wrapper uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index f275a5c48..98598838f 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -21,10 +21,10 @@ jobs: ${{ runner.os }}-gradle- - name: Checkout uses: actions/checkout@v2 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v2 with: - java-version: '11' + java-version: '17' distribution: 'zulu' - name: Validate Gradle wrapper uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b diff --git a/.travis.yml b/.travis.yml index 76cb9e9dc..f571e23f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,8 +48,8 @@ install: - curl -O https://cdn.azul.com/zulu/bin/zulu-repo_1.0.0-3_all.deb - sudo apt-get -yq install ./zulu-repo_1.0.0-3_all.deb - sudo apt-get -q update - - sudo apt-get -yq install zulu11-jdk - - export JAVA_HOME=/usr/lib/jvm/zulu11 + - sudo apt-get -yq install zulu17-jdk + - export JAVA_HOME=/usr/lib/jvm/zulu17 # https://docs.travis-ci.com/user/languages/java/#caching before_cache: diff --git a/README.md b/README.md index 9c26e5835..b5980ef45 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ If you are interested in contributing to this project, but perhaps don't quite k Requirements ============ -* Java >= 11 (OpenJDK JVM is tested by our CI on Travis) +* Java >= 17 (OpenJDK JVM is tested by our CI on Travis) * MariaDB 10.6 You can run the required version of the database server in a container, instead of having to install it, like this: diff --git a/build.gradle b/build.gradle index d558f926b..bbb3a59fc 100644 --- a/build.gradle +++ b/build.gradle @@ -59,7 +59,7 @@ plugins { id 'com.github.jk1.dependency-license-report' version '2.0' apply false id 'org.openapi.generator' version '4.3.1' apply false id 'org.zeroturnaround.gradle.jrebel' version '1.1.11' apply false - id 'org.springframework.boot' version '2.6.0' apply false + id 'org.springframework.boot' version '2.6.1' apply false id 'net.ltgt.errorprone' version '2.0.2' apply false id 'io.swagger.core.v3.swagger-gradle-plugin' version '2.1.11' apply false id 'com.gorylenko.gradle-git-properties' version '2.3.1' apply false @@ -109,7 +109,7 @@ allprojects { dependencyManagement { imports { mavenBom 'org.springframework:spring-framework-bom:5.3.12' - mavenBom 'org.springframework.boot:spring-boot-dependencies:2.6.0' + mavenBom 'org.springframework.boot:spring-boot-dependencies:2.6.1' mavenBom 'org.junit:junit-bom:5.8.1' } @@ -149,7 +149,7 @@ allprojects { dependency 'org.mock-server:mockserver-junit-jupiter:5.11.2' dependency 'org.webjars.npm:swagger-ui-dist:4.0.1' dependency 'org.webjars:webjars-locator-core:0.48' - dependency 'org.springframework.boot:spring-boot-starter-mail:2.6.0' + dependency 'org.springframework.boot:spring-boot-starter-mail:2.6.1' dependency 'com.icegreen:greenmail-junit5:1.6.5' // fineract client dependencies @@ -379,9 +379,9 @@ configure(project.fineractJavaProjects) { apply plugin: 'com.github.andygoossens.modernizer' /* define the valid syntax level for source files */ - sourceCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 /* define binary compatibility version */ - targetCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_17 /* http://stackoverflow.com/questions/19653311/jpa-repository-works-in-idea-and-production-but-not-in-gradle */ sourceSets.main.output.resourcesDir = sourceSets.main.java.outputDir diff --git a/fineract-client/build.gradle b/fineract-client/build.gradle index 0cface010..f6f190ce5 100644 --- a/fineract-client/build.gradle +++ b/fineract-client/build.gradle @@ -102,7 +102,7 @@ sourceSets { } java { - // keep this at Java 8, not 11; see https://issues.apache.org/jira/browse/FINERACT-1214 + // keep this at Java 8, not 17; see https://issues.apache.org/jira/browse/FINERACT-1214 sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 0d8d44aef..bc7af4ffc 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -268,7 +268,7 @@ bootJar { jib { from { - image = 'azul/zulu-openjdk-alpine:11' + image = 'azul/zulu-openjdk-alpine:17' } to { @@ -289,7 +289,15 @@ jib { '-XX:+UseContainerSupport', '-XX:+UseStringDeduplication', '-XX:MinRAMPercentage=25', - '-XX:MaxRAMPercentage=80' + '-XX:MaxRAMPercentage=80', + '--add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED', + '--add-opens=java.base/java.lang=ALL-UNNAMED', + '--add-opens=java.base/java.lang.invoke=ALL-UNNAMED', + '--add-opens=java.base/java.io=ALL-UNNAMED', + '--add-opens=java.base/java.security=ALL-UNNAMED', + '--add-opens=java.base/java.util=ALL-UNNAMED', + '--add-opens=java.management/javax.management=ALL-UNNAMED', + '--add-opens=java.naming/javax.naming=ALL-UNNAMED' ] args = [ '-Duser.home=/tmp', diff --git a/fineract-provider/src/main/java/org/apache/fineract/batch/exception/ErrorHandler.java b/fineract-provider/src/main/java/org/apache/fineract/batch/exception/ErrorHandler.java index 3a7423adb..cb16b7435 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/batch/exception/ErrorHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/batch/exception/ErrorHandler.java @@ -19,7 +19,6 @@ package org.apache.fineract.batch.exception; import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException; import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException; @@ -32,6 +31,7 @@ import org.apache.fineract.infrastructure.core.exceptionmapper.PlatformDomainRul import org.apache.fineract.infrastructure.core.exceptionmapper.PlatformInternalServerExceptionMapper; import org.apache.fineract.infrastructure.core.exceptionmapper.PlatformResourceNotFoundExceptionMapper; import org.apache.fineract.infrastructure.core.exceptionmapper.UnsupportedParameterExceptionMapper; +import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper; import org.apache.fineract.portfolio.loanaccount.exception.MultiDisbursementDataRequiredException; import org.apache.fineract.portfolio.loanproduct.exception.LinkedAccountRequiredException; import org.springframework.dao.NonTransientDataAccessException; @@ -49,7 +49,7 @@ import org.springframework.transaction.TransactionException; */ public class ErrorHandler extends RuntimeException { - private static Gson jsonHelper = new GsonBuilder().setPrettyPrinting().create(); + private static Gson jsonHelper = GoogleGsonSerializerHelper.createGsonBuilder(true).create(); /** * Sole Constructor diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/center/CenterImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/center/CenterImportHandler.java index 034381f5a..c2f0a6a43 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/center/CenterImportHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/center/CenterImportHandler.java @@ -38,6 +38,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.EnumOp import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.GroupIdSerializer; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.data.EnumOptionData; +import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper; import org.apache.fineract.portfolio.calendar.data.CalendarData; import org.apache.fineract.portfolio.group.data.CenterData; import org.apache.fineract.portfolio.group.data.GroupGeneralData; @@ -229,7 +230,7 @@ public class CenterImportHandler implements ImportHandler { } private CommandProcessingResult importCenter(int rowIndex, String dateFormat) { - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); Type groupCollectionType = new TypeToken>() {}.getType(); gsonBuilder.registerTypeAdapter(groupCollectionType, new GroupIdSerializer()); @@ -254,7 +255,7 @@ public class CenterImportHandler implements ImportHandler { private Integer importCenterMeeting(CommandProcessingResult result, int rowIndex, String dateFormat) { CalendarData calendarData = meetings.get(rowIndex); calendarData.setTitle("centers_" + result.getGroupId().toString() + "_CollectionMeeting"); - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); gsonBuilder.registerTypeAdapter(EnumOptionData.class, new EnumOptionDataValueSerializer()); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/chartofaccounts/ChartOfAccountsImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/chartofaccounts/ChartOfAccountsImportHandler.java index c0b264aa7..fa9391086 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/chartofaccounts/ChartOfAccountsImportHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/chartofaccounts/ChartOfAccountsImportHandler.java @@ -46,6 +46,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.EnumOp import org.apache.fineract.infrastructure.codes.data.CodeValueData; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.data.EnumOptionData; +import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper; import org.apache.fineract.organisation.monetary.data.CurrencyData; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.IndexedColors; @@ -148,7 +149,7 @@ public class ChartOfAccountsImportHandler implements ImportHandler { public Count importEntity(String dateFormat) { Sheet chartOfAccountsSheet = workbook.getSheet(TemplatePopulateImportConstants.CHART_OF_ACCOUNTS_SHEET_NAME); - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(EnumOptionData.class, new EnumOptionDataIdSerializer()); gsonBuilder.registerTypeAdapter(CodeValueData.class, new CodeValueDataIdSerializer()); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientEntityImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientEntityImportHandler.java index 9b6926bfa..2a231c10d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientEntityImportHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientEntityImportHandler.java @@ -35,6 +35,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandlerUtils; import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper; import org.apache.fineract.portfolio.address.data.AddressData; import org.apache.fineract.portfolio.client.data.ClientData; import org.apache.fineract.portfolio.client.data.ClientNonPersonData; @@ -198,7 +199,7 @@ public class ClientEntityImportHandler implements ImportHandler { int errorCount = 0; String errorMessage = ""; - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); for (ClientData client : clients) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientPersonImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientPersonImportHandler.java index 42d06f41d..4f7f04a89 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientPersonImportHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/client/ClientPersonImportHandler.java @@ -34,6 +34,7 @@ import org.apache.fineract.infrastructure.bulkimport.data.Count; import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler; import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandlerUtils; import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer; +import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper; import org.apache.fineract.portfolio.address.data.AddressData; import org.apache.fineract.portfolio.client.data.ClientData; import org.apache.poi.ss.usermodel.Cell; @@ -183,7 +184,7 @@ public class ClientPersonImportHandler implements ImportHandler { int successCount = 0; int errorCount = 0; String errorMessage = ""; - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); for (ClientData client : clients) { try { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/fixeddeposits/FixedDepositImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/fixeddeposits/FixedDepositImportHandler.java index a207a9cd6..744904eef 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/fixeddeposits/FixedDepositImportHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/fixeddeposits/FixedDepositImportHandler.java @@ -38,6 +38,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSe import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.EnumOptionDataIdSerializer; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.data.EnumOptionData; +import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper; import org.apache.fineract.portfolio.savings.data.ClosingOfSavingsAccounts; import org.apache.fineract.portfolio.savings.data.FixedDepositAccountData; import org.apache.fineract.portfolio.savings.data.SavingsAccountChargeData; @@ -344,7 +345,7 @@ public class FixedDepositImportHandler implements ImportHandler { private int importSavingsClosing(Long savingsId, int i, String dateFormat) { if (closedOnDate.get(i) != null) { - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); String payload = gsonBuilder.create().toJson(closedOnDate.get(i)); final CommandWrapper commandRequest = new CommandWrapperBuilder() // @@ -357,7 +358,7 @@ public class FixedDepositImportHandler implements ImportHandler { } private CommandProcessingResult importSavings(int i, String dateFormat) { - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); gsonBuilder.registerTypeAdapter(EnumOptionData.class, new EnumOptionDataIdSerializer()); JsonObject savingsJsonob = gsonBuilder.create().toJsonTree(savings.get(i)).getAsJsonObject(); @@ -382,7 +383,7 @@ public class FixedDepositImportHandler implements ImportHandler { private int importSavingsApproval(Long savingsId, int i, String dateFormat) { if (approvalDates.get(i) != null) { - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); String payload = gsonBuilder.create().toJson(approvalDates.get(i)); final CommandWrapper commandRequest = new CommandWrapperBuilder() // @@ -396,7 +397,7 @@ public class FixedDepositImportHandler implements ImportHandler { private int importSavingsActivation(Long savingsId, int i, String dateFormat) { if (activationDates.get(i) != null) { - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); String payload = gsonBuilder.create().toJson(activationDates.get(i)); final CommandWrapper commandRequest = new CommandWrapperBuilder() // diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/fixeddeposits/FixedDepositTransactionImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/fixeddeposits/FixedDepositTransactionImportHandler.java index 2086a7e98..b30df7d41 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/fixeddeposits/FixedDepositTransactionImportHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/fixeddeposits/FixedDepositTransactionImportHandler.java @@ -35,6 +35,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer; import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.SavingsAccountTransactionEnumValueSerialiser; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper; import org.apache.fineract.portfolio.savings.data.SavingsAccountTransactionData; import org.apache.fineract.portfolio.savings.data.SavingsAccountTransactionEnumData; import org.apache.poi.ss.usermodel.Cell; @@ -119,7 +120,7 @@ public class FixedDepositTransactionImportHandler implements ImportHandler { int successCount = 0; int errorCount = 0; String errorMessage = ""; - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); gsonBuilder.registerTypeAdapter(SavingsAccountTransactionEnumData.class, new SavingsAccountTransactionEnumValueSerialiser()); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/group/GroupImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/group/GroupImportHandler.java index 0f321fbf6..3d166ee81 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/group/GroupImportHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/group/GroupImportHandler.java @@ -38,6 +38,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSe import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.EnumOptionDataValueSerializer; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.data.EnumOptionData; +import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper; import org.apache.fineract.portfolio.calendar.data.CalendarData; import org.apache.fineract.portfolio.client.data.ClientData; import org.apache.fineract.portfolio.group.data.GroupGeneralData; @@ -233,7 +234,7 @@ public class GroupImportHandler implements ImportHandler { private Integer importGroupMeeting(CommandProcessingResult result, int rowIndex, String dateFormat) { CalendarData calendarData = meetings.get(rowIndex); calendarData.setTitle("group_" + result.getGroupId().toString() + "_CollectionMeeting"); - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); gsonBuilder.registerTypeAdapter(EnumOptionData.class, new EnumOptionDataValueSerializer()); @@ -250,7 +251,7 @@ public class GroupImportHandler implements ImportHandler { } private CommandProcessingResult importGroup(int rowIndex, String dateFormat) { - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); Type clientCollectionType = new TypeToken>() {}.getType(); gsonBuilder.registerTypeAdapter(clientCollectionType, new ClientIdSerializer()); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/guarantor/GuarantorImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/guarantor/GuarantorImportHandler.java index 498f70269..a14dfbf4f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/guarantor/GuarantorImportHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/guarantor/GuarantorImportHandler.java @@ -35,6 +35,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandlerUtils; import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper; import org.apache.fineract.portfolio.loanaccount.guarantor.data.GuarantorData; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.IndexedColors; @@ -125,7 +126,7 @@ public class GuarantorImportHandler implements ImportHandler { int successCount = 0; int errorCount = 0; String errorMessage = ""; - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); for (GuarantorData guarantor : guarantors) { try { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/journalentry/JournalEntriesImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/journalentry/JournalEntriesImportHandler.java index f03fea2af..74a1d8904 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/journalentry/JournalEntriesImportHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/journalentry/JournalEntriesImportHandler.java @@ -36,6 +36,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.CurrencyDateCodeSerializer; import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper; import org.apache.fineract.organisation.monetary.data.CurrencyData; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.IndexedColors; @@ -197,7 +198,7 @@ public class JournalEntriesImportHandler implements ImportHandler { int successCount = 0; int errorCount = 0; String errorMessage = ""; - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); gsonBuilder.registerTypeAdapter(CurrencyData.class, new CurrencyDateCodeSerializer()); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/loan/LoanImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/loan/LoanImportHandler.java index 8c92adecf..17c544b09 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/loan/LoanImportHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/loan/LoanImportHandler.java @@ -39,6 +39,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSe import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.EnumOptionDataValueSerializer; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.data.EnumOptionData; +import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper; import org.apache.fineract.portfolio.loanaccount.data.DisbursementData; import org.apache.fineract.portfolio.loanaccount.data.LoanAccountData; import org.apache.fineract.portfolio.loanaccount.data.LoanApprovalData; @@ -466,7 +467,7 @@ public class LoanImportHandler implements ImportHandler { } private Integer importLoanRepayment(CommandProcessingResult result, int rowIndex, String dateFormat) { - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); JsonObject loanRepaymentJsonob = gsonBuilder.create().toJsonTree(loanRepayments.get(rowIndex)).getAsJsonObject(); loanRepaymentJsonob.remove("manuallyReversed"); @@ -486,7 +487,7 @@ public class LoanImportHandler implements ImportHandler { DisbursementData disbusalData = disbursalDates.get(rowIndex); String linkAccountId = disbusalData.getLinkAccountId(); - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); if (linkAccountId != null && !"".equals(linkAccountId)) { String payload = gsonBuilder.create().toJson(disbusalData); @@ -510,7 +511,7 @@ public class LoanImportHandler implements ImportHandler { private Integer importLoanApproval(CommandProcessingResult result, int rowIndex, String dateFormat) { if (approvalDates.get(rowIndex) != null) { - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); String payload = gsonBuilder.create().toJson(approvalDates.get(rowIndex)); final CommandWrapper commandRequest = new CommandWrapperBuilder() // @@ -524,7 +525,7 @@ public class LoanImportHandler implements ImportHandler { } private CommandProcessingResult importLoan(int rowIndex, String dateFormat) { - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); gsonBuilder.registerTypeAdapter(EnumOptionData.class, new EnumOptionDataValueSerializer()); JsonObject loanJsonOb = gsonBuilder.create().toJsonTree(loans.get(rowIndex)).getAsJsonObject(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/loanrepayment/LoanRepaymentImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/loanrepayment/LoanRepaymentImportHandler.java index 42dd1be3f..c3ffe4182 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/loanrepayment/LoanRepaymentImportHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/loanrepayment/LoanRepaymentImportHandler.java @@ -34,6 +34,7 @@ import org.apache.fineract.infrastructure.bulkimport.data.Count; import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler; import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandlerUtils; import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer; +import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper; import org.apache.fineract.portfolio.loanaccount.data.LoanTransactionData; import org.apache.fineract.portfolio.loanaccount.service.LoanReadPlatformService; import org.apache.poi.ss.usermodel.Cell; @@ -112,7 +113,7 @@ public class LoanRepaymentImportHandler implements ImportHandler { int successCount = 0; int errorCount = 0; String errorMessage = ""; - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); for (LoanTransactionData loanRepayment : loanRepayments) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/office/OfficeImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/office/OfficeImportHandler.java index 99c8d3e6c..a7fc9f983 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/office/OfficeImportHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/office/OfficeImportHandler.java @@ -32,6 +32,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandlerUtils; import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper; import org.apache.fineract.organisation.office.data.OfficeData; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.IndexedColors; @@ -88,7 +89,7 @@ public class OfficeImportHandler implements ImportHandler { public Count importEntity(String dateFormat) { Sheet officeSheet = workbook.getSheet(TemplatePopulateImportConstants.OFFICE_SHEET_NAME); - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); int successCount = 0; diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/recurringdeposit/RecurringDepositImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/recurringdeposit/RecurringDepositImportHandler.java index a80b80ad8..0ba328371 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/recurringdeposit/RecurringDepositImportHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/recurringdeposit/RecurringDepositImportHandler.java @@ -36,6 +36,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSe import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.EnumOptionDataIdSerializer; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.data.EnumOptionData; +import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper; import org.apache.fineract.portfolio.savings.data.RecurringDepositAccountData; import org.apache.fineract.portfolio.savings.data.SavingsAccountChargeData; import org.apache.fineract.portfolio.savings.data.SavingsActivation; @@ -346,7 +347,7 @@ public class RecurringDepositImportHandler implements ImportHandler { private int importSavingsActivation(Long savingsId, int i, String dateFormat) { if (activationDates.get(i) != null) { - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); String payload = gsonBuilder.create().toJson(activationDates.get(i)); final CommandWrapper commandRequest = new CommandWrapperBuilder() // @@ -360,7 +361,7 @@ public class RecurringDepositImportHandler implements ImportHandler { private int importSavingsApproval(Long savingsId, int i, String dateFormat) { if (approvalDates.get(i) != null) { - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); String payload = gsonBuilder.create().toJson(approvalDates.get(i)); final CommandWrapper commandRequest = new CommandWrapperBuilder() // @@ -373,7 +374,7 @@ public class RecurringDepositImportHandler implements ImportHandler { } private CommandProcessingResult importSavings(int i, String dateFormat) { - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); gsonBuilder.registerTypeAdapter(EnumOptionData.class, new EnumOptionDataIdSerializer()); JsonObject savingsJsonob = gsonBuilder.create().toJsonTree(savings.get(i)).getAsJsonObject(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/recurringdeposit/RecurringDepositTransactionImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/recurringdeposit/RecurringDepositTransactionImportHandler.java index d8693635a..3638dddc8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/recurringdeposit/RecurringDepositTransactionImportHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/recurringdeposit/RecurringDepositTransactionImportHandler.java @@ -36,6 +36,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSe import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.SavingsAccountTransactionEnumValueSerialiser; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; +import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper; import org.apache.fineract.portfolio.savings.data.SavingsAccountTransactionData; import org.apache.fineract.portfolio.savings.data.SavingsAccountTransactionEnumData; import org.apache.poi.ss.usermodel.Cell; @@ -120,7 +121,7 @@ public class RecurringDepositTransactionImportHandler implements ImportHandler { int successCount = 0; int errorCount = 0; String errorMessage = ""; - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); gsonBuilder.registerTypeAdapter(SavingsAccountTransactionEnumData.class, new SavingsAccountTransactionEnumValueSerialiser()); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/savings/SavingsImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/savings/SavingsImportHandler.java index 1c7f46f3f..f5cda1152 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/savings/SavingsImportHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/savings/SavingsImportHandler.java @@ -37,6 +37,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSe import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.EnumOptionDataIdSerializer; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; import org.apache.fineract.infrastructure.core.data.EnumOptionData; +import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper; import org.apache.fineract.portfolio.savings.data.SavingsAccountChargeData; import org.apache.fineract.portfolio.savings.data.SavingsAccountData; import org.apache.fineract.portfolio.savings.data.SavingsActivation; @@ -341,7 +342,7 @@ public class SavingsImportHandler implements ImportHandler { private int importSavingsActivation(Long savingsId, int i, String dateFormat) { if (activationDates.get(i) != null) { - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); String payload = gsonBuilder.create().toJson(activationDates.get(i)); final CommandWrapper commandRequest = new CommandWrapperBuilder() // @@ -355,7 +356,7 @@ public class SavingsImportHandler implements ImportHandler { private int importSavingsApproval(Long savingsId, int i, String dateFormat) { if (approvalDates.get(i) != null) { - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); String payload = gsonBuilder.create().toJson(approvalDates.get(i)); final CommandWrapper commandRequest = new CommandWrapperBuilder() // @@ -368,7 +369,7 @@ public class SavingsImportHandler implements ImportHandler { } private CommandProcessingResult importSavings(int i, String dateFormat) { - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); gsonBuilder.registerTypeAdapter(EnumOptionData.class, new EnumOptionDataIdSerializer()); JsonObject savingsJsonob = gsonBuilder.create().toJsonTree(savings.get(i)).getAsJsonObject(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/savings/SavingsTransactionImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/savings/SavingsTransactionImportHandler.java index f581e44c3..6940096af 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/savings/SavingsTransactionImportHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/savings/SavingsTransactionImportHandler.java @@ -35,6 +35,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer; import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.SavingsAccountTransactionEnumValueSerialiser; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper; import org.apache.fineract.portfolio.savings.data.SavingsAccountTransactionData; import org.apache.fineract.portfolio.savings.data.SavingsAccountTransactionEnumData; import org.apache.poi.ss.usermodel.Cell; @@ -119,7 +120,7 @@ public class SavingsTransactionImportHandler implements ImportHandler { int successCount = 0; int errorCount = 0; String errorMessage = ""; - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); gsonBuilder.registerTypeAdapter(SavingsAccountTransactionEnumData.class, new SavingsAccountTransactionEnumValueSerialiser()); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/sharedaccount/SharedAccountImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/sharedaccount/SharedAccountImportHandler.java index 701ece723..38b5a619e 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/sharedaccount/SharedAccountImportHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/sharedaccount/SharedAccountImportHandler.java @@ -33,6 +33,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandlerUtils; import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper; import org.apache.fineract.portfolio.shareaccounts.data.ShareAccountChargeData; import org.apache.fineract.portfolio.shareaccounts.data.ShareAccountData; import org.apache.poi.ss.usermodel.Cell; @@ -153,7 +154,7 @@ public class SharedAccountImportHandler implements ImportHandler { int successCount = 0; int errorCount = 0; String errorMessage = ""; - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); for (ShareAccountData shareAccountData : shareAccountDataList) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/staff/StaffImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/staff/StaffImportHandler.java index f0ce9d3b3..6349a3a92 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/staff/StaffImportHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/staff/StaffImportHandler.java @@ -32,6 +32,7 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandlerUtils; import org.apache.fineract.infrastructure.bulkimport.importhandler.helper.DateSerializer; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper; import org.apache.fineract.organisation.staff.data.StaffData; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.IndexedColors; @@ -101,7 +102,7 @@ public class StaffImportHandler implements ImportHandler { int successCount = 0; int errorCount = 0; String errorMessage = ""; - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat)); for (StaffData staff : staffList) { try { diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/users/UserImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/users/UserImportHandler.java index f8e29e173..896bebc2d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/users/UserImportHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/users/UserImportHandler.java @@ -31,6 +31,7 @@ import org.apache.fineract.infrastructure.bulkimport.data.Count; import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler; import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandlerUtils; import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.infrastructure.core.serialization.GoogleGsonSerializerHelper; import org.apache.fineract.useradministration.data.AppUserData; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.IndexedColors; @@ -113,7 +114,7 @@ public class UserImportHandler implements ImportHandler { int successCount = 0; int errorCount = 0; String errorMessage = ""; - GsonBuilder gsonBuilder = new GsonBuilder(); + GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder(); for (AppUserData user : users) { try { JsonObject userJsonob = gsonBuilder.create().toJsonTree(user).getAsJsonObject(); diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JodaLocalDateAdapter.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/LocalDateAdapter.java similarity index 90% rename from fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JodaLocalDateAdapter.java rename to fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/LocalDateAdapter.java index 2fced22a0..b2dccfea1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/JodaLocalDateAdapter.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/LocalDateAdapter.java @@ -28,10 +28,10 @@ import java.time.LocalDate; import java.time.temporal.ChronoField; /** - * Serializer for Joda Time {@link LocalDate} that returns the date in array format to match previous Jackson + * Serializer for Java Local Time {@link LocalDate} that returns the date in array format to match previous Jackson * functionality. */ -public class JodaLocalDateAdapter implements JsonSerializer { +public class LocalDateAdapter implements JsonSerializer { @Override @SuppressWarnings("unused") diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/LocalTimeAdapter.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/LocalTimeAdapter.java new file mode 100644 index 000000000..cb061e4da --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/api/LocalTimeAdapter.java @@ -0,0 +1,47 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.infrastructure.core.api; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import java.lang.reflect.Type; +import java.time.LocalTime; + +/** + * Serializer for Java Local Time {@link LocalTime} that returns the time in array format to match previous Jackson + * functionality. + */ +public class LocalTimeAdapter implements JsonSerializer { + + @Override + @SuppressWarnings("unused") + public JsonElement serialize(final LocalTime src, final Type typeOfSrc, final JsonSerializationContext context) { + JsonArray array = null; + if (src != null) { + array = new JsonArray(); + array.add(new JsonPrimitive(src.getHour())); + array.add(new JsonPrimitive(src.getMinute())); + array.add(new JsonPrimitive(src.getSecond())); + } + return array; + } +} diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/GoogleGsonSerializerHelper.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/GoogleGsonSerializerHelper.java index b91456968..6c27caaef 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/GoogleGsonSerializerHelper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/serialization/GoogleGsonSerializerHelper.java @@ -22,6 +22,7 @@ import com.google.gson.ExclusionStrategy; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import java.time.LocalDate; +import java.time.LocalTime; import java.time.MonthDay; import java.time.ZonedDateTime; import java.util.ArrayList; @@ -29,8 +30,9 @@ import java.util.HashSet; import java.util.Set; import org.apache.fineract.infrastructure.core.api.DateAdapter; import org.apache.fineract.infrastructure.core.api.JodaDateTimeAdapter; -import org.apache.fineract.infrastructure.core.api.JodaLocalDateAdapter; import org.apache.fineract.infrastructure.core.api.JodaMonthDayAdapter; +import org.apache.fineract.infrastructure.core.api.LocalDateAdapter; +import org.apache.fineract.infrastructure.core.api.LocalTimeAdapter; import org.apache.fineract.infrastructure.core.api.ParameterListExclusionStrategy; import org.apache.fineract.infrastructure.core.api.ParameterListInclusionStrategy; import org.apache.fineract.infrastructure.core.exception.UnsupportedParameterException; @@ -42,15 +44,6 @@ import org.springframework.stereotype.Service; @Service public final class GoogleGsonSerializerHelper { - public Gson createGsonBuilder(final boolean prettyPrint) { - final GsonBuilder builder = new GsonBuilder(); - registerTypeAdapters(builder); - if (prettyPrint) { - builder.setPrettyPrinting(); - } - return builder.create(); - } - public Gson createGsonBuilderForPartialResponseFiltering(final boolean prettyPrint, final Set responseParameters) { final ExclusionStrategy strategy = new ParameterListInclusionStrategy(responseParameters); @@ -99,9 +92,24 @@ public final class GoogleGsonSerializerHelper { return serializer.toJson(singleDataObject); } + public static GsonBuilder createGsonBuilder() { + return createGsonBuilder(false); + } + + public static GsonBuilder createGsonBuilder(final boolean prettyPrint) { + final GsonBuilder builder = new GsonBuilder(); + registerTypeAdapters(builder); + if (prettyPrint) { + builder.setPrettyPrinting(); + } + return builder; + } + public static void registerTypeAdapters(final GsonBuilder builder) { builder.registerTypeAdapter(java.util.Date.class, new DateAdapter()); - builder.registerTypeAdapter(LocalDate.class, new JodaLocalDateAdapter()); + builder.registerTypeAdapter(LocalDate.class, new LocalDateAdapter()); + // NOTE: was missing, necessary for GSON serialization with JDK 17's restrictive module access + builder.registerTypeAdapter(LocalTime.class, new LocalTimeAdapter()); builder.registerTypeAdapter(ZonedDateTime.class, new JodaDateTimeAdapter()); builder.registerTypeAdapter(MonthDay.class, new JodaMonthDayAdapter()); } diff --git a/gradle.properties b/gradle.properties index f47c29173..11fe8a797 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,5 +16,6 @@ # specific language governing permissions and limitations # under the License. # -org.gradle.jvmargs=-Xmx2g +org.gradle.jvmargs=-Xmx2g --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED buildType=BUILD +org.gradle.caching=true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e708b1c02..7454180f2 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e750102e0..2e6e5897b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 4f906e0c8..1b6c78733 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,67 +17,101 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -106,80 +140,95 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/integration-tests/build.gradle b/integration-tests/build.gradle index 9abc53518..87082026c 100644 --- a/integration-tests/build.gradle +++ b/integration-tests/build.gradle @@ -45,6 +45,7 @@ cargo { } startStopTimeout = 240000 containerProperties { + property 'cargo.start.jvmargs', '--add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED' property 'cargo.tomcat.connector.keystoreFile', file("$rootDir/fineract-provider/src/main/resources/keystore.jks") property 'cargo.tomcat.connector.keystorePass', 'openmf' property 'cargo.tomcat.httpSecure', true diff --git a/integration-tests/dependencies.gradle b/integration-tests/dependencies.gradle index b49c87ebe..a509d93bf 100644 --- a/integration-tests/dependencies.gradle +++ b/integration-tests/dependencies.gradle @@ -20,7 +20,7 @@ dependencies { // testCompile dependencies are ONLY used in src/test, not src/main. // Do NOT repeat dependencies which are ALREADY in implementation or runtimeOnly! // - tomcat 'org.apache.tomcat:tomcat:9.0.54@zip' + tomcat 'org.apache.tomcat:tomcat:9.0.56@zip' testImplementation( files("$rootDir/fineract-provider/build/classes/java/main/"), project(path: ':fineract-provider', configuration: 'runtimeElements'), project(path: ':fineract-client', configuration: 'runtimeElements'), diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanDisbursementDetailsIntegrationTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanDisbursementDetailsIntegrationTest.java index 036c70b1b..6f651c598 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanDisbursementDetailsIntegrationTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/LoanDisbursementDetailsIntegrationTest.java @@ -76,7 +76,7 @@ public class LoanDisbursementDetailsIntegrationTest { String withoutInstallmentAmount = ""; String proposedAmount = "10000"; createTranches.add(this.loanTransactionHelper.createTrancheDetail(id, "01 June 2015", "5000")); - createTranches.add(this.loanTransactionHelper.createTrancheDetail(id, "01 Sep 2015", "5000")); + createTranches.add(this.loanTransactionHelper.createTrancheDetail(id, "01 September 2015", "5000")); final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, "01 January 2014"); LOG.info("---------------------------------CLIENT CREATED WITH ID---------------------------------------------------{}", clientID); diff --git a/oauth2-tests/build.gradle b/oauth2-tests/build.gradle index fd20ac4ac..81e369ef4 100644 --- a/oauth2-tests/build.gradle +++ b/oauth2-tests/build.gradle @@ -45,7 +45,7 @@ cargo { } startStopTimeout = 240000 containerProperties { - property 'cargo.start.jvmargs', '-Dfineract.security.basicauth.enabled=false -Dfineract.security.oauth.enabled=true -Dfineract.security.2fa.enabled=false' + property 'cargo.start.jvmargs', '-Dfineract.security.basicauth.enabled=false -Dfineract.security.oauth.enabled=true -Dfineract.security.2fa.enabled=false --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED' property 'cargo.tomcat.connector.keystoreFile', file("$rootDir/fineract-provider/src/main/resources/keystore.jks") property 'cargo.tomcat.connector.keystorePass', 'openmf' property 'cargo.tomcat.httpSecure', true diff --git a/oauth2-tests/dependencies.gradle b/oauth2-tests/dependencies.gradle index 38065ae1b..b02273ab2 100644 --- a/oauth2-tests/dependencies.gradle +++ b/oauth2-tests/dependencies.gradle @@ -20,7 +20,7 @@ dependencies { // testCompile dependencies are ONLY used in src/test, not src/main. // Do NOT repeat dependencies which are ALREADY in implementation or runtimeOnly! // - tomcat 'org.apache.tomcat:tomcat:9.0.54@zip' + tomcat 'org.apache.tomcat:tomcat:9.0.56@zip' testImplementation( files("$rootDir/fineract-provider/build/classes/java/main/"), project(path: ':fineract-provider', configuration: 'runtimeElements'), 'org.junit.jupiter:junit-jupiter-api' diff --git a/twofactor-tests/build.gradle b/twofactor-tests/build.gradle index e5c45c2da..f2d4cbc82 100644 --- a/twofactor-tests/build.gradle +++ b/twofactor-tests/build.gradle @@ -45,7 +45,7 @@ cargo { } startStopTimeout = 240000 containerProperties { - property 'cargo.start.jvmargs', '-Dfineract.security.basicauth.enabled=true -Dfineract.security.oauth.enabled=false -Dfineract.security.2fa.enabled=true' + property 'cargo.start.jvmargs', '-Dfineract.security.basicauth.enabled=true -Dfineract.security.oauth.enabled=false -Dfineract.security.2fa.enabled=true --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED' property 'cargo.tomcat.connector.keystoreFile', file("$rootDir/fineract-provider/src/main/resources/keystore.jks") property 'cargo.tomcat.connector.keystorePass', 'openmf' property 'cargo.tomcat.httpSecure', true diff --git a/twofactor-tests/dependencies.gradle b/twofactor-tests/dependencies.gradle index d99bb864e..ab61f9f77 100644 --- a/twofactor-tests/dependencies.gradle +++ b/twofactor-tests/dependencies.gradle @@ -20,7 +20,7 @@ dependencies { // testCompile dependencies are ONLY used in src/test, not src/main. // Do NOT repeat dependencies which are ALREADY in implementation or runtimeOnly! // - tomcat 'org.apache.tomcat:tomcat:9.0.54@zip' + tomcat 'org.apache.tomcat:tomcat:9.0.56@zip' testImplementation( files("$rootDir/fineract-provider/build/classes/java/main/"), project(path: ':fineract-provider', configuration: 'runtimeElements'), 'org.junit.jupiter:junit-jupiter-api',