diff --git a/orcid-core/src/test/java/org/orcid/core/oauth/OrcidRefreshTokenTokenGranterTest.java b/orcid-core/src/test/java/org/orcid/core/oauth/OrcidRefreshTokenTokenGranterTest.java index 9666752b4ae..e93edb05829 100644 --- a/orcid-core/src/test/java/org/orcid/core/oauth/OrcidRefreshTokenTokenGranterTest.java +++ b/orcid-core/src/test/java/org/orcid/core/oauth/OrcidRefreshTokenTokenGranterTest.java @@ -18,6 +18,7 @@ import javax.transaction.Transactional; import org.apache.commons.lang.StringUtils; +import org.apache.commons.math3.random.RandomDataGenerator; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -433,7 +434,8 @@ public void tryToCreateRefreshTokenWithInvalidParentTokenValueTest() { } private long getRandom() { - Random random = new Random(System.currentTimeMillis()); - return random.nextLong(); + long leftLimit = 10L; + long rightLimit = 10000000L; + return new RandomDataGenerator().nextLong(leftLimit, rightLimit); } }