Please provide pointers to help me mock that java InputStream object. This is the line of code that I would wish to Mock:
InputStreamReader inputData = new I
I disagree with the selected answer for this question. Mocking frameworks like Mockito are nice and all, however when standard java api is available you might consider using that instead.
i.e.
BufferedReader reader = new BufferedReader(new StringReader("some string"));
Why use a Mock object in your test classes when you could use a real one with all its state and behaviour?
To see more about how this works, you could look up the 'decorator' design pattern.