fabric8io / mockwebserver

An extension of okhttp's mockwebserver, that provides a DSL and is easier to use
Apache License 2.0
112 stars 38 forks source link

Support binary responses with andReturn #40

Open mjones-vsat opened 5 years ago

mjones-vsat commented 5 years ago

Right now binary responses don't seem to work as intended due to extensive use of String. What would it take to allow binary responses to be mocked?

rohanKanojia commented 5 years ago

Umm, Could you please elaborate your use case a bit?

mjones-vsat commented 5 years ago

We are using protobuf instead of JSON, and the following doesn't work:

message = getProtoMessage();
server.expect().withPath("/api/foo").andReturn(200, message.toByteArray()).once();
rohanKanojia commented 5 years ago

@vsmteam : Could you please raise a PR to support this?