Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RunWith(MockitoJUnitRunner.class)
- public class ReadTest {
- @InjectMocks
- Read read;
- @Mock
- Scanner sc;
- @Before
- public void setUp() {
- when(sc.nextLine()).thenReturn("test");
- }
- @Test
- public void readFileName() throws Exception {
- assertEquals("test",read.readFileName());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement