mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 20:08:01 +01:00
replace deprecated apache RandomUtils
This commit is contained in:
committed by
ravi-signal
parent
37e3bcfc3e
commit
331bbdd4e6
@@ -20,8 +20,6 @@ import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import org.apache.commons.lang3.RandomUtils;
|
||||
import org.mockito.Mockito;
|
||||
import org.mockito.invocation.Invocation;
|
||||
import org.mockito.invocation.MatchableInvocation;
|
||||
@@ -155,7 +153,7 @@ public final class MockUtils {
|
||||
}
|
||||
|
||||
public static SecretBytes randomSecretBytes(final int size) {
|
||||
return new SecretBytes(RandomUtils.nextBytes(size));
|
||||
return new SecretBytes(TestRandomUtil.nextBytes(size));
|
||||
}
|
||||
|
||||
public static SecretBytes secretBytesOf(final int... byteVals) {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package org.whispersystems.textsecuregcm.util;
|
||||
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class TestRandomUtil {
|
||||
private TestRandomUtil() {}
|
||||
|
||||
public static byte[] nextBytes(int numBytes) {
|
||||
final byte[] bytes = new byte[numBytes];
|
||||
ThreadLocalRandom.current().nextBytes(bytes);
|
||||
return bytes;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user