Open iankurrathi opened 3 years ago
This looks like an inconsistency in the implementation. The values for pact.content_type.override.*
should be text
or binary
. You are setting it to json
, so it should not be treated as a binary format, but it is. I'm not sure why, but I'm going to change it to make json
a valid value for that property.
The reason for treating it as a binary content type is the slash in the property key. It was looking for pact.content_type.override.application.x-thrift
not pact.content_type.override.application/x-thrift
. I'm going to fix it to accept both.
4.1.18 released
After implementing fix for https://github.com/pact-foundation/pact-jvm/issues/1298, we are noticing warning messages in logs in producer tests.
we are using 4.1.17 version and using system override property to treat application/x-thrift as json:
System.setProperty("pact.content_type.override.application/x-thrift", "json");
we are going to raise a PR to fix this issue.
24 Feb 2021 08:01:44,078 WARN HttpPart:80 [main] Expected body for content type application/x-thrift to be base64 encoded java.lang.IllegalArgumentException: Illegal base64 character 5b at java.base/java.util.Base64$Decoder.decode0(Base64.java:743) ~[?:?] at java.base/java.util.Base64$Decoder.decode(Base64.java:535) ~[?:?] at java.base/java.util.Base64$Decoder.decode(Base64.java:558) ~[?:?] at au.com.dius.pact.core.model.HttpPart$Companion.decodeBody(HttpPart.kt:78) ~[model-4.1.17.jar:4.1.17] at au.com.dius.pact.core.model.HttpPart$Companion.extractBody(HttpPart.kt:70) ~[model-4.1.17.jar:4.1.17] at au.com.dius.pact.core.model.Request$Companion.fromJson(Request.kt:125) ~[model-4.1.17.jar:4.1.17] at au.com.dius.pact.core.model.DefaultPactReader.extractRequest(PactReader.kt:291) ~[model-4.1.17.jar:4.1.17] at au.com.dius.pact.core.model.DefaultPactReader$loadV3Pact$interactions$1.invoke(PactReader.kt:242) ~[model-4.1.17.jar:4.1.17] at au.com.dius.pact.core.model.DefaultPactReader$loadV3Pact$interactions$1.invoke(PactReader.kt:186) ~[model-4.1.17.jar:4.1.17] at au.com.dius.pact.core.support.json.JsonValueKt.map(JsonValue.kt:263) ~[support-4.1.17.jar:4.1.17] at au.com.dius.pact.core.model.DefaultPactReader.loadV3Pact(PactReader.kt:241) ~[model-4.1.17.jar:4.1.17] at au.com.dius.pact.core.model.DefaultPactReader.loadPact(PactReader.kt:200) ~[model-4.1.17.jar:4.1.17] at au.com.dius.pact.provider.junitsupport.loader.PactBrokerLoader.loadPactsForProvider(PactBrokerLoader.kt:227) ~[provider-4.1.17.jar:4.1.17] at au.com.dius.pact.provider.junitsupport.loader.PactBrokerLoader.load(PactBrokerLoader.kt:111) ~[provider-4.1.17.jar:4.1.17]