mockito icon indicating copy to clipboard operation
mockito copied to clipboard

Adding accept-range support?

Open CliffHan opened this issue 6 years ago • 2 comments

I could add a file by "with_body_from_file()" method, but I couldn't find a way simply adding the "range" support with mockito.

Could it be handled within?

CliffHan avatar Nov 14 '19 06:11 CliffHan

@CliffHan what do you mean by the "range" support? can you provide an example or your use case?

lipanski avatar Nov 15 '19 05:11 lipanski

@lipanski I'd like to test a client which send a http request with "range" in request header. For example, a request has the "range=bytes=0-1023" in the header, means it expects the first 1024 bytes of the file. With current mockito, it seems that I had to make lots of mocks with different matchers of different ranges, and set the body with different part of the response file. Maybe mockito could be easier with just a method to enable "accept-range"?

CliffHan avatar Nov 15 '19 05:11 CliffHan