Compare commits

..

3 Commits

Author SHA1 Message Date
Michael Hoennig
0416415a86 Merge remote-tracking branch 'origin/master' into check-domain-setup-permission 2024-09-10 10:32:04 +02:00
8e02610679 fix salt problem for yescrypt hashes in HashGenerator (#96)
Co-authored-by: Michael Hoennig <michael@hoennig.de>
Reviewed-on: #96
Reviewed-by: Marc Sandlus <marc.sandlus@hostsharing.net>
2024-09-10 10:31:49 +02:00
Michael Hoennig
6c6f850f35 some more tests 2024-09-10 10:29:56 +02:00

View File

@ -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() {