fix another test

This commit is contained in:
Michael Hoennig 2024-06-06 09:39:16 +02:00
parent 2848f4080c
commit 94039fffee

View File

@ -5,7 +5,7 @@ import org.junit.jupiter.api.Test;
import jakarta.validation.ValidationException; import jakarta.validation.ValidationException;
import static net.hostsharing.hsadminng.hs.hosting.asset.HsHostingAssetType.CLOUD_SERVER; import static net.hostsharing.hsadminng.hs.hosting.asset.HsHostingAssetType.MANAGED_SERVER;
import static net.hostsharing.hsadminng.hs.hosting.asset.validators.HsHostingAssetEntityValidators.valid; import static net.hostsharing.hsadminng.hs.hosting.asset.validators.HsHostingAssetEntityValidators.valid;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.catchThrowable; import static org.assertj.core.api.Assertions.catchThrowable;
@ -15,19 +15,18 @@ class HsHostingAssetEntityValidatorsUnitTest {
@Test @Test
void validThrowsException() { void validThrowsException() {
// given // given
final var cloudServerHostingAssetEntity = HsHostingAssetEntity.builder() final var managedServerHostingAssetEntity = HsHostingAssetEntity.builder()
.type(CLOUD_SERVER) .type(MANAGED_SERVER)
.build(); .build();
// when // when
final var result = catchThrowable( ()-> valid(cloudServerHostingAssetEntity) ); final var result = catchThrowable( ()-> valid(managedServerHostingAssetEntity) );
// then // then
assertThat(result).isInstanceOf(ValidationException.class) assertThat(result).isInstanceOf(ValidationException.class)
.hasMessageContaining( .hasMessageContaining(
"'config.CPUs' is required but missing", "'config.monit_max_ssd_usage' is required but missing",
"'config.RAM' is required but missing", "'config.monit_max_cpu_usage' is required but missing",
"'config.SSD' is required but missing", "'config.monit_max_ram_usage' is required but missing");
"'config.Traffic' is required but missing");
} }
} }