Advertisement
Guest User

Untitled

a guest
Jul 30th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. @RunWith(MockitoJUnitRunner.class)
  2. public class ReadTest {
  3.  
  4. @InjectMocks
  5. Read read;
  6.  
  7. @Mock
  8. Scanner sc;
  9.  
  10. @Before
  11. public void setUp() {
  12. when(sc.nextLine()).thenReturn("test");
  13. }
  14.  
  15. @Test
  16. public void readFileName() throws Exception {
  17. assertEquals("test",read.readFileName());
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement