Monday, 30 July 2012

@InjectMocks - Mockito

It is an annotation used in Mockito on the variable definition telling Mockito to try to inject by type already defined mocks or spies on the annotated object
f.e.:
@InjectMocks private MyService service = new MyService();

More info here: http://docs.mockito.googlecode.com/hg/org/mockito/InjectMocks.html

No comments: