Skip to content

Commit 10d8382

Browse files
committed
Update logic to seed random generator randomly
1 parent 46ba66c commit 10d8382

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

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

1616
import java.math.BigDecimal;
17+
import java.util.Random;
1718

1819
import static org.hamcrest.MatcherAssert.assertThat;
1920
import static org.hamcrest.CoreMatchers.instanceOf;
@@ -69,9 +70,10 @@ public void successfulMfaVerifyCodeRequest() throws ApiException {
6970
BigDecimal expirationTime = new BigDecimal(3);
7071

7172
// Generate a random TN for the setTo - otherwise we get heavily rate limited
72-
Integer minTn = 1111111111;
73+
Long minTn = 1111111111;
7374
Long maxTn = 9999999999L;
74-
Integer random_int = (int) Math.floor(Math.random() * (maxTn - minTn + 1) + minTn);
75+
Random random = new Random(System.currentTimeMillis());
76+
Long random_int = random.nextLong(maxTn - minTn) + minTn;
7577

7678
VerifyCodeRequest request = new VerifyCodeRequest();
7779
request.setTo("+1" + random_int.toString());

0 commit comments

Comments
 (0)