});
body.array("entities", entities ->
{
- body.arrayContaining("actions", actionsArray ->
+ entities.eachLike(entity ->
{
- actionsArray.object(object ->
+ entity.arrayContaining("action", actionsArray->
{
- object.stringType("name","update");
- object.stringType("method", "PUT");
- object.matchUrl2("href", Matchers.regexp("\\d+", "1234").getValue());
+ actionsArray.object(object ->
+ {
+ object.stringType("name","update");
+ object.stringType("method", "PUT");
+ object.matchUrl2("href", Matchers.regexp("\\d+", "1234").getValue());
+ });
+ actionsArray.object(object ->
+ {
+ object.stringType("name","delete");
+ object.stringType("method", "DELETE");
+ object.matchUrl2("href", Matchers.regexp("\\d+", "1234").getValue());
+ });
});
- actionsArray.object(object ->
+ entity.array("class", classArray ->
{
- object.stringType("name","delete");
- object.stringType("method", "DELETE");
- object.matchUrl2("href", Matchers.regexp("\\d+", "1234").getValue());
+ classArray.stringValue("entity");
});
- });
- body.array("links", linksArray ->
- {
- linksArray.object(object->
+ entity.array("links", linksArray ->
+ {
+ linksArray.object(object->
+ {
+ object.matchUrl2("href", "orders", Matchers.regexp("\\d+", "1234"));
+ object.array("rel", relArray ->
+ {
+ relArray.stringValue("self");
+ });
+ });
+ });
+ entity.object("properties", object->
{
- object.matchUrl2("href", "orders");
+ object.stringType("id", "1234");
object.array("rel", relArray ->
{
- relArray.stringValue("self");
+ relArray.stringValue("item");
});
});
});
});
+ body.array("links", linksArray ->
+ {
+ linksArray.object(object->
+ {
+ object.matchUrl2("href", "orders");
+ object.array("rel", relArray ->
+ {
+ relArray.stringValue("self");
+ });
+ });
+ });
}).build())
.toPact();
}