I have used TextFromStandardInputStream with JUnit Test Case, which works fine. But now I want to mock StandardInputStream outside Test Cases for my requirements. I have used the same TextFromStandardInputStream outside the Test Case but it didn't work at all. So, is there any way to do the work done?
Sample of StandardInputStream with Test Case that I have used
@Rule
public final TextFromStandardInputStream systemInMock = emptyStandardInputStream();
Inside Test Case :
systemInMock.provideLines("1","2");