mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 08:57:12 +02:00
Fix non-determinism in RegistryTest duplicate auth code test
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=149576311
This commit is contained in:
parent
d4a428fc24
commit
27b9244126
2 changed files with 7 additions and 4 deletions
|
@ -36,10 +36,10 @@ import com.google.common.cache.CacheBuilder;
|
||||||
import com.google.common.cache.CacheLoader;
|
import com.google.common.cache.CacheLoader;
|
||||||
import com.google.common.cache.LoadingCache;
|
import com.google.common.cache.LoadingCache;
|
||||||
import com.google.common.collect.FluentIterable;
|
import com.google.common.collect.FluentIterable;
|
||||||
import com.google.common.collect.HashMultimap;
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.ImmutableSortedMap;
|
import com.google.common.collect.ImmutableSortedMap;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
import com.google.common.collect.LinkedHashMultimap;
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
import com.google.common.collect.Ordering;
|
import com.google.common.collect.Ordering;
|
||||||
import com.google.common.collect.Range;
|
import com.google.common.collect.Range;
|
||||||
|
@ -761,7 +761,7 @@ public class Registry extends ImmutableObject implements Buildable {
|
||||||
* Checks that domain names don't have conflicting auth codes across different reserved lists.
|
* Checks that domain names don't have conflicting auth codes across different reserved lists.
|
||||||
*/
|
*/
|
||||||
private static void checkAuthCodeConflicts(Set<ReservedList> reservedLists) {
|
private static void checkAuthCodeConflicts(Set<ReservedList> reservedLists) {
|
||||||
Multimap<String, String> allAuthCodes = HashMultimap.create();
|
Multimap<String, String> allAuthCodes = LinkedHashMultimap.create();
|
||||||
for (ReservedList list : reservedLists) {
|
for (ReservedList list : reservedLists) {
|
||||||
for (ReservedListEntry entry : list.getReservedListEntries().values()) {
|
for (ReservedListEntry entry : list.getReservedListEntries().values()) {
|
||||||
if (entry.getAuthCode() != null) {
|
if (entry.getAuthCode() != null) {
|
||||||
|
|
|
@ -196,11 +196,14 @@ public class RegistryTest extends EntityTestCase {
|
||||||
"tld-reserved056",
|
"tld-reserved056",
|
||||||
"lol,RESERVED_FOR_ANCHOR_TENANT,conflict2",
|
"lol,RESERVED_FOR_ANCHOR_TENANT,conflict2",
|
||||||
"tim,FULLY_BLOCKED");
|
"tim,FULLY_BLOCKED");
|
||||||
|
ReservedList rl3 = persistReservedList(
|
||||||
|
"tld-reserved057",
|
||||||
|
"lol,RESERVED_FOR_ANCHOR_TENANT,another_conflict");
|
||||||
thrown.expect(
|
thrown.expect(
|
||||||
IllegalArgumentException.class,
|
IllegalArgumentException.class,
|
||||||
"auth code conflicts for labels: [lol=[conflict1, conflict2]]");
|
"auth code conflicts for labels: [lol=[conflict1, conflict2, another_conflict]]");
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
Registry unused = Registry.get("tld").asBuilder().setReservedLists(rl1, rl2).build();
|
Registry unused = Registry.get("tld").asBuilder().setReservedLists(rl1, rl2, rl3).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue