mirror of
https://github.com/google/nomulus.git
synced 2025-08-04 17:01:51 +02:00
Change second-level domain name to fully-qualified domain name
Second-level domain name isn't accurate because we support multi-part TLDs, so standardize on the "fullyQualifiedDomainName" name that is used throughout the code base. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=122693009
This commit is contained in:
parent
ca0e546230
commit
a2d2764115
14 changed files with 58 additions and 49 deletions
|
@ -31,7 +31,7 @@ import static google.registry.util.CollectionUtils.union;
|
|||
import static google.registry.util.DateTimeUtils.END_OF_TIME;
|
||||
import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
||||
import static google.registry.util.DomainNameUtils.ACE_PREFIX_REGEX;
|
||||
import static google.registry.util.DomainNameUtils.getTldFromSld;
|
||||
import static google.registry.util.DomainNameUtils.getTldFromDomainName;
|
||||
import static google.registry.util.ResourceUtils.readResourceUtf8;
|
||||
import static java.util.Arrays.asList;
|
||||
import static org.joda.money.CurrencyUnit.USD;
|
||||
|
@ -120,13 +120,13 @@ public class DatastoreHelper {
|
|||
}
|
||||
|
||||
public static DomainResource newDomainResource(String domainName) {
|
||||
String repoId = generateNewDomainRoid(getTldFromSld(domainName));
|
||||
String repoId = generateNewDomainRoid(getTldFromDomainName(domainName));
|
||||
return newDomainResource(domainName, repoId, persistActiveContact("contact1234"));
|
||||
}
|
||||
|
||||
public static DomainResource newDomainResource(String domainName, ContactResource contact) {
|
||||
return newDomainResource(
|
||||
domainName, generateNewDomainRoid(getTldFromSld(domainName)), contact);
|
||||
domainName, generateNewDomainRoid(getTldFromDomainName(domainName)), contact);
|
||||
}
|
||||
|
||||
public static DomainResource newDomainResource(
|
||||
|
@ -152,7 +152,7 @@ public class DatastoreHelper {
|
|||
// contact does, which is usually the applicationId 1.
|
||||
return newDomainApplication(
|
||||
domainName,
|
||||
generateNewDomainRoid(getTldFromSld(domainName)),
|
||||
generateNewDomainRoid(getTldFromDomainName(domainName)),
|
||||
persistActiveContact("contact1234"),
|
||||
LaunchPhase.SUNRISE);
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ public class DatastoreHelper {
|
|||
String domainName, ContactResource contact, LaunchPhase phase) {
|
||||
return newDomainApplication(
|
||||
domainName,
|
||||
generateNewDomainRoid(getTldFromSld(domainName)),
|
||||
generateNewDomainRoid(getTldFromDomainName(domainName)),
|
||||
contact,
|
||||
phase);
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ package google.registry.testing;
|
|||
import static google.registry.testing.DatastoreHelper.generateNewContactHostRoid;
|
||||
import static google.registry.testing.DatastoreHelper.generateNewDomainRoid;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.util.DomainNameUtils.getTldFromSld;
|
||||
import static google.registry.util.DomainNameUtils.getTldFromDomainName;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
@ -221,7 +221,7 @@ public final class FullFieldsTestEntityHelper {
|
|||
Registrar registrar) {
|
||||
DomainResource.Builder builder = new DomainResource.Builder()
|
||||
.setFullyQualifiedDomainName(Idn.toASCII(domain))
|
||||
.setRepoId(generateNewDomainRoid(getTldFromSld(Idn.toASCII(domain))))
|
||||
.setRepoId(generateNewDomainRoid(getTldFromDomainName(Idn.toASCII(domain))))
|
||||
.setLastEppUpdateTime(DateTime.parse("2009-05-29T20:13:00Z"))
|
||||
.setCreationTimeForTest(DateTime.parse("2000-10-08T00:45:00Z"))
|
||||
.setRegistrationExpirationTime(DateTime.parse("2110-10-08T00:44:59Z"))
|
||||
|
|
|
@ -62,7 +62,7 @@ public class GetApplicationIdsCommandTest extends CommandTestCase<GetApplication
|
|||
|
||||
@Test
|
||||
public void testFailure_tldDoesNotExist() throws Exception {
|
||||
thrown.expect(NullPointerException.class);
|
||||
thrown.expect(IllegalArgumentException.class, "Domain name is not under a recognized TLD");
|
||||
runCommand("example.foo");
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ public class CheckApiServletTest {
|
|||
public void testFailure_nullDomain() throws Exception {
|
||||
doTest(ImmutableMap.of(
|
||||
"status", "error",
|
||||
"reason", "Must supply a valid second level domain name"));
|
||||
"reason", "Must supply a valid domain name on an authoritative TLD"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -87,7 +87,7 @@ public class CheckApiServletTest {
|
|||
when(req.getParameter("domain")).thenReturn("");
|
||||
doTest(ImmutableMap.of(
|
||||
"status", "error",
|
||||
"reason", "Must supply a valid second level domain name"));
|
||||
"reason", "Must supply a valid domain name on an authoritative TLD"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -95,7 +95,7 @@ public class CheckApiServletTest {
|
|||
when(req.getParameter("domain")).thenReturn("@#$%^");
|
||||
doTest(ImmutableMap.of(
|
||||
"status", "error",
|
||||
"reason", "Must supply a valid second level domain name"));
|
||||
"reason", "Must supply a valid domain name on an authoritative TLD"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -103,7 +103,7 @@ public class CheckApiServletTest {
|
|||
when(req.getParameter("domain")).thenReturn("foo");
|
||||
doTest(ImmutableMap.of(
|
||||
"status", "error",
|
||||
"reason", "Must supply a valid second level domain name"));
|
||||
"reason", "Must supply a valid domain name on an authoritative TLD"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -111,7 +111,7 @@ public class CheckApiServletTest {
|
|||
when(req.getParameter("domain")).thenReturn("foo.bar");
|
||||
doTest(ImmutableMap.of(
|
||||
"status", "error",
|
||||
"reason", "Domain name is under tld bar which doesn't exist"));
|
||||
"reason", "Must supply a valid domain name on an authoritative TLD"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue