Dan Corder
01/19/2024, 11:20 AMapplication/jwt; charset=UTF-8
the pact contains an example response body (which has been encoded into base64 by the pact framework) and also a matching rule.
When I run the provider side test it fails with a message like 1.1) body: / Actual body [application/jwt, 903 bytes, starting with 65794a30655841694f694a4b563151694c434a68624763694f694a46557a4931] is not equal to the expected body [application/jwt, 1248 bytes, starting with 5a586c4b4d47565951576c506155704c566a465261557844536d686952324e70]
This is surprising for a couple of reasons:
1. The expected bytes value is the base64 encoded version of the body - it should have been base64 decoded before being compared?
2. As there is a matcher rule I would not expect the example body to be used at all - or do matchers not work with non-JSON/XML bodies?Dan Corder
01/19/2024, 11:49 AMpact.content_type.override.application.jwt=text
which does the comparison as a string, but it still doesn't use the string matching rule in the pact.Dan Corder
01/19/2024, 1:34 PMDan Corder
01/19/2024, 4:11 PMbody
and $
2. Add System.setProperty("pact.content_type.override.application/jwt", "text");
to my tests (note that this not pact.content_type.override.application.jwt
as in the docs here: https://docs.pact.io/implementation_guides/jvm/provider/junit#overriding-the-handling-of-a-body-data-type)Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
rholshausen
01/21/2024, 10:09 PMMatt (pactflow.io / pact-js / pact-go)
Dan Corder
01/22/2024, 9:29 AMapplication.jwt
and application/jwt
work.Matt (pactflow.io / pact-js / pact-go)