mirror of
https://github.com/google/nomulus
synced 2026-01-10 16:00:52 +00:00
Add assertTldsExist(Iterable<String>) to check multiple TLDs at once
This is better than calling assertTldExists() inside a for loop because you can throw a single exception reporting all bad TLDs at once rather than only getting as far as the first failure. And then it's also a one-liner instead of 3 lines. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=152412876
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
|
||||
package google.registry.tools;
|
||||
|
||||
import static google.registry.model.registry.Registries.assertTldExists;
|
||||
import static google.registry.model.registry.Registries.assertTldsExist;
|
||||
import static org.joda.time.DateTimeZone.UTC;
|
||||
import static org.joda.time.Duration.standardMinutes;
|
||||
|
||||
@@ -54,9 +54,7 @@ final class GenerateZoneFilesCommand implements ServerSideCommand {
|
||||
|
||||
@Override
|
||||
public void run() throws IOException {
|
||||
for (String tld : mainParameters) {
|
||||
assertTldExists(tld);
|
||||
}
|
||||
assertTldsExist(mainParameters);
|
||||
ImmutableMap<String, Object> params = ImmutableMap.of(
|
||||
"tlds", mainParameters,
|
||||
"exportTime", exportDate.toString());
|
||||
|
||||
Reference in New Issue
Block a user