As now spark have RequestResponseFactory.create(HttpServletRequest), but this is a way harder for testing. It will be more easily if Request and Response are just interfaces and they will be mocked easily.
For now to mock the request.body() method I should implement ServletInputStream and to mock HttpServletRequest.inputStream .... that looks by this way:
and then
for now I have 3 expectations instead of having just one like this:
oneOf(request).body()
will(returnValue("my body is here"))
As now spark have RequestResponseFactory.create(HttpServletRequest), but this is a way harder for testing. It will be more easily if Request and Response are just interfaces and they will be mocked easily. For now to mock the request.body() method I should implement ServletInputStream and to mock HttpServletRequest.inputStream .... that looks by this way:
![1](https://user-images.githubusercontent.com/20161493/34291920-4550c388-e707-11e7-8eda-68d6bf58796f.png)
and then
for now I have 3 expectations instead of having just one like this: