Skip to content

Commit 5a7e83d

Browse files
committed
Switch to ThreadLocalRandom
Random having issues with nextLong ``` The method nextLong() in the type Random is not applicable for the arguments (long) ```
1 parent 0e9d8f7 commit 5a7e83d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/test/java/org/openapitools/client/api/MfaApiTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import org.junit.jupiter.api.Test;
1515

1616
import java.math.BigDecimal;
17-
import java.util.Random;
17+
import java.util.concurrent.ThreadLocalRandom;
1818

1919
import static org.hamcrest.MatcherAssert.assertThat;
2020
import static org.hamcrest.CoreMatchers.instanceOf;
@@ -72,8 +72,8 @@ public void successfulMfaVerifyCodeRequest() throws ApiException {
7272
// Generate a random TN for the setTo - otherwise we get heavily rate limited
7373
Long minTn = 1111111111L;
7474
Long maxTn = 9999999999L;
75-
Random random = new Random(System.currentTimeMillis());
76-
Long random_int = random.nextLong(maxTn - minTn) + minTn;
75+
Long random_int = ThreadLocalRandom.current().nextLong(maxTn - minTn) + minTn;
76+
System.out.println(random_int);
7777

7878
VerifyCodeRequest request = new VerifyCodeRequest();
7979
request.setTo("+1" + random_int.toString());

0 commit comments

Comments
 (0)