mirror of
https://github.com/google/nomulus.git
synced 2025-06-09 22:14:45 +02:00
Modify DeleteAllocationTokensCommand to have the same input structure as UpdateATC
It's dangerous to have a blank prefix delete all tokens and this allows for some code unification. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=250493453
This commit is contained in:
parent
4d4926bac7
commit
5c127b8020
5 changed files with 124 additions and 89 deletions
|
@ -176,7 +176,7 @@ public class UpdateAllocationTokensCommandTest
|
|||
IllegalArgumentException.class,
|
||||
() -> runCommandForced("--prefix", "token", "--tokens", "token")))
|
||||
.hasMessageThat()
|
||||
.isEqualTo("Must provide one of --tokens or --prefix, not both");
|
||||
.isEqualTo("Must provide one of --tokens or --prefix, not both / neither");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -185,7 +185,14 @@ public class UpdateAllocationTokensCommandTest
|
|||
assertThrows(
|
||||
IllegalArgumentException.class, () -> runCommandForced("--allowed_tlds", "tld")))
|
||||
.hasMessageThat()
|
||||
.isEqualTo("Must provide one of --tokens or --prefix, not both");
|
||||
.isEqualTo("Must provide one of --tokens or --prefix, not both / neither");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_emptyPrefix() {
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(IllegalArgumentException.class, () -> runCommandForced("--prefix", ""));
|
||||
assertThat(thrown).hasMessageThat().isEqualTo("Provided prefix should not be blank");
|
||||
}
|
||||
|
||||
private static AllocationToken.Builder builderWithPromo() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue