Hi guys, I have a question concerning the migrati...
# pact-jvm
j
Hi guys, I have a question concerning the migration from V3 to V4 spec. Our http interaction returns a json response. So my code looks like:
Copy code
builder.expectsToReceive("get entity", "core/interaction/http")
    .with(Map.of("response.contents", Map.of(
        "pact:content-type", "application/json",
        "body", body
    ))).toPact()
What is the proper way to configure additional matching rules and generators for the response?
JsonContentMatcher
seems to only set the body. I may set the rules using
"response.matchingRules.rules(body)"
, but setting the generators using
"response.generators.categories(BODY)"
fails. Thanks!
r
Can you set the version to V4 and use the existing DSL classes, the new builder class is a bit basic. It will be improved in time, but for now you don't need to use it unless you want to use a plugin.
j
Thanks! I will use
usingLegacyDsl()
. We don't need any V4 features, yet.