mirror of
https://github.com/google/nomulus
synced 2026-01-08 15:21:46 +00:00
Fix stdout of DeleteAllocationTokensCommand
It was saying it was deleting tokens it wasn't, because it was outputting the raw input list of tokens rather than the list that filtered out redeemed or domain-specific tokens. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=227769266
This commit is contained in:
@@ -101,7 +101,11 @@ final class DeleteAllocationTokensCommand extends ConfirmingCommand
|
||||
System.out.printf(
|
||||
"%s tokens: %s\n",
|
||||
dryRun ? "Would delete" : "Deleted",
|
||||
JOINER.join(batch.stream().map(Key::getName).collect(toImmutableSet())));
|
||||
JOINER.join(
|
||||
tokensToDelete.stream()
|
||||
.map(AllocationToken::getToken)
|
||||
.sorted()
|
||||
.collect(toImmutableSet())));
|
||||
return tokensToDelete.size();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ public class DeleteAllocationTokensCommandTest
|
||||
runCommandForced("--prefix", "");
|
||||
assertThat(reloadTokens(preNot1, preNot2, othrNot)).isEmpty();
|
||||
assertThat(reloadTokens(preRed1, preRed2, othrRed)).containsExactly(preRed1, preRed2, othrRed);
|
||||
assertInStdout("Deleted tokens: asdgfho7HASDS, prefix2978204, prefix8ZZZhs8");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -84,6 +85,7 @@ public class DeleteAllocationTokensCommandTest
|
||||
runCommandForced("--prefix", "", "--dry_run");
|
||||
assertThat(reloadTokens(preRed1, preRed2, preNot1, preNot2, othrRed, othrNot))
|
||||
.containsExactly(preRed1, preRed2, preNot1, preNot2, othrRed, othrNot);
|
||||
assertInStdout("Would delete tokens: asdgfho7HASDS, prefix2978204, prefix8ZZZhs8");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user