Require token transition schedules for default tokens (#2005)

This commit is contained in:
sarahcaseybot
2023-04-21 17:38:10 -04:00
committed by GitHub
parent 203c20c040
commit e1afe00758
2 changed files with 15 additions and 0 deletions
@@ -440,6 +440,16 @@ class GenerateAllocationTokensCommandTest extends CommandTestCase<GenerateAlloca
.isEqualTo("For UNLIMITED_USE tokens, must specify --token_status_transitions");
}
@Test
void testFailure_defaultPromoMustHaveTransitions() {
assertThat(
assertThrows(
IllegalArgumentException.class,
() -> runCommand("--number", "999", "--type", "DEFAULT_PROMO")))
.hasMessageThat()
.isEqualTo("For DEFAULT_PROMO tokens, must specify --token_status_transitions");
}
private AllocationToken createToken(
String token,
@Nullable HistoryEntryId redemptionHistoryEntryId,