From 53259c357bc921235a7a07bc536b10a181ee4e5d Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Mon, 30 Sep 2024 15:30:27 +0200 Subject: [PATCH] remove targetUnixUser property from unit tests --- ...mainSetupBookingItemValidatorUnitTest.java | 36 +++---------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/booking/item/validators/HsDomainSetupBookingItemValidatorUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/booking/item/validators/HsDomainSetupBookingItemValidatorUnitTest.java index 66d77899..716c7161 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/booking/item/validators/HsDomainSetupBookingItemValidatorUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/booking/item/validators/HsDomainSetupBookingItemValidatorUnitTest.java @@ -36,8 +36,7 @@ class HsDomainSetupBookingItemValidatorUnitTest { .project(project) .caption("Test-Domain") .resources(Map.ofEntries( - entry("domainName", "example.org"), - entry("targetUnixUser", "xyz00") + entry("domainName", "example.org") )) .build(); @@ -59,7 +58,6 @@ class HsDomainSetupBookingItemValidatorUnitTest { .caption("Test-Domain") .resources(Map.ofEntries( entry("domainName", "example.org"), - entry("targetUnixUser", "xyz00"), entry("verificationCode", "1234-5678-9100") )) .build(); @@ -80,8 +78,7 @@ class HsDomainSetupBookingItemValidatorUnitTest { .project(project) .caption("Test-Domain") .resources(Map.ofEntries( - entry("domainName", right(TOO_LONG_DOMAIN_NAME, 253)), - entry("targetUnixUser", "xyz00") + entry("domainName", right(TOO_LONG_DOMAIN_NAME, 253)) )) .build(); @@ -99,8 +96,7 @@ class HsDomainSetupBookingItemValidatorUnitTest { .project(project) .caption("Test-Domain") .resources(Map.ofEntries( - entry("domainName", right(TOO_LONG_DOMAIN_NAME, 254)), - entry("targetUnixUser", "xyz00") + entry("domainName", right(TOO_LONG_DOMAIN_NAME, 254)) )) .build(); @@ -118,8 +114,7 @@ class HsDomainSetupBookingItemValidatorUnitTest { .project(project) .caption("Test-Domain") .resources(Map.ofEntries( - entry("domainName", "example.com"), - entry("targetUnixUser", "xyz00-test") + entry("domainName", "example.com") )) .build(); @@ -130,25 +125,6 @@ class HsDomainSetupBookingItemValidatorUnitTest { assertThat(result).isEmpty(); } - @Test - void rejectsInvalidUnixUser() { - final var domainSetupBookingItemEntity = HsBookingItemRealEntity.builder() - .type(DOMAIN_SETUP) - .project(project) - .caption("Test-Domain") - .resources(Map.ofEntries( - entry("domainName", "example.com"), - entry("targetUnixUser", "xyz00test") - )) - .build(); - - // when - final var result = HsBookingItemEntityValidatorRegistry.doValidate(em, domainSetupBookingItemEntity); - - // then - assertThat(result).contains("'D-12345:Test-Project:Test-Domain.resources.targetUnixUser' = 'xyz00test' is not a valid unix-user name"); - } - @ParameterizedTest @ValueSource(strings = { "de", "com", "net", "org", "actually-any-top-level-domain", @@ -196,8 +172,7 @@ class HsDomainSetupBookingItemValidatorUnitTest { .project(project) .caption("Test-Domain") .resources(Map.ofEntries( - entry("domainName", secondLevelRegistrarDomain), - entry("targetUnixUser", "xyz00") + entry("domainName", secondLevelRegistrarDomain) )) .build(); @@ -219,7 +194,6 @@ class HsDomainSetupBookingItemValidatorUnitTest { // then assertThat(validator.properties()).map(Map::toString).containsExactlyInAnyOrder( "{type=string, propertyName=domainName, matchesRegEx=[^((?!-)[A-Za-z0-9-]{1,63}(?