some cleanup

This commit is contained in:
Michael Hoennig 2024-07-01 09:08:13 +02:00
parent 14cae92ba5
commit c53b2bdd62
2 changed files with 5 additions and 2 deletions

View File

@ -93,7 +93,6 @@ public abstract class HsEntityValidator<E extends PropertiesProvider> {
public Map<String, Object> revampProperties(final E entity, final Map<String, Object> config) {
final var copy = new HashMap<>(config);
stream(propertyValidators).forEach(p -> {
// FIXME: maybe move to ValidatableProperty.postProcess(...)?
if ( p.isWriteOnly()) {
copy.remove(p.propertyName);
} else if (p.isComputed()) {

View File

@ -5,6 +5,7 @@ import net.hostsharing.hsadminng.hs.hosting.asset.HsHostingAssetType;
import org.junit.jupiter.api.Test;
import java.util.Map;
import java.util.stream.Stream;
import static net.hostsharing.hsadminng.hs.booking.item.TestHsBookingItem.TEST_MANAGED_SERVER_BOOKING_ITEM;
import static net.hostsharing.hsadminng.hs.booking.item.TestHsBookingItem.TEST_MANAGED_WEBSPACE_BOOKING_ITEM;
@ -46,7 +47,10 @@ class HsUnixUserHostingAssetValidatorUnitTest {
final var validator = HsHostingAssetEntityValidatorRegistry.forType(unixUserHostingAsset.getType());
// when
final var result = validator.validateEntity(unixUserHostingAsset); // FIXME: validateContext
final var result = Stream.concat(
validator.validateEntity(unixUserHostingAsset).stream(),
validator.validateContext(unixUserHostingAsset).stream()
).toList();
// then
assertThat(result).isEmpty();