add assigned-asset, add more hosting-asset test-data and introduce HsBookingDebitor+hs_booking_debitor_rv #58
@ -5,7 +5,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
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 org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.catchThrowable;
|
||||
@ -15,19 +15,18 @@ class HsHostingAssetEntityValidatorsUnitTest {
|
||||
@Test
|
||||
void validThrowsException() {
|
||||
// given
|
||||
final var cloudServerHostingAssetEntity = HsHostingAssetEntity.builder()
|
||||
.type(CLOUD_SERVER)
|
||||
final var managedServerHostingAssetEntity = HsHostingAssetEntity.builder()
|
||||
.type(MANAGED_SERVER)
|
||||
.build();
|
||||
|
||||
// when
|
||||
final var result = catchThrowable( ()-> valid(cloudServerHostingAssetEntity) );
|
||||
final var result = catchThrowable( ()-> valid(managedServerHostingAssetEntity) );
|
||||
|
||||
// then
|
||||
assertThat(result).isInstanceOf(ValidationException.class)
|
||||
.hasMessageContaining(
|
||||
"'config.CPUs' is required but missing",
|
||||
"'config.RAM' is required but missing",
|
||||
"'config.SSD' is required but missing",
|
||||
"'config.Traffic' is required but missing");
|
||||
"'config.monit_max_ssd_usage' is required but missing",
|
||||
"'config.monit_max_cpu_usage' is required but missing",
|
||||
"'config.monit_max_ram_usage' is required but missing");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user