-
-
Notifications
You must be signed in to change notification settings - Fork 472
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
Set expectation for contents of a zip file in consumer contract pact #1763
Comments
There is nothing that can do that. The current implementation only supports checking that the body is a valid zip file. This functionality could be implemented as a plugin. |
@rholshausen , thank you for responding. How can we validate if body is valid zip file? Can you please provide any document or example for validating if its zip file. Or validating content-type header will suffice ? |
Here are two examples, not with a ZIP file, but you should be able to do it with any binary file.
|
Hi Team,
I am trying to create a contract pact at consumer end for a provider which returns ZIP file in response.
Currently response expectations in my pact method look like below.
Is there way to set expectation for contents of zip file? For example, if I want set expectation that inside zip file there should be specific directory/filename is present. Not bothered about file contents, but if a file or directory is present or not inside the zip file.
Is there a way to set such expectations under pact contract?
Note - Reason I want this type of validation is my service is not directly consuming zip file, but its more interested in files inside zip file. I want to set some expectation like a specific directory or filename is present inside zip file.
I tried posting this message in multiple slack groups, but unfortunately didn't get much response. Any suggestions on how to handle such cases would be really helpful.
The text was updated successfully, but these errors were encountered: