mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
Add better testing of domain and host creation using multi-part TLDs
Added validation on domain creation, preventing a domain from being created if it equals an existing TLD. Added domain create tests for domains using multi-part TLDs that shared suffixes and prefixes. Added host create tests for hosts using multi-part TLDs that shared suffixes. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=164297749
This commit is contained in:
parent
b9a8853f4b
commit
e786c8d6ff
14 changed files with 322 additions and 14 deletions
|
@ -16,6 +16,7 @@ package google.registry.flows.domain;
|
|||
|
||||
import static google.registry.model.eppoutput.CheckData.DomainCheck.create;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.createTlds;
|
||||
import static google.registry.testing.DatastoreHelper.loadRegistrar;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainApplication;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveDomain;
|
||||
|
@ -39,6 +40,7 @@ import google.registry.flows.domain.DomainFlowUtils.BadPeriodUnitException;
|
|||
import google.registry.flows.domain.DomainFlowUtils.CurrencyUnitMismatchException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.DashesInThirdAndFourthException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.DomainLabelTooLongException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.DomainNameExistsAsTldException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.EmptyDomainNamePartException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.FeeChecksDontSupportPhasesException;
|
||||
import google.registry.flows.domain.DomainFlowUtils.InvalidIdnDomainLabelException;
|
||||
|
@ -357,6 +359,18 @@ public class DomainCheckFlowTest
|
|||
doFailingBadLabelTest("tld", BadDomainNamePartsCountException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_domainNameExistsAsTld_lowercase() throws Exception {
|
||||
createTlds("foo.tld", "tld");
|
||||
doFailingBadLabelTest("foo.tld", DomainNameExistsAsTldException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_domainNameExistsAsTld_uppercase() throws Exception {
|
||||
createTlds("foo.tld", "tld");
|
||||
doFailingBadLabelTest("FOO.TLD", BadDomainNameCharacterException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_invalidPunycode() throws Exception {
|
||||
doFailingBadLabelTest("xn--abcdefg.tld", InvalidPunycodeException.class);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue