开发者

How to validate binary response having multiple zip files which intern has json files within zip using karate

开发者 https://www.devze.com 2022-12-07 17:51 出处:网络
I have a scenario, where the response is a binary file. This response has multiple zip files and each zip file has one or more json files within. Can anyone suggest how to verify this response?.

I have a scenario, where the response is a binary file. This response has multiple zip files and each zip file has one or more json files within. Can anyone suggest how to verify this response?. Thanks in advance.

I tried karate.write(response,"response.zip") to store the re开发者_StackOverflowsponse in a zip file. Zip file is getting created but when i try to unzip it has only one zipped record(where as it should have had all the zip files available in response) which is in corrupted form or with 0kb.

Note: response header: Contenty-Type: application/octet-stream


Karate does not have support for ZIP files.

If you found only one zipped record maybe it is an actual bug.

I have 2 suggestions:

  1. Maybe if you just run some commands on the command-line, you can achieve what you want. Karate has good support for that: https://stackoverflow.com/a/62911366/143475

  2. Write a custom Java utility and integrate it: https://stackoverflow.com/a/62826394/143475

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号