diff --git a/java/google/registry/tools/GenerateAllocationTokensCommand.java b/java/google/registry/tools/GenerateAllocationTokensCommand.java index 7f7f034e1..1c3828871 100644 --- a/java/google/registry/tools/GenerateAllocationTokensCommand.java +++ b/java/google/registry/tools/GenerateAllocationTokensCommand.java @@ -71,9 +71,9 @@ public class GenerateAllocationTokensCommand implements RemoteApiCommand { @Parameter( names = {"-l", "--length"}, - description = "The length of each token, exclusive of the prefix (if specified); defaults to 12" + description = "The length of each token, exclusive of the prefix (if specified); defaults to 16" ) - private int tokenLength = 12; + private int tokenLength = 16; @Parameter( names = {"--dry_run"}, @@ -84,7 +84,7 @@ public class GenerateAllocationTokensCommand implements RemoteApiCommand { @Inject Retrier retrier; private static final int BATCH_SIZE = 20; - private static final Joiner SKIP_NULLS = Joiner.on(", ").skipNulls(); + private static final Joiner SKIP_NULLS = Joiner.on(',').skipNulls(); @Override public void run() throws IOException { diff --git a/javatests/google/registry/tools/GenerateAllocationTokensCommandTest.java b/javatests/google/registry/tools/GenerateAllocationTokensCommandTest.java index baa071d7c..5777a7f14 100644 --- a/javatests/google/registry/tools/GenerateAllocationTokensCommandTest.java +++ b/javatests/google/registry/tools/GenerateAllocationTokensCommandTest.java @@ -73,8 +73,8 @@ public class GenerateAllocationTokensCommandTest @Test public void testSuccess_defaults() throws Exception { runCommand("--number", "1"); - assertAllocationTokens(createToken("123456789ABC", null, null)); - assertInStdout("123456789ABC"); + assertAllocationTokens(createToken("123456789ABCDEFG", null, null)); + assertInStdout("123456789ABCDEFG"); } @Test @@ -87,15 +87,15 @@ public class GenerateAllocationTokensCommandTest .when(spyCommand) .saveTokens(Mockito.any()); runCommand("--number", "1"); - assertAllocationTokens(createToken("123456789ABC", null, null)); - assertInStdout("123456789ABC"); + assertAllocationTokens(createToken("123456789ABCDEFG", null, null)); + assertInStdout("123456789ABCDEFG"); } @Test public void testSuccess_tokenCollision() throws Exception { AllocationToken existingToken = persistResource(new AllocationToken.Builder().setToken("DEADBEEF123456789ABC").build()); - runCommand("--number", "1", "--prefix", "DEADBEEF"); + runCommand("--number", "1", "--prefix", "DEADBEEF", "--length", "12"); assertAllocationTokens(existingToken, createToken("DEADBEEFDEFGHJKLMNPQ", null, null)); assertInStdout("DEADBEEFDEFGHJKLMNPQ"); } @@ -123,10 +123,11 @@ public class GenerateAllocationTokensCommandTest Files.asCharSink(domainNamesFile, UTF_8).write("foo1.tld\nboo2.tld\nbaz9.tld\n"); runCommand("--domain_names_file", domainNamesFile.getPath()); assertAllocationTokens( - createToken("123456789ABC", null, "foo1.tld"), - createToken("DEFGHJKLMNPQ", null, "boo2.tld"), - createToken("RSTUVWXYZabc", null, "baz9.tld")); - assertInStdout("foo1.tld, 123456789ABC\nboo2.tld, DEFGHJKLMNPQ\nbaz9.tld, RSTUVWXYZabc"); + createToken("123456789ABCDEFG", null, "foo1.tld"), + createToken("HJKLMNPQRSTUVWXY", null, "boo2.tld"), + createToken("Zabcdefghijkmnop", null, "baz9.tld")); + assertInStdout( + "foo1.tld,123456789ABCDEFG\nboo2.tld,HJKLMNPQRSTUVWXY\nbaz9.tld,Zabcdefghijkmnop"); } @Test