diff --git a/java/google/registry/tools/DeleteAllocationTokensCommand.java b/java/google/registry/tools/DeleteAllocationTokensCommand.java index aaf02f7f1..f252616f6 100644 --- a/java/google/registry/tools/DeleteAllocationTokensCommand.java +++ b/java/google/registry/tools/DeleteAllocationTokensCommand.java @@ -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(); } } diff --git a/javatests/google/registry/tools/DeleteAllocationTokensCommandTest.java b/javatests/google/registry/tools/DeleteAllocationTokensCommandTest.java index 0ce485f23..ed2a71a14 100644 --- a/javatests/google/registry/tools/DeleteAllocationTokensCommandTest.java +++ b/javatests/google/registry/tools/DeleteAllocationTokensCommandTest.java @@ -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