Package io.datarouter.mockito
Annotation Type DefineMock
@Target(FIELD) @Retention(RUNTIME) @Documented public @interface DefineMock
Similar to org.mockito.Mock, for use with testng+guice.
@Guice(moduleFactory = MyLibraryModuleFactory.class)
public class MyLibraryIntegrationTests{
@BindMock
@Inject
private MyDependency myDependency;
@Inject
private MyLibrary myLibrary;
@Test
public void test(){
Mockito.doReturn(true).when(myDependency).foo();
myLibrary.bar();
}
}
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description org.mockito.AnswersanswerClass<?>[]extraInterfacesStringname
-
Element Details
-
answer
org.mockito.Answers answer- Default:
- RETURNS_DEFAULTS
-
name
String name- Default:
- ""
-
extraInterfaces
Class<?>[] extraInterfaces- Default:
- {}
-