diff --git a/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/validators/HsDomainSetupHostingAssetValidatorUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/validators/HsDomainSetupHostingAssetValidatorUnitTest.java index 2baa7e04..ce5c8246 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/validators/HsDomainSetupHostingAssetValidatorUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/validators/HsDomainSetupHostingAssetValidatorUnitTest.java @@ -268,6 +268,24 @@ class HsDomainSetupHostingAssetValidatorUnitTest { .isAccepted(); } + @Test + void allowSetupOfAvailableRegistrable2ndLevelDomain() { + domainSetupFor("example.co.uk").notRegistered() + .isAccepted(); + } + + @Test + void rejectSetupOfRegisteredRegistrable2ndLevelDomainWithoutVerification() { + domainSetupFor("example.co.uk").registered() + .isRejectedWithCauseMissingVerificationIn("example.co.uk"); + } + + @Test + void allowSetupOfRegisteredRegistrable2ndLevelDomainWithVerification() { + domainSetupFor("example.co.uk").registeredWithVerification() + .isAccepted(); + } + @Test void rejectSetupOfExistingRegistrableDomainWithoutValidDnsVerification() { domainSetupFor("example.com").registered() @@ -375,9 +393,11 @@ class HsDomainSetupHostingAssetValidatorUnitTest { } void isRejectedWithCauseMissingVerificationIn(final String domainName) { - assertThat(validate()).contains( + assertThat(validate()).containsAnyOf( "[DNS] no TXT record 'Hostsharing-domain-setup-verification-code=" + expectedHash - + "' found for domain name '" + domainName + "' (nor in its super-domain)"); + + "' found for domain name '" + domainName + "' (nor in its super-domain)", + "[DNS] no TXT record 'Hostsharing-domain-setup-verification-code=" + expectedHash + + "' found for domain name '" + domainName + "'"); } void isAccepted() {