Skip to content

Instantly share code, notes, and snippets.

@albertusdev
Created March 20, 2019 14:41
Show Gist options
  • Save albertusdev/20c7c9d0848e0aff2b879f1ff3b73d7e to your computer and use it in GitHub Desktop.
Save albertusdev/20c7c9d0848e0aff2b879f1ff3b73d7e to your computer and use it in GitHub Desktop.
import org.something.TargetClass;
import static org.mockito.Mockito.*;
class TestTargetClass {
// first options: use Annotations
@Mock
TargetClass mockTargetClass;
// second options: initialize using mock()
TargetClass mockTargetClass2 = mock(TargetClass.class);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment