application-event for booking-item-created with domain-setup-example #110
@ -182,9 +182,7 @@ class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup
|
||||
.extract().header("Location"); // @formatter:on
|
||||
|
||||
// finally, the new bookingItem can be accessed under the generated UUID
|
||||
final var newSubjectUuid = UUID.fromString(
|
||||
location.substring(location.lastIndexOf('/') + 1));
|
||||
assertThat(newSubjectUuid).isNotNull();
|
||||
assertThat(fetchRealBookingItemFromURI(location)).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -220,24 +218,24 @@ class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup
|
||||
)
|
||||
.port(port)
|
||||
.when()
|
||||
.post("http://localhost/api/hs/booking/items")
|
||||
.post("http://localhost/api/hs/booking/items")
|
||||
.then().log().all().assertThat()
|
||||
.statusCode(201)
|
||||
.contentType(ContentType.JSON)
|
||||
.body("", lenientlyEquals("""
|
||||
{
|
||||
"type": "DOMAIN_SETUP",
|
||||
"caption": "some new domain-setup booking",
|
||||
"validFrom": "{today}",
|
||||
"validTo": null,
|
||||
"resources": { "domainName": "example.org", "targetUnixUser": "fir01-web" }
|
||||
}
|
||||
"""
|
||||
.replace("{today}", LocalDate.now().toString())
|
||||
.replace("{todayPlus1Month}", LocalDate.now().plusMonths(1).toString()))
|
||||
)
|
||||
.header("Location", matchesRegex("http://localhost:[1-9][0-9]*/api/hs/booking/items/[^/]*"))
|
||||
.extract().header("Location"); // @formatter:on
|
||||
.statusCode(201)
|
||||
.contentType(ContentType.JSON)
|
||||
.body("", lenientlyEquals("""
|
||||
{
|
||||
"type": "DOMAIN_SETUP",
|
||||
"caption": "some new domain-setup booking",
|
||||
"validFrom": "{today}",
|
||||
"validTo": null,
|
||||
"resources": { "domainName": "example.org", "targetUnixUser": "fir01-web" }
|
||||
}
|
||||
"""
|
||||
.replace("{today}", LocalDate.now().toString())
|
||||
.replace("{todayPlus1Month}", LocalDate.now().plusMonths(1).toString()))
|
||||
)
|
||||
.header("Location", matchesRegex("http://localhost:[1-9][0-9]*/api/hs/booking/items/[^/]*"))
|
||||
.extract().header("Location"); // @formatter:on
|
||||
|
||||
// then, the new BookingItem can be accessed under the generated UUID
|
||||
final var newBookingItem = fetchRealBookingItemFromURI(location);
|
||||
|
Loading…
Reference in New Issue
Block a user