Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning messages for application/x-thrift #1314

Open
iankurrathi opened this issue Feb 24, 2021 · 3 comments
Open

warning messages for application/x-thrift #1314

iankurrathi opened this issue Feb 24, 2021 · 3 comments

Comments

@iankurrathi
Copy link
Contributor

After implementing fix for #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]

@uglyog uglyog added bug Indicates an unexpected problem or unintended behavior enhancement and removed bug Indicates an unexpected problem or unintended behavior labels Mar 6, 2021
@uglyog
Copy link
Member

uglyog commented Mar 6, 2021

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.

@uglyog
Copy link
Member

uglyog commented Mar 6, 2021

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.

@uglyog
Copy link
Member

uglyog commented Mar 13, 2021

4.1.18 released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants