James Fraser
02/16/2023, 4:33 PMDslPart
from an existing JSON file or object? Or is it only the PactDslJsonBody
and newJsonBody
approaches listed here?
We have existing JSON files used by our tests so it’d be nice to not have to rewrite all of them into this formatuglyog
DslPart
classes are for building JSON payloads. If you already have JSON files, why not just use them directly?James Fraser
02/17/2023, 9:25 AMMessagePactBuilder
, and its withContent()
method only accepts a DslPart
or PactXmlBuilder
Is there something simple I’m missing that lets us do this?James Fraser
02/20/2023, 4:33 PMJSONObject jsonObject = loadJsonFromFile(...);
return new MessagePactBuilder()
.expectsToReceive("a user created message")
.withContent(jsonObject)
.toPact();
uglyog
James Fraser
02/21/2023, 9:50 AMJames Fraser
02/21/2023, 10:42 AM