Open ireinhart opened 4 years ago
Your issue is not related Pact far as I know.
Storing binary data in a JSON file (e.g. which is generated by the Pact) is usually not a good idea and can cause some issues. It is better to use a Base64 encoding if you want to store binary data in a textual format like JSON. It is considered as safe for transport.
On provider side you may decode the base64 or assert against the base64 stream directly (without decoding it).
I'm not sure there is much value in testing a file upload with Pact. The file contents is being sent in HTTP multi-part mime format, so that is not a format you have much control over and so can't really change things to break the upload. In essence you are testing the HTTP handling of your server.
Hello,
is it possible to contract test an image upload with pact? I have written in some different kind of languages (dart and jvm) a consumer test with image upload. The pact file is now valid. But at the verification stage I get an error from my "provider". After a few days (i think a hole week :-( ) of investigating, it looks like, that pact-provider-verifier (ruby) and mvn pact:verify send an invalid file to my API under test.
Should I give up?
Best regards, Ingo
Consumer test:
my pact file:
saved image on server: