introduce-booking-module #41
@ -22,8 +22,6 @@ public class HsBookingItemEntityPatcher implements EntityPatcher<HsBookingItemPa
|
||||
.ifPresent(entity::setCaption);
|
||||
Optional.ofNullable(resource.getResources())
|
||||
.ifPresent(r -> entity.getResources().patch(KeyValueMap.from(resource.getResources())));
|
||||
OptionalFromJson.of(resource.getValidFrom())
|
||||
.ifPresent(entity::setValidFrom);
|
||||
OptionalFromJson.of(resource.getValidTo())
|
||||
.ifPresent(entity::setValidTo);
|
||||
}
|
||||
|
@ -32,10 +32,6 @@ components:
|
||||
caption:
|
||||
type: string
|
||||
nullable: true
|
||||
validFrom:
|
||||
type: string
|
||||
format: date
|
||||
nullable: true
|
||||
validTo:
|
||||
type: string
|
||||
format: date
|
||||
|
@ -258,7 +258,7 @@ class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup
|
||||
.body("", lenientlyEquals("""
|
||||
{
|
||||
"caption": "some test-booking",
|
||||
"validFrom": "2020-06-05",
|
||||
"validFrom": "2022-11-01",
|
||||
"validTo": "2022-12-31",
|
||||
"resources": {
|
||||
"CPU": "4",
|
||||
|
@ -34,7 +34,6 @@ class HsBookingItemEntityPatcherUnitTest extends PatchUnitTestBase<
|
||||
|
||||
private static final UUID INITIAL_BOOKING_ITEM_UUID = UUID.randomUUID();
|
||||
private static final LocalDate GIVEN_VALID_FROM = LocalDate.parse("2020-04-15");
|
||||
private static final LocalDate PATCHED_VALID_FROM = LocalDate.parse("2022-10-30");
|
||||
private static final LocalDate PATCHED_VALID_TO = LocalDate.parse("2022-12-31");
|
||||
|
||||
private static final Map<String, Object> INITIAL_RESOURCES = patchMap(
|
||||
@ -103,11 +102,6 @@ class HsBookingItemEntityPatcherUnitTest extends PatchUnitTestBase<
|
||||
HsBookingItemEntity::putResources,
|
||||
PATCHED_RESOURCES)
|
||||
.notNullable(),
|
||||
new JsonNullableProperty<>(
|
||||
"validfrom",
|
||||
HsBookingItemPatchResource::setValidFrom,
|
||||
PATCHED_VALID_FROM,
|
||||
HsBookingItemEntity::setValidFrom),
|
||||
new JsonNullableProperty<>(
|
||||
"validto",
|
||||
HsBookingItemPatchResource::setValidTo,
|
||||
|
Loading…
Reference in New Issue
Block a user