The Json below contains three things that I don't know how to model in the lambda based DSL for Pact (and that I can't figure out by reading the examples provided on https://github.com/DiUS/pact-jvm/tree/master/pact-jvm-consumer-java8 ).
The Json-object consists of 3 properties; "Inventory" which holds an array (which is only one element long), and two simple key-value pairs.
1) How do I declare an named array using the lambda based DSL?
The first (and only) object in the Inventory-array consists of two named objects "Car" and "Camera".
2) How do I declare a named object using the lambda based DSL?
In the "Camera"-object there is an array called "Conditions" which holds two string values.
3) How do I declare two example string values in a named array using the lambda based DSL?
{
"Inventory":[
{
"Car":{
"gearbox":"automatic",
"ProductId":30212
},
"Camera":{
"EndPrice":1235,
"Conditions":[
"FaultyButtons",
"FaultyCasing"
],
"ModelId":"650"
}
}
],
"IsSuccess":true,
"Info":"Ok"
}