Mock-framework for Java
- Mock and spy objects with annotations
- Stubbing
- Argument matcher
- thenThrow method
- Call Real Methods
- with
mock()
method:
Test test = Tarjun.mock(Test.class);
- with
@Mock
annotation:
@Mock
Test test;
- with
spy()
method:
List<String> testList = new ArrayList<>();
List<String> testListSpied = Tarjun.spy(testList)
- with
@Spy
annotation:
@Spy
List<String> testListSpied = new ArrayList<>();