Open weofferservice opened 4 years ago
There is another problem, the multipart body is not being base64 encoded before being written to the pact file
I think this has been addressed now. If you run PostImageBodyTest.groovy and take the body from the persisted pact file, base64 decode it and remove the multipart header it loads correctly in an image editor.
When request has binary body (for images) contract is generating to JSON in UTF-8 encoding. This is error, because UTF-8 irreversible. You must use Base64 or ISO_8859_1 I found this bug and fix it. I made pull request to fix this error (https://github.com/DiUS/pact-jvm/pull/1111).
I attached to this Issue my test data which helped me to find bug: 1) face-with-smile.jpg 2) PhotoQualityOkEndpointTest.java
3) picture-checker-ok.json