diff --git a/core/src/main/java/google/registry/flows/domain/DomainFlowUtils.java b/core/src/main/java/google/registry/flows/domain/DomainFlowUtils.java index d72bce3c6..f92b4d372 100644 --- a/core/src/main/java/google/registry/flows/domain/DomainFlowUtils.java +++ b/core/src/main/java/google/registry/flows/domain/DomainFlowUtils.java @@ -1397,7 +1397,7 @@ public class DomainFlowUtils { } /** Domain name is under tld which doesn't exist. */ - static class TldDoesNotExistException extends ParameterValueRangeErrorException { + public static class TldDoesNotExistException extends ParameterValueRangeErrorException { public TldDoesNotExistException(String tld) { super(String.format("Domain name is under tld %s which doesn't exist", tld)); } diff --git a/core/src/main/java/google/registry/rdap/RdapDataStructures.java b/core/src/main/java/google/registry/rdap/RdapDataStructures.java index 6bb2a3410..fe8ca9bb5 100644 --- a/core/src/main/java/google/registry/rdap/RdapDataStructures.java +++ b/core/src/main/java/google/registry/rdap/RdapDataStructures.java @@ -333,7 +333,6 @@ final class RdapDataStructures { */ @RestrictJsonNames("status[]") enum RdapStatus implements Jsonable { - // Status values specified in RFC 9083 ยง 10.2.2. VALIDATED("validated"), RENEW_PROHIBITED("renew prohibited"), diff --git a/core/src/main/java/google/registry/rdap/RdapDomainAction.java b/core/src/main/java/google/registry/rdap/RdapDomainAction.java index 6b96b3ec2..a20b5b625 100644 --- a/core/src/main/java/google/registry/rdap/RdapDomainAction.java +++ b/core/src/main/java/google/registry/rdap/RdapDomainAction.java @@ -57,6 +57,9 @@ public class RdapDomainAction extends RdapActionBase { InternetDomainName domainName; try { domainName = validateDomainName(pathSearchString); + } catch (DomainFlowUtils.TldDoesNotExistException e) { + // A special case where a valid domain name on a nonexistent TLD should return 404 + throw new NotFoundException(pathSearchString + " not found"); } catch (EppException e) { throw new BadRequestException( String.format( diff --git a/core/src/test/java/google/registry/rdap/RdapDomainActionTest.java b/core/src/test/java/google/registry/rdap/RdapDomainActionTest.java index 2d84042cf..d3e5523d4 100644 --- a/core/src/test/java/google/registry/rdap/RdapDomainActionTest.java +++ b/core/src/test/java/google/registry/rdap/RdapDomainActionTest.java @@ -57,12 +57,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; -/** - * Unit tests for {@link RdapDomainAction}. - * - *
TODO(b/26872828): The next time we do any work on RDAP, consider adding the APNIC RDAP
- * conformance checker to the unit test suite.
- */
+/** Unit tests for {@link RdapDomainAction}. */
class RdapDomainActionTest extends RdapActionBaseTestCase