mirror of
https://github.com/google/nomulus
synced 2026-09-19 22:44:26 +00:00
Remove the use of InjectRule in UrlFetchUtilsTest
Random used to be a static variable which requires InjectRule to mock it in unit tests. It is now a singleton, which ensures that the same instance is called every time and Random.nextBytes() generates results that distribute uniformly between each call. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=217592767
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
package google.registry.tmch;
|
||||
|
||||
import static com.google.common.base.Randoms.insecureRandom;
|
||||
import static com.google.common.net.HttpHeaders.AUTHORIZATION;
|
||||
import static com.google.common.net.HttpHeaders.CONTENT_TYPE;
|
||||
import static com.google.common.net.HttpHeaders.LOCATION;
|
||||
@@ -115,6 +116,7 @@ public class NordnUploadActionTest {
|
||||
action.taskQueueUtils = new TaskQueueUtils(new Retrier(new FakeSleeper(clock), 3));
|
||||
action.tld = "tld";
|
||||
action.tmchMarksdbUrl = "http://127.0.0.1";
|
||||
action.random = insecureRandom();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user