mirror of
https://github.com/google/nomulus
synced 2026-05-28 18:50:35 +00:00
Define TestRule that manages cache use in tests
All current tests that use caches with custom data expiry values now restore the default config when teardown. We need to prevent new unsafe uses from being introduced. Restoration code have also been added to a few other tests that modifies static fields. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=228888041
This commit is contained in:
@@ -79,9 +79,7 @@ public class RefreshDnsForAllDomainsAction implements Runnable {
|
||||
|
||||
private static final long serialVersionUID = 1455544013508953083L;
|
||||
|
||||
@NonFinalForTesting
|
||||
@VisibleForTesting
|
||||
static DnsQueue dnsQueue = DnsQueue.create();
|
||||
@NonFinalForTesting private static DnsQueue dnsQueue = DnsQueue.create();
|
||||
|
||||
private final ImmutableSet<String> tlds;
|
||||
|
||||
@@ -109,5 +107,12 @@ public class RefreshDnsForAllDomainsAction implements Runnable {
|
||||
getContext().incrementCounter("domains on non-targeted TLDs skipped");
|
||||
}
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public static DnsQueue setDnsQueueForTest(DnsQueue testQueue) {
|
||||
DnsQueue currentQueue = dnsQueue;
|
||||
dnsQueue = testQueue;
|
||||
return currentQueue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user