mirror of
https://github.com/google/nomulus
synced 2026-09-19 14:34:18 +00:00
Don't allow package tokens to discount premium names (#1804)
This commit is contained in:
@@ -228,6 +228,18 @@ public class AllocationTokenTest extends EntityTestCase {
|
||||
.isEqualTo("Package tokens must have renewalPriceBehavior set to SPECIFIED");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFail_packageTokenDiscountPremium() {
|
||||
AllocationToken.Builder builder =
|
||||
new AllocationToken.Builder()
|
||||
.setToken("abc123")
|
||||
.setTokenType(TokenType.PACKAGE)
|
||||
.setRenewalPriceBehavior(RenewalPriceBehavior.SPECIFIED)
|
||||
.setDiscountPremiums(true);
|
||||
IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, builder::build);
|
||||
assertThat(thrown).hasMessageThat().isEqualTo("Package tokens cannot discount premium names");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testBuild_DomainNameWithLessThanTwoParts() {
|
||||
IllegalArgumentException thrown =
|
||||
|
||||
Reference in New Issue
Block a user