I have problems with closeArray in pact-jvm-consumer.
Given Json like this, how would the "DslPart imeiResults = new PactDslJsonBody()"-statment be constructed.
{
"Car": {
"Price": 123,
"Features": [
"rain sensor",
"cruise control"
],
"Id": "6500"
}
}
I tried like this:
DslPart etaResults = new PactDslJsonBody()
.object("Car")
.integerType("Price",123)
.array("Features")
.stringValue("rain sensor")
.stringValue("cruise control")
.closeArray()
.stringValue("Id","6500")
.closeObject()
.asBody();
But that does not work, for example .closeArray() does not return PactDslJsonBody but DslPart, so you can never have anything after .closeArray()? I don't get it, can someone show the code on how to do this the correct way?