.headers(Map.of("Content-Type", "application/vnd.siren+json"))
.body(LambdaDsl.newJsonBody(body ->
{
+ body.array("class", classArray ->
+ {
+ classArray.stringValue("entity");
+ });
body.array("entities", entities ->
{
- body.arrayContaining("actions", actions ->
+ body.arrayContaining("actions", actionsArray ->
{
- actions.object(object ->
+ actionsArray.object(object ->
{
object.stringType("name","update");
object.stringType("method", "PUT");
object.matchUrl2("href", Matchers.regexp("\\d+", "1234").getValue());
});
- actions.object(object ->
+ actionsArray.object(object ->
{
object.stringType("name","delete");
object.stringType("method", "DELETE");
object.matchUrl2("href", Matchers.regexp("\\d+", "1234").getValue());
});
});
+ body.array("links", linksArray ->
+ {
+ linksArray.object(object->
+ {
+ object.matchUrl2("href", "orders");
+ object.array("rel", relArray ->
+ {
+ relArray.stringValue("self");
+ });
+ });
+ });
});
}).build())
.toPact();