mirror of
https://github.com/google/nomulus.git
synced 2025-06-27 23:03:34 +02:00
Return all applicable reserved list entries associated with a label
Instead of only returning the most severe one, return all applicable ones. This is because the reserved list has grown to a list of types that are not strictly comparable but orthogonal to each other. We can no longer depend on the fact that the most severe type incorporates all properties of those beneath it. Therefore returning all of them and treat them one by one in the calling site is the correct behavior. Due to constraint imposed in eppcom.xsd, during domain checks the response can only contain a reservation reason of fewer than 32 characters, therefore we are returning the message for the type with highest severity, in case of multiple reservation types for a label. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=149776106
This commit is contained in:
parent
9a11f125ff
commit
ebcdae7361
8 changed files with 199 additions and 86 deletions
|
@ -115,6 +115,24 @@ public class DomainCheckFlowTest
|
|||
create(true, "example3.tld", null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_domainWithMultipleReservationType_useMostSevereMessage()
|
||||
throws Exception {
|
||||
persistResource(
|
||||
Registry.get("tld")
|
||||
.asBuilder()
|
||||
.setReservedLists(
|
||||
createReservedList(),
|
||||
persistReservedList("tld-collision", "allowedinsunrise,NAME_COLLISION"))
|
||||
.build());
|
||||
setEppInput("domain_check_one_tld_reserved.xml");
|
||||
doCheckTest(
|
||||
create(false, "reserved.tld", "Reserved"),
|
||||
create(false, "allowedinsunrise.tld", "Cannot be delegated"),
|
||||
create(true, "example2.tld", null),
|
||||
create(true, "example3.tld", null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_anchorTenantReserved() throws Exception {
|
||||
setEppInput("domain_check_anchor.xml");
|
||||
|
@ -398,6 +416,19 @@ public class DomainCheckFlowTest
|
|||
runFlowAssertResponse(readFile("domain_check_fee_response_v06.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_multipleReservations() throws Exception {
|
||||
persistResource(
|
||||
Registry.get("tld")
|
||||
.asBuilder()
|
||||
.setReservedLists(
|
||||
persistReservedList("example-sunrise", "allowedinsunrise,ALLOWED_IN_SUNRISE"))
|
||||
.build());
|
||||
persistActiveDomain("example1.tld");
|
||||
setEppInput("domain_check_fee_v06.xml");
|
||||
runFlowAssertResponse(readFile("domain_check_fee_response_v06.xml"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFeeExtension_v11() throws Exception {
|
||||
persistActiveDomain("example1.tld");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue