| Modifier and Type | Method and Description |
|---|---|
| public void | checkIsUsedInOneThread(boolean
If it should be used in one thread only or not shouldBeUsedInOneThread)Check that the mock is called from only one thread |
| public void | checkOrder(boolean
true switches order checking on,
false switches it off.Switches order checking on and off. |
| public < the interface or class that the mock object should
implement/extend. T, the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
caller, we return a different type R> R | Returns: the mock object.the interface or class that the mock object should
implement/extend. toMock)Same as |
| public < the interface or class that the mock object should
implement/extend. T, the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
caller, we return a different type R> R | Returns: the mock object.the name of the mock object. name, Class<T> the interface or class that the mock object should
implement/extend. toMock)Same as |
| public < the class that the mock object should extend. T, the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
caller, we return a different type R> R | Returns: the mock object.the name of the mock object. name, Class<T> the class that the mock object should extend. toMock, ConstructorArgs constructor and parameters used to instantiate the mock. If null, no constructor will be called constructorArgs, Method... methods that will be mocked, other methods will behave
normally. If empty, all methods will be mocked mockedMethods)Same as |
| public void | makeThreadSafe(boolean
If the mock should be thread safe or not threadSafe)Makes the mock thread safe. |
| public default < the interface or class that the mock object should
implement/extend. T, the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
caller, we return a different type R> R | |
| public default < the interface or class that the mock object should
implement/extend. T, the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
caller, we return a different type R> R | |
| public default < the class that the mock object should extend. T, the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
caller, we return a different type R> R | Returns: the mock object.the name of the mock object. name, Class<T> the class that the mock object should extend. toMock, ConstructorArgs constructor and parameters used to instantiate the mock. If null, no constructor will be called constructorArgs, Method... methods that will be mocked, other methods will behave
normally. If empty, all methods will be mocked mockedMethods)Creates a mock object that implements the given class. |
| public void | |
| public void | |
| public void | resetToDefault()
Removes all expectations for the mock objects of this control and turn them to default mocks. |
| public void | resetToNice()
Removes all expectations for the mock objects of this control and turn them to nice mocks. |
| public void | resetToStrict()
Removes all expectations for the mock objects of this control and turn them to strict mocks. |
| public void | |
| public void | |
| public void |
| checkIsUsedInOneThread | back to summary |
|---|---|
| public void checkIsUsedInOneThread(boolean shouldBeUsedInOneThread) Check that the mock is called from only one thread
| |
| checkOrder | back to summary |
|---|---|
| public void checkOrder(boolean state) Switches order checking on and off.
| |
| createMock | back to summary |
|---|---|
| public <T, R> R createMock(Class<T> toMock) Same as
| |
| createMock | back to summary |
|---|---|
| public <T, R> R createMock(String name, Class<T> toMock) Same as
| |
| createMock | back to summary |
|---|---|
| public <T, R> R createMock(String name, Class<T> toMock, ConstructorArgs constructorArgs, Method... mockedMethods) Same as
| |
| makeThreadSafe | back to summary |
|---|---|
| public void makeThreadSafe(boolean threadSafe) Makes the mock thread safe.
| |
| mock | back to summary |
|---|---|
| public default <T, R> R mock(Class<T> toMock) Creates a mock object that implements the given interface.
| |
| mock | back to summary |
|---|---|
| public default <T, R> R mock(String name, Class<T> toMock) Creates a mock object that implements the given interface.
| |
| mock | back to summary |
|---|---|
| public default <T, R> R mock(String name, Class<T> toMock, ConstructorArgs constructorArgs, Method... mockedMethods) Creates a mock object that implements the given class. Using this method directly in a test class
is not recommended. Only frameworks extending EasyMock should use it. Final users should use
the more convenient
| |
| replay | back to summary |
|---|---|
| public void replay() Switches the control from record mode to replay mode. | |
| reset | back to summary |
|---|---|
| public void reset() Removes all expectations for the mock objects of this control. | |
| resetToDefault | back to summary |
|---|---|
| public void resetToDefault() Removes all expectations for the mock objects of this control and turn them to default mocks. | |
| resetToNice | back to summary |
|---|---|
| public void resetToNice() Removes all expectations for the mock objects of this control and turn them to nice mocks. | |
| resetToStrict | back to summary |
|---|---|
| public void resetToStrict() Removes all expectations for the mock objects of this control and turn them to strict mocks. | |
| verify | back to summary |
|---|---|
| public void verify() Verifies that all expectations were met and that no unexpected
call was performed. It has the same effect as calling | |
| verifyRecording | back to summary |
|---|---|
| public void verifyRecording() Verifies that all expectations were met.
| |
| verifyUnexpectedCalls | back to summary |
|---|---|
| public void verifyUnexpectedCalls() Verifies that no unexpected call was performed.
| |