public class MockGateway extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DONT_MOCK_NEXT_CALL
Used to tell the MockGateway that the next call should not be mocked
regardless if a
MethodInvocationControl is found in the
MockRepository. |
static boolean |
MOCK_GET_CLASS_METHOD
Tells PowerMock whether or not to mock
Object.getClass(). |
static boolean |
MOCK_STANDARD_METHODS
Tells PowerMock to mock standard methods.
|
static Object |
PROCEED |
static Object |
SUPPRESS |
| Constructor and Description |
|---|
MockGateway() |
| Modifier and Type | Method and Description |
|---|---|
static Object |
constructorCall(Class<?> type,
Object[] args,
Class<?>[] sig) |
static Object |
fieldCall(Object instanceOrClassContainingTheField,
Class<?> classDefiningField,
String fieldName,
Class<?> fieldType) |
static Object |
methodCall(Class<?> type,
String methodName,
Object[] args,
Class<?>[] sig,
String returnTypeAsString) |
static Object |
methodCall(Object instance,
String methodName,
Object[] args,
Class<?>[] sig,
String returnTypeAsString) |
static Object |
newInstanceCall(Class<?> type,
Object[] args,
Class<?>[] sig) |
static Object |
staticConstructorCall(String className) |
public static final Object PROCEED
public static final Object SUPPRESS
public static final String DONT_MOCK_NEXT_CALL
MethodInvocationControl is found in the
MockRepository. Used to allow for e.g. recursive partial mocking.public static boolean MOCK_STANDARD_METHODS
Object.toString(), Object.hashCode() and
Object.equals(Object). By default this is true.public static boolean MOCK_GET_CLASS_METHOD
Object.getClass().public static Object methodCall(Class<?> type, String methodName, Object[] args, Class<?>[] sig, String returnTypeAsString) throws Throwable
Throwablepublic static Object methodCall(Object instance, String methodName, Object[] args, Class<?>[] sig, String returnTypeAsString) throws Throwable
Throwablepublic static Object newInstanceCall(Class<?> type, Object[] args, Class<?>[] sig) throws Throwable
Throwablepublic static Object fieldCall(Object instanceOrClassContainingTheField, Class<?> classDefiningField, String fieldName, Class<?> fieldType)
Copyright © 2007–2015. All rights reserved.