mirror of
https://github.com/google/nomulus
synced 2026-09-13 11:34:31 +00:00
Fix CreateLrpTokensCommand to not split lines on double-quoted comma
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=137722530
This commit is contained in:
@@ -109,6 +109,34 @@ public class CreateLrpTokensCommandTest extends CommandTestCase<CreateLrpTokensC
|
||||
assertInStdout("domain.tld,LRP_abcdefghijklmnop");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_oneAssignee_byFile_withMetadata_quotedString() throws Exception {
|
||||
Files.write("domain.tld,\"foo,foo\",bar", assigneeFile, UTF_8);
|
||||
runCommand("--input=" + assigneeFilePath, "--tlds=tld", "--metadata_columns=key=1,key2=2");
|
||||
assertLrpTokens(
|
||||
createToken(
|
||||
"LRP_abcdefghijklmnop",
|
||||
"domain.tld",
|
||||
ImmutableSet.of("tld"),
|
||||
null,
|
||||
ImmutableMap.of("key", "foo,foo", "key2", "bar")));
|
||||
assertInStdout("domain.tld,LRP_abcdefghijklmnop");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_oneAssignee_byFile_withMetadata_twoQuotedStrings() throws Exception {
|
||||
Files.write("domain.tld,\"foo,foo\",\"bar,bar\"", assigneeFile, UTF_8);
|
||||
runCommand("--input=" + assigneeFilePath, "--tlds=tld", "--metadata_columns=key=1,key2=2");
|
||||
assertLrpTokens(
|
||||
createToken(
|
||||
"LRP_abcdefghijklmnop",
|
||||
"domain.tld",
|
||||
ImmutableSet.of("tld"),
|
||||
null,
|
||||
ImmutableMap.of("key", "foo,foo", "key2", "bar,bar")));
|
||||
assertInStdout("domain.tld,LRP_abcdefghijklmnop");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_emptyFile() throws Exception {
|
||||
Files.write("", assigneeFile, UTF_8);
|
||||
@@ -235,6 +263,7 @@ public class CreateLrpTokensCommandTest extends CommandTestCase<CreateLrpTokensC
|
||||
assertThat(match.getValidTlds()).containsExactlyElementsIn(expectedToken.getValidTlds());
|
||||
assertThat(match.getRedemptionHistoryEntry())
|
||||
.isEqualTo(expectedToken.getRedemptionHistoryEntry());
|
||||
assertThat(match.getMetadata()).containsExactlyEntriesIn(expectedToken.getMetadata());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user