You could use commons-io to create some stub input streams:
InputStream stubInputStream =
IOUtils.toInputStream("some test data for my input stream", "UTF-8");
More Related Contents:
- Mocking static methods with Mockito
- Use Mockito to mock some methods but not others
- Difference between @Mock and @InjectMocks
- Using Mockito to test abstract classes
- How do Mockito matchers work?
- What’s the best mock framework for Java? [closed]
- Using Mockito with multiple calls to the same method with the same arguments
- How to properly match varargs in Mockito
- Final method mocking
- Mock a constructor with parameter
- How to tell a Mockito mock object to return something different the next time it is called?
- Is it possible to use Mockito in Kotlin?
- Mocking time in Java 8’s java.time API
- How to mock new Date() in java using Mockito
- Is it discouraged to use @Spy and @InjectMocks on the same field?
- Unfinished Stubbing Detected in Mockito
- Mockito – @Spy vs @Mock
- What is the difference between mocking and spying when using Mockito?
- mock or stub for chained call
- What are mock objects in Java?
- Mockito test a void method throws an exception
- Why is my class not calling my mocked methods in unit test?
- Mocking Java enum to add a value to test fail case
- Why are my mocked methods not calld when executing a unit test?
- Forming Mockito “grammars”
- How to check String in response body with mockMvc
- java: how to mock Calendar.getInstance()?
- Mocking behaviour resets after each test with PowerMock
- jmock mocking a static method
- Why are my mocked methods not called when executing a unit test?