Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // assume there is a class SampleFile
- @Mock
- Class SampeFile.class; //SampleFile.java?
- @Test
- public void testparseClass() {
- // testing Parser class
- Parser parser = new Parser(SampleFile.class);
- // call a method
- private Clazz result = parser.parseClass();
- // test return type
- assertTrue(result);
- // test that parseClass method on mock object was called
- Mockito.verify(Example.class).parseClass();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement