add assigned-asset, add more hosting-asset test-data and introduce HsBookingDebitor+hs_booking_debitor_rv #58

Merged
hsh-michaelhoennig merged 8 commits from add-assigned-asset-and-more-hosting-asset-test-data into master 2024-06-06 13:46:15 +02:00
Showing only changes of commit 94039fffee - Show all commits

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");
} }
} }