From 4a3af3f6feace3142d58948f45fdefb05ee79345 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Thu, 5 Sep 2024 13:51:08 +0200 Subject: [PATCH] amend test data+assertions to new validation rules --- .../HsHostingAssetControllerAcceptanceTest.java | 2 +- ...omainSetupHostingAssetValidatorUnitTest.java | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/HsHostingAssetControllerAcceptanceTest.java b/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/HsHostingAssetControllerAcceptanceTest.java index 8b04bbb0..ba224516 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/HsHostingAssetControllerAcceptanceTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/HsHostingAssetControllerAcceptanceTest.java @@ -257,7 +257,7 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup .type(HsBookingItemType.DOMAIN_SETUP) .caption("some temp domain setup booking item") .resources(Map.ofEntries( - entry("domainName", "example.org"))) + entry("domainName", "example.com"))) .build() ); 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 266bad45..876d92b7 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 @@ -18,17 +18,22 @@ import static org.assertj.core.api.Assertions.assertThat; class HsDomainSetupHostingAssetValidatorUnitTest { - static HsHostingAssetRbacEntity.HsHostingAssetRbacEntityBuilder validEntityBuilder() { + + static HsHostingAssetRbacEntity.HsHostingAssetRbacEntityBuilder validEntityBuilder(final String domainName) { final HsBookingItemRealEntity bookingItem = HsBookingItemRealEntity.builder() .type(HsBookingItemType.DOMAIN_SETUP) .resources(Map.ofEntries( - Map.entry("domainName", "example.org") + Map.entry("domainName", domainName) )) .build(); return HsHostingAssetRbacEntity.builder() .type(DOMAIN_SETUP) .bookingItem(bookingItem) - .identifier("example.org"); + .identifier(domainName); + } + + static HsHostingAssetRbacEntity.HsHostingAssetRbacEntityBuilder validEntityBuilder() { + return validEntityBuilder("example.org"); } enum InvalidDomainNameIdentifier { @@ -57,13 +62,13 @@ class HsDomainSetupHostingAssetValidatorUnitTest { // then assertThat(result).containsExactly( - "'identifier' expected to match '^((?!-)[A-Za-z0-9-]{1,63}(?