mock ioexception mockito on bufferedreader

Solutions on MaxInterview for mock ioexception mockito on bufferedreader by the best coders in the world

showing results for - "mock ioexception mockito on bufferedreader"
Francesco
29 Oct 2018
1@Test
2public void readFileTest5() throws Exception {
3    BufferedReader bufferedReader = Mockito.mock(BufferedReader.class);
4    FileReader fileReader = Mockito.mock(FileReader.class);
5    when(BufferedReader.readLine()).thenReturn("abc");
6    assertEquals("",new ArrayList<String>(), FileUtil.readFile("abc"));
7}
8