Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List mockedList = mock(List.class);
- Mockito.when(mockedList.get(0))
- .thenReturn("one")
- .thenReturn("two")
- .thenThrow(new RuntimeException());
- System.out.println(mockedList.get(0)); // one
- System.out.println(mockedList.get(0)); // two
- System.out.println(mockedList.get(0)); // RuntimeExceptionが発生する
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement