Show price of reserved domains when using matching allocation token (#632)

* Show price of reserved domains when using matching allocation token

When the registrar passes the fee extension, this shows the price of the domain
on a check command for reserved domains if the provided allocation token is a
match. Of course, the price is already always displayed on non-reserved names
(regardless of whether the specific provided token is a match or not).

This affects domain checks only; the price is already always displayed on domain
creates because you already by definition have access to register the domain in
question.
This commit is contained in:
Ben McIlwain 2020-06-18 11:57:22 -04:00 committed by GitHub
parent 5fb337b2fe
commit 4c7bdbf3c6
7 changed files with 151 additions and 9 deletions

View file

@ -191,6 +191,21 @@ public class DomainCheckFlowTest extends ResourceCheckFlowTestCase<DomainCheckFl
create(true, "specificuse.tld", null));
}
@Test
public void testSuccess_allocationTokenForReservedDomain_showsFee() throws Exception {
setEppInput("domain_check_allocationtoken_fee_specificuse.xml");
createTld("example");
persistResource(
new AllocationToken.Builder()
.setDomainName("specificuse.tld")
.setToken("abc123")
.setTokenType(SINGLE_USE)
.build());
// Fees are shown for all non-reserved domains and the reserved domain matching this
// allocation token.
runFlowAssertResponse(loadFile("domain_check_allocationtoken_fee_specificuse_response.xml"));
}
@Test
public void testSuccess_oneExists_allocationTokenForWrongDomain() throws Exception {
setEppInput("domain_check_allocationtoken.xml");
@ -440,7 +455,10 @@ public class DomainCheckFlowTest extends ResourceCheckFlowTestCase<DomainCheckFl
@Test
public void testSuccess_duplicatesAllowed() throws Exception {
setEppInput("domain_check_duplicates.xml");
doCheckTest(create(true, "example1.tld", null), create(true, "example1.tld", null));
doCheckTest(
create(true, "example1.tld", null),
create(true, "example2.tld", null),
create(true, "example1.tld", null));
}
@Test