Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

mock ioexception mockito on BufferedReader

@Test
public void readFileTest5() throws Exception {
    BufferedReader bufferedReader = Mockito.mock(BufferedReader.class);
    FileReader fileReader = Mockito.mock(FileReader.class);
    when(BufferedReader.readLine()).thenReturn("abc");
    assertEquals("",new ArrayList<String>(), FileUtil.readFile("abc"));
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mock #ioexception #mockito #BufferedReader
ADD COMMENT
Topic
Name
5+4 =