only validateContext for related entities, no validateEntity

This commit is contained in:
Michael Hoennig 2024-07-01 09:48:14 +02:00
parent 52fa265a3d
commit d27ffd0f8d
3 changed files with 3 additions and 5 deletions

View File

@ -36,7 +36,7 @@ public class HsBookingItemEntityValidator extends HsEntityValidator<HsBookingIte
private static List<String> optionallyValidate(final HsBookingItemEntity bookingItem) {
return bookingItem != null
? enrich(prefix(bookingItem.toShortString(), ""),
HsBookingItemEntityValidatorRegistry.doValidate(bookingItem))
HsBookingItemEntityValidatorRegistry.forType(bookingItem.getType()).validateContext(bookingItem))
: emptyList();
}

View File

@ -88,7 +88,6 @@ public abstract class HsHostingAssetEntityValidator extends HsEntityValidator<Hs
private static List<String> optionallyValidate(final HsHostingAssetEntity assetEntity) {
return assetEntity != null
? enrich(prefix(assetEntity.toShortString(), "parentAsset"),
// FIXME: actually only validateSubEntities is necessary
HsHostingAssetEntityValidatorRegistry.forType(assetEntity.getType()).validateContext(assetEntity))
: emptyList();
}
@ -96,8 +95,7 @@ public abstract class HsHostingAssetEntityValidator extends HsEntityValidator<Hs
private static List<String> optionallyValidate(final HsBookingItemEntity bookingItem) {
return bookingItem != null
? enrich(prefix(bookingItem.toShortString(), "bookingItem"),
// FIXME: actually only validateSubEntities is necessary
HsBookingItemEntityValidatorRegistry.doValidate(bookingItem))
HsBookingItemEntityValidatorRegistry.forType(bookingItem.getType()).validateContext(bookingItem))
: emptyList();
}

View File

@ -42,4 +42,4 @@ class HsHostingAssetEntityValidatorUnitTest {
}
}
// FIXME: add tests validatesContext + revampProperties
// FIXME: add tests for prepareProperties, validatesContext + revampProperties