You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by vi...@apache.org on 2021/10/20 22:12:56 UTC

[fineract] branch develop updated: Revert "https://issues.apache.org/jira/browse/FINERACT-1415 fix (#1908)"

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

victorromero 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 5d8cb92  Revert "https://issues.apache.org/jira/browse/FINERACT-1415 fix (#1908)"
5d8cb92 is described below

commit 5d8cb926e513f0340b67d8c7a211d2822731827a
Author: Victor Romero <vi...@fintecheando.mx>
AuthorDate: Wed Oct 20 17:11:52 2021 -0500

    Revert "https://issues.apache.org/jira/browse/FINERACT-1415 fix (#1908)"
    
    This reverts commit 5246850b84cfba07a044045e7d62041a19cb4b5a.
---
 ...folioCommandSourceWritePlatformServiceImpl.java |  4 ++--
 .../contentrepository/ContentRepositoryUtils.java  |  4 ++--
 .../fineract/infrastructure/gcm/domain/Sender.java |  4 ++--
 .../jobs/service/SchedulerTriggerListener.java     |  4 ++--
 .../security/service/RandomOTPGenerator.java       |  5 +----
 .../security/service/RandomPasswordGenerator.java  |  5 +----
 .../service/LoanSchedularServiceImpl.java          |  4 ++--
 .../service/RecalculateInterestPoster.java         |  5 +++--
 ...erviceRegistrationWritePlatformServiceImpl.java |  4 +---
 .../integrationtests/AuditIntegrationTest.java     |  4 ++--
 .../BatchRequestsIntegrationTest.java              | 23 ++++++++++------------
 .../fineract/integrationtests/ClientTest.java      |  4 ++--
 .../integrationtests/client/IntegrationTest.java   |  4 ++--
 .../fineract/integrationtests/common/Utils.java    |  4 ++--
 .../integrationtests/common/WorkingDaysHelper.java |  4 ++--
 .../common/provisioning/ProvisioningHelper.java    |  4 ++--
 16 files changed, 38 insertions(+), 48 deletions(-)

diff --git a/fineract-provider/src/main/java/org/apache/fineract/commands/service/PortfolioCommandSourceWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/commands/service/PortfolioCommandSourceWritePlatformServiceImpl.java
index 7604e58..e2b0288 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/commands/service/PortfolioCommandSourceWritePlatformServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/commands/service/PortfolioCommandSourceWritePlatformServiceImpl.java
@@ -20,8 +20,8 @@ package org.apache.fineract.commands.service;
 
 import com.google.gson.JsonElement;
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import java.security.SecureRandom;
 import java.time.ZonedDateTime;
+import java.util.Random;
 import org.apache.fineract.commands.domain.CommandSource;
 import org.apache.fineract.commands.domain.CommandSourceRepository;
 import org.apache.fineract.commands.domain.CommandWrapper;
@@ -53,7 +53,7 @@ public class PortfolioCommandSourceWritePlatformServiceImpl implements Portfolio
     private final CommandProcessingService processAndLogCommandService;
     private final SchedulerJobRunnerReadService schedulerJobRunnerReadService;
     private static final Logger LOG = LoggerFactory.getLogger(PortfolioCommandSourceWritePlatformServiceImpl.class);
-    private static final SecureRandom random = new SecureRandom();
+    private static final Random random = new Random();
 
     @Autowired
     public PortfolioCommandSourceWritePlatformServiceImpl(final PlatformSecurityContext context,
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryUtils.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryUtils.java
index 0364710..d79a98e 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryUtils.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/documentmanagement/contentrepository/ContentRepositoryUtils.java
@@ -19,9 +19,9 @@
 package org.apache.fineract.infrastructure.documentmanagement.contentrepository;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Random;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.fineract.infrastructure.core.data.ApiParameterError;
 import org.apache.fineract.infrastructure.core.domain.Base64EncodedImage;
@@ -32,7 +32,7 @@ import org.apache.fineract.infrastructure.documentmanagement.exception.ContentMa
 
 public final class ContentRepositoryUtils {
 
-    private static final SecureRandom random = new SecureRandom();
+    private static final Random random = new Random();
 
     private ContentRepositoryUtils() {}
 
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/Sender.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/Sender.java
index b102c28..650a8f6 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/Sender.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/gcm/domain/Sender.java
@@ -65,11 +65,11 @@ import java.io.OutputStream;
 import java.net.HttpURLConnection;
 import java.net.URL;
 import java.nio.charset.StandardCharsets;
-import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Random;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import org.apache.fineract.infrastructure.gcm.GcmConstants;
@@ -89,7 +89,7 @@ public class Sender {
      */
     protected static final int MAX_BACKOFF_DELAY = 1024000;
 
-    private final SecureRandom random = new SecureRandom();
+    protected final Random random = new Random();
     protected static final Logger LOG = Logger.getLogger(Sender.class.getName());
 
     private final String key;
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerTriggerListener.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerTriggerListener.java
index 9183e5b..a971b54 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerTriggerListener.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/SchedulerTriggerListener.java
@@ -19,7 +19,7 @@
 package org.apache.fineract.infrastructure.jobs.service;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import java.security.SecureRandom;
+import java.util.Random;
 import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
 import org.apache.fineract.infrastructure.core.service.ThreadLocalContextUtil;
 import org.apache.fineract.infrastructure.security.service.TenantDetailsService;
@@ -37,7 +37,7 @@ import org.springframework.stereotype.Component;
 public class SchedulerTriggerListener implements TriggerListener {
 
     private static final Logger LOG = LoggerFactory.getLogger(SchedulerTriggerListener.class);
-    private static final SecureRandom random = new SecureRandom();
+    private static final Random random = new Random();
 
     private final SchedularWritePlatformService schedularService;
     private final TenantDetailsService tenantDetailsService;
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/RandomOTPGenerator.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/RandomOTPGenerator.java
index 8782390..c53e6e7 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/RandomOTPGenerator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/RandomOTPGenerator.java
@@ -18,13 +18,10 @@
  */
 package org.apache.fineract.infrastructure.security.service;
 
-import java.security.SecureRandom;
-
 public class RandomOTPGenerator {
 
     private static final String allowedCharacters = "0123456789ABCDEFGHIJKLMNOPQRSTUVQXYZ";
     private final int tokenLength;
-    private static final SecureRandom random = new SecureRandom();
 
     public RandomOTPGenerator(int tokenLength) {
         this.tokenLength = tokenLength;
@@ -33,7 +30,7 @@ public class RandomOTPGenerator {
     public String generate() {
         StringBuilder builder = new StringBuilder();
         for (int i = 0; i < tokenLength; i++) {
-            builder.append(allowedCharacters.charAt((int) (random.nextDouble() * allowedCharacters.length())));
+            builder.append(allowedCharacters.charAt((int) (Math.random() * allowedCharacters.length())));
         }
 
         return builder.toString();
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/RandomPasswordGenerator.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/RandomPasswordGenerator.java
index 8c90750..41fc826 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/RandomPasswordGenerator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/service/RandomPasswordGenerator.java
@@ -18,12 +18,9 @@
  */
 package org.apache.fineract.infrastructure.security.service;
 
-import java.security.SecureRandom;
-
 public class RandomPasswordGenerator {
 
     private final int numberOfCharactersInPassword;
-    private static final SecureRandom random = new SecureRandom();
 
     public RandomPasswordGenerator(final int numberOfCharactersInPassword) {
         this.numberOfCharactersInPassword = numberOfCharactersInPassword;
@@ -33,7 +30,7 @@ public class RandomPasswordGenerator {
 
         final StringBuilder passwordBuilder = new StringBuilder(this.numberOfCharactersInPassword);
         for (int i = 0; i < this.numberOfCharactersInPassword; i++) {
-            passwordBuilder.append((char) ((int) (random.nextDouble() * 26) + 97));
+            passwordBuilder.append((char) ((int) (Math.random() * 26) + 97));
         }
         return passwordBuilder.toString();
     }
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanSchedularServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanSchedularServiceImpl.java
index ec173b6..3779f01 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanSchedularServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanSchedularServiceImpl.java
@@ -19,13 +19,13 @@
 package org.apache.fineract.portfolio.loanaccount.service;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Random;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
@@ -56,7 +56,7 @@ import org.springframework.util.CollectionUtils;
 public class LoanSchedularServiceImpl implements LoanSchedularService {
 
     private static final Logger LOG = LoggerFactory.getLogger(LoanSchedularServiceImpl.class);
-    private static final SecureRandom random = new SecureRandom();
+    private static final Random random = new Random();
 
     private final ConfigurationDomainService configurationDomainService;
     private final LoanReadPlatformService loanReadPlatformService;
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/RecalculateInterestPoster.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/RecalculateInterestPoster.java
index 17950d5..0a1a938 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/RecalculateInterestPoster.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/RecalculateInterestPoster.java
@@ -19,10 +19,10 @@
 package org.apache.fineract.portfolio.loanaccount.service;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.Random;
 import java.util.concurrent.Callable;
 import org.apache.fineract.infrastructure.core.service.ThreadLocalContextUtil;
 import org.apache.fineract.infrastructure.jobs.exception.JobExecutionException;
@@ -38,7 +38,7 @@ import org.springframework.stereotype.Component;
 public class RecalculateInterestPoster implements Callable<Void> {
 
     private static final Logger LOG = LoggerFactory.getLogger(RecalculateInterestPoster.class);
-    private static final SecureRandom random = new SecureRandom();
+    private static final Random random = new Random();
 
     private Collection<Long> loanIds;
     private LoanWritePlatformService loanWritePlatformService;
@@ -81,6 +81,7 @@ public class RecalculateInterestPoster implements Callable<Void> {
                         // Else sleep for a random time (between 1 to 10
                         // seconds) and continue
                         try {
+                            Random random = new Random();
                             int randomNum = random.nextInt(maxIntervalBetweenRetries + 1);
                             Thread.sleep(1000 + (randomNum * 1000));
                             numberOfRetries = numberOfRetries + 1;
diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/registration/service/SelfServiceRegistrationWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/registration/service/SelfServiceRegistrationWritePlatformServiceImpl.java
index 089c8dc..6af0616 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/registration/service/SelfServiceRegistrationWritePlatformServiceImpl.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/registration/service/SelfServiceRegistrationWritePlatformServiceImpl.java
@@ -22,7 +22,6 @@ import com.google.gson.Gson;
 import com.google.gson.JsonElement;
 import com.google.gson.reflect.TypeToken;
 import java.lang.reflect.Type;
-import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -87,7 +86,6 @@ public class SelfServiceRegistrationWritePlatformServiceImpl implements SelfServ
     private final SmsCampaignDropdownReadPlatformService smsCampaignDropdownReadPlatformService;
     private final AppUserReadPlatformService appUserReadPlatformService;
     private final RoleRepository roleRepository;
-    private static final SecureRandom random = new SecureRandom();
 
     @Autowired
     public SelfServiceRegistrationWritePlatformServiceImpl(final SelfServiceRegistrationRepository selfServiceRegistrationRepository,
@@ -236,7 +234,7 @@ public class SelfServiceRegistrationWritePlatformServiceImpl implements SelfServ
     }
 
     public static String randomAuthorizationTokenGeneration() {
-        Integer randomPIN = (int) (random.nextDouble() * 9000) + 1000;
+        Integer randomPIN = (int) (Math.random() * 9000) + 1000;
         return randomPIN.toString();
     }
 
diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/AuditIntegrationTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/AuditIntegrationTest.java
index 8d2afa4..484f27b 100644
--- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/AuditIntegrationTest.java
+++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/AuditIntegrationTest.java
@@ -24,10 +24,10 @@ import io.restassured.builder.ResponseSpecBuilder;
 import io.restassured.http.ContentType;
 import io.restassured.specification.RequestSpecification;
 import io.restassured.specification.ResponseSpecification;
-import java.security.SecureRandom;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Random;
 import org.apache.fineract.integrationtests.common.AuditHelper;
 import org.apache.fineract.integrationtests.common.ClientHelper;
 import org.apache.fineract.integrationtests.common.OfficeHelper;
@@ -46,7 +46,7 @@ public class AuditIntegrationTest {
     private RequestSpecification requestSpec;
     private ClientHelper clientHelper;
     private AuditHelper auditHelper;
-    private static final SecureRandom rand = new SecureRandom();
+    private static final Random rand = new Random();
 
     /**
      * Sets up the essential settings for the TEST like contentType, expectedStatusCode. It uses the '@BeforeEach'
diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/BatchRequestsIntegrationTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/BatchRequestsIntegrationTest.java
index c978d43..fd835ce 100644
--- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/BatchRequestsIntegrationTest.java
+++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/BatchRequestsIntegrationTest.java
@@ -23,7 +23,6 @@ import io.restassured.builder.ResponseSpecBuilder;
 import io.restassured.http.ContentType;
 import io.restassured.specification.RequestSpecification;
 import io.restassured.specification.ResponseSpecification;
-import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.List;
 import org.apache.fineract.batch.domain.BatchRequest;
@@ -52,7 +51,6 @@ public class BatchRequestsIntegrationTest {
     private static final Logger LOG = LoggerFactory.getLogger(BatchRequestsIntegrationTest.class);
     private ResponseSpecification responseSpec;
     private RequestSpecification requestSpec;
-    private static final SecureRandom random = new SecureRandom();
 
     public BatchRequestsIntegrationTest() {
 
@@ -81,7 +79,7 @@ public class BatchRequestsIntegrationTest {
     public void shouldReturnOkStatusForLoansAppliedToSelectedClients() {
 
         // Generate a random count of number of clients to be created
-        final Integer clientsCount = (int) Math.ceil(random.nextDouble() * 7) + 3;
+        final Integer clientsCount = (int) Math.ceil(Math.random() * 7) + 3;
         final Integer[] clientIDs = new Integer[clientsCount];
 
         // Create a new group and get its groupId
@@ -95,17 +93,17 @@ public class BatchRequestsIntegrationTest {
         }
 
         // Generate a random count of number of new loan products to be created
-        final Integer loansCount = (int) Math.ceil(random.nextDouble() * 4) + 1;
+        final Integer loansCount = (int) Math.ceil(Math.random() * 4) + 1;
         final Integer[] loanProducts = new Integer[loansCount];
 
         // Create new loan Products
         for (Integer i = 0; i < loansCount; i++) {
             final String loanProductJSON = new LoanProductTestBuilder() //
-                    .withPrincipal(String.valueOf(10000.00 + Math.ceil(random.nextDouble() * 1000000.00))) //
-                    .withNumberOfRepayments(String.valueOf(2 + (int) Math.ceil(random.nextDouble() * 36))) //
-                    .withRepaymentAfterEvery(String.valueOf(1 + (int) Math.ceil(random.nextDouble() * 3))) //
+                    .withPrincipal(String.valueOf(10000.00 + Math.ceil(Math.random() * 1000000.00))) //
+                    .withNumberOfRepayments(String.valueOf(2 + (int) Math.ceil(Math.random() * 36))) //
+                    .withRepaymentAfterEvery(String.valueOf(1 + (int) Math.ceil(Math.random() * 3))) //
                     .withRepaymentTypeAsMonth() //
-                    .withinterestRatePerPeriod(String.valueOf(1 + (int) Math.ceil(random.nextDouble() * 4))) //
+                    .withinterestRatePerPeriod(String.valueOf(1 + (int) Math.ceil(Math.random() * 4))) //
                     .withInterestRateFrequencyTypeAsMonths() //
                     .withAmortizationTypeAsEqualPrincipalPayment() //
                     .withInterestTypeAsDecliningBalance() //
@@ -115,23 +113,22 @@ public class BatchRequestsIntegrationTest {
         }
 
         // Select anyone of the loan products at random
-        final Integer loanProductID = loanProducts[(int) Math.floor(random.nextDouble() * (loansCount - 1))];
+        final Integer loanProductID = loanProducts[(int) Math.floor(Math.random() * (loansCount - 1))];
 
         final List<BatchRequest> batchRequests = new ArrayList<>();
 
         // Select a few clients from created group at random
-        Integer selClientsCount = (int) Math.ceil(random.nextDouble() * clientsCount) + 2;
+        Integer selClientsCount = (int) Math.ceil(Math.random() * clientsCount) + 2;
         for (int i = 0; i < selClientsCount; i++) {
 
             final Integer collateralId = CollateralManagementHelper.createCollateralProduct(this.requestSpec, this.responseSpec);
             Assertions.assertNotNull(collateralId);
             final Integer clientCollateralId = CollateralManagementHelper.createClientCollateral(this.requestSpec, this.responseSpec,
-                    String.valueOf(clientIDs[(int) Math.floor(random.nextDouble() * (clientsCount - 1))]), collateralId);
+                    String.valueOf(clientIDs[(int) Math.floor(Math.random() * (clientsCount - 1))]), collateralId);
             Assertions.assertNotNull(clientCollateralId);
 
             BatchRequest br = BatchHelper.applyLoanRequest((long) selClientsCount, null, loanProductID, clientCollateralId);
-            br.setBody(br.getBody().replace("$.clientId",
-                    String.valueOf(clientIDs[(int) Math.floor(random.nextDouble() * (clientsCount - 1))])));
+            br.setBody(br.getBody().replace("$.clientId", String.valueOf(clientIDs[(int) Math.floor(Math.random() * (clientsCount - 1))])));
             batchRequests.add(br);
         }
 
diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientTest.java
index 6f2622d..f467c82 100644
--- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientTest.java
+++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientTest.java
@@ -26,9 +26,9 @@ import io.restassured.builder.ResponseSpecBuilder;
 import io.restassured.http.ContentType;
 import io.restassured.specification.RequestSpecification;
 import io.restassured.specification.ResponseSpecification;
-import java.security.SecureRandom;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Random;
 import org.apache.fineract.integrationtests.common.ClientHelper;
 import org.apache.fineract.integrationtests.common.Utils;
 import org.junit.jupiter.api.BeforeEach;
@@ -39,7 +39,7 @@ public class ClientTest {
     private ResponseSpecification responseSpec;
     private RequestSpecification requestSpec;
     private ClientHelper clientHelper;
-    private static final SecureRandom rand = new SecureRandom();
+    private static final Random rand = new Random();
 
     @BeforeEach
     public void setup() {
diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/client/IntegrationTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/client/IntegrationTest.java
index ccebad5..7a09890 100644
--- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/client/IntegrationTest.java
+++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/client/IntegrationTest.java
@@ -33,8 +33,8 @@ import com.google.common.truth.Truth;
 import com.google.common.truth.Truth8;
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.math.BigDecimal;
-import java.security.SecureRandom;
 import java.util.Optional;
+import java.util.Random;
 import okhttp3.logging.HttpLoggingInterceptor.Level;
 import org.apache.fineract.client.util.Calls;
 import org.apache.fineract.client.util.FineractClient;
@@ -56,7 +56,7 @@ import retrofit2.Response;
 @TestMethodOrder(MethodOrderer.OrderAnnotation.class)
 public abstract class IntegrationTest {
 
-    private static final SecureRandom random = new SecureRandom();
+    private static final Random random = new Random();
 
     private FineractClient fineract;
 
diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/Utils.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/Utils.java
index 6cf4542..b045207 100644
--- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/Utils.java
+++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/Utils.java
@@ -31,7 +31,6 @@ import io.restassured.response.Response;
 import io.restassured.specification.RequestSpecification;
 import io.restassured.specification.ResponseSpecification;
 import java.io.File;
-import java.security.SecureRandom;
 import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -39,6 +38,7 @@ import java.time.LocalDate;
 import java.time.ZoneId;
 import java.util.Calendar;
 import java.util.Locale;
+import java.util.Random;
 import java.util.TimeZone;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.fineract.infrastructure.core.service.DateUtils;
@@ -58,7 +58,7 @@ public final class Utils {
     }
 
     private static final Logger LOG = LoggerFactory.getLogger(Utils.class);
-    private static final SecureRandom random = new SecureRandom();
+    private static final Random random = new Random();
 
     public static final String TENANT_PARAM_NAME = "tenantIdentifier";
     public static final String DEFAULT_TENANT = "default";
diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/WorkingDaysHelper.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/WorkingDaysHelper.java
index b06682e..56be68a 100644
--- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/WorkingDaysHelper.java
+++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/WorkingDaysHelper.java
@@ -22,8 +22,8 @@ import com.google.gson.Gson;
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import io.restassured.specification.RequestSpecification;
 import io.restassured.specification.ResponseSpecification;
-import java.security.SecureRandom;
 import java.util.HashMap;
+import java.util.Random;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -35,7 +35,7 @@ public final class WorkingDaysHelper {
 
     private static final Logger LOG = LoggerFactory.getLogger(WorkingDaysHelper.class);
     private static final String WORKINGDAYS_URL = "/fineract-provider/api/v1/workingdays";
-    private static final SecureRandom random = new SecureRandom();
+    private static final Random random = new Random();
 
     public static Object updateWorkingDays(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
         final String UPDATE_WORKINGDAYS_URL = WORKINGDAYS_URL + "?" + Utils.TENANT_IDENTIFIER;
diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/provisioning/ProvisioningHelper.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/provisioning/ProvisioningHelper.java
index 931d0b2..ace93e8 100644
--- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/provisioning/ProvisioningHelper.java
+++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/common/provisioning/ProvisioningHelper.java
@@ -20,20 +20,20 @@ package org.apache.fineract.integrationtests.common.provisioning;
 
 import com.google.gson.Gson;
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import java.security.SecureRandom;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Random;
 import org.apache.fineract.infrastructure.core.service.DateUtils;
 import org.apache.fineract.integrationtests.common.Utils;
 import org.apache.fineract.integrationtests.common.accounting.Account;
 
 public final class ProvisioningHelper {
 
-    private static final SecureRandom rand = new SecureRandom();
+    private static final Random rand = new Random();
 
     private ProvisioningHelper() {