Improve ListDomainsCommand to list domains on multiple TLDs

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140053423
This commit is contained in:
mcilwain 2016-11-23 11:23:14 -08:00 committed by Ben McIlwain
parent 35d88a9f8c
commit 5eb9702f05
11 changed files with 120 additions and 88 deletions

View file

@ -14,7 +14,11 @@
package google.registry.tools;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import google.registry.tools.server.ListDomainsAction;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
@ -32,7 +36,15 @@ public class ListDomainsCommandTest extends ListObjectsCommandTestCase<ListDomai
}
@Override
final String getTld() {
return "foo";
protected List<String> getTlds() {
return ImmutableList.of("foo");
}
@Test
public void test_tldsParamTooLong() throws Exception {
String tldsParam = "--tld=foo,bar" + Strings.repeat(",baz", 300);
thrown.expect(
IllegalArgumentException.class, "Total length of TLDs is too long for URL parameter");
runCommand(tldsParam);
}
}