public class MockGateway
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.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_ANNOTATION_METHODS
Tells PowerMock whether or not to mock
Class.isAnnotationPresent(Class) and
Class.getAnnotation(Class) . |
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 java.lang.Object |
PROCEED |
static java.lang.Object |
SUPPRESS |
Constructor and Description |
---|
MockGateway() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
constructorCall(java.lang.Class<?> type,
java.lang.Object[] args,
java.lang.Class<?>[] sig) |
static java.lang.Object |
fieldCall(java.lang.Object instanceOrClassContainingTheField,
java.lang.Class<?> classDefiningField,
java.lang.String fieldName,
java.lang.Class<?> fieldType) |
static java.lang.Object |
methodCall(java.lang.Class<?> type,
java.lang.String methodName,
java.lang.Object[] args,
java.lang.Class<?>[] sig,
java.lang.String returnTypeAsString) |
static java.lang.Object |
methodCall(java.lang.Object instance,
java.lang.String methodName,
java.lang.Object[] args,
java.lang.Class<?>[] sig,
java.lang.String returnTypeAsString) |
static java.lang.Object |
newInstanceCall(java.lang.Class<?> type,
java.lang.Object[] args,
java.lang.Class<?>[] sig) |
static java.lang.Object |
staticConstructorCall(java.lang.String className) |
static boolean |
suppressConstructorCall(java.lang.Class<?> type,
java.lang.Object[] args,
java.lang.Class<?>[] sig) |
public static final java.lang.Object PROCEED
public static final java.lang.Object SUPPRESS
public static final java.lang.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 boolean MOCK_ANNOTATION_METHODS
Class.isAnnotationPresent(Class)
and
Class.getAnnotation(Class)
.public static java.lang.Object newInstanceCall(java.lang.Class<?> type, java.lang.Object[] args, java.lang.Class<?>[] sig) throws java.lang.Throwable
java.lang.Throwable
public static java.lang.Object fieldCall(java.lang.Object instanceOrClassContainingTheField, java.lang.Class<?> classDefiningField, java.lang.String fieldName, java.lang.Class<?> fieldType)
public static java.lang.Object staticConstructorCall(java.lang.String className)
public static java.lang.Object constructorCall(java.lang.Class<?> type, java.lang.Object[] args, java.lang.Class<?>[] sig) throws java.lang.Throwable
java.lang.Throwable
public static boolean suppressConstructorCall(java.lang.Class<?> type, java.lang.Object[] args, java.lang.Class<?>[] sig) throws java.lang.Throwable
java.lang.Throwable
public static java.lang.Object methodCall(java.lang.Object instance, java.lang.String methodName, java.lang.Object[] args, java.lang.Class<?>[] sig, java.lang.String returnTypeAsString) throws java.lang.Throwable
java.lang.Throwable
public static java.lang.Object methodCall(java.lang.Class<?> type, java.lang.String methodName, java.lang.Object[] args, java.lang.Class<?>[] sig, java.lang.String returnTypeAsString) throws java.lang.Throwable
java.lang.Throwable