Testing a @RestController running in Spring Boot that calls a service and returns a file stream. To unit test it relied on Spring Test plus Mockito almost exactly as described here http://webcache.googleusercontent.com/search?q=cache:qcBgvzvFo7AJ:www.luckyryan.com/2013/08/24/unit-test-controllers-spring-mvc-test/+&cd=2&hl=en&ct=clnk&gl=us original page works now: http://www.luckyryan.com/2013/08/24/unit-test-controllers-spring-mvc-test/
The method under test returns a wrapped inputstream as shown here: http://stackoverflow.com/a/26537519/2066936
Mocked inputstream as shown here: http://stackoverflow.com/a/6371858
No comments:
Post a Comment