Don't delete or "redeem" unlimited use AllocationTokens

We haven't started dealing with timing or discounts yet, but unlimited use tokens should actually be unlimited use

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=243318266
This commit is contained in:
gbrodman 2019-04-12 13:05:06 -07:00 committed by Ben McIlwain
parent 416a39b003
commit d1e3194fce
5 changed files with 44 additions and 3 deletions

View file

@ -22,6 +22,7 @@ import static google.registry.model.billing.BillingEvent.Flag.ANCHOR_TENANT;
import static google.registry.model.billing.BillingEvent.Flag.SUNRISE;
import static google.registry.model.domain.fee.Fee.FEE_EXTENSION_URIS;
import static google.registry.model.domain.token.AllocationToken.TokenType.SINGLE_USE;
import static google.registry.model.domain.token.AllocationToken.TokenType.UNLIMITED_USE;
import static google.registry.model.eppcommon.StatusValue.OK;
import static google.registry.model.eppcommon.StatusValue.PENDING_DELETE;
import static google.registry.model.eppcommon.StatusValue.SERVER_HOLD;
@ -452,6 +453,20 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
.isEqualTo(Key.create(historyEntry));
}
@Test
public void testSuccess_validAllocationToken_multiUse() throws Exception {
setEppInput("domain_create_allocationtoken.xml", ImmutableMap.of("DOMAIN", "example.tld"));
persistContactsAndHosts();
persistResource(
new AllocationToken.Builder().setTokenType(UNLIMITED_USE).setToken("abc123").build());
clock.advanceOneMilli();
doSuccessfulTest();
clock.advanceOneMilli();
setEppInput("domain_create_allocationtoken.xml", ImmutableMap.of("DOMAIN", "otherexample.tld"));
runFlowAssertResponse(
loadFile("domain_create_response.xml", ImmutableMap.of("DOMAIN", "otherexample.tld")));
}
@Test
public void testSuccess_multipartTld() throws Exception {
createTld("foo.tld");