| Modifier and Type | Class and Description |
|---|---|
protected class |
MockModule.MockTestListener
Test listener that handles the scenario and mock creation, and makes sure a final syntax check
is performed after each test and that scenario reports are logged if required.
|
| Constructor and Description |
|---|
MockModule() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterInit() |
protected void |
callAfterCreateMockMethods(Object testObject,
Mock<?> mockObject,
String name)
Calls all
AfterCreateMock annotated methods on the test, passing the given mock. |
protected void |
createAndInjectDummiesIntoTest(Object testObject)
checks for the
Dummy annotation on the testObject. |
protected void |
createAndInjectMocksIntoTest(Object testObject) |
protected void |
createAndInjectPartialMocksIntoTest(Object testObject) |
protected <T> Mock<T> |
createMock(Object testObject,
String name,
Class<?> type) |
protected <T> Mock<T> |
createPartialMock(Object testObject,
String name,
Class<?> type) |
protected Class<?> |
getMockedClass(Field field) |
TestListener |
getTestListener()
Creates the listener for plugging in the behavior of this module into the test runs.
|
void |
init(Properties configuration) |
protected void |
injectMock(Object testObject,
Field field,
Mock<?> mock) |
public void init(Properties configuration)
protected void createAndInjectMocksIntoTest(Object testObject)
protected void createAndInjectPartialMocksIntoTest(Object testObject)
protected <T> Mock<T> createPartialMock(Object testObject, String name, Class<?> type)
protected void createAndInjectDummiesIntoTest(Object testObject)
Dummy annotation on the testObject. If so it is created by the DummyObjectUtil. The two aproaches possible are
stuffed or normal depending on the value in the Dummy annotation.testObject - The tested object not nullprotected void callAfterCreateMockMethods(Object testObject, Mock<?> mockObject, String name)
AfterCreateMock annotated methods on the test, passing the given mock.
These annotated methods must have following signature void myMethod(Object mock, String name, Class type).
If this is not the case, a runtime exception is called.testObject - the test, not nullmockObject - the mock, not nullname - the field(=mock) name, not nullpublic TestListener getTestListener()
getTestListener in interface ModuleCopyright © 2016. All Rights Reserved.