Class MemberModifier
java.lang.Object
org.powermock.api.support.membermodification.MemberMatcher
org.powermock.api.support.membermodification.MemberModifier
- Direct Known Subclasses:
PowerMock
,PowerMockito
Contains various utilities for modifying members of classes such as
constructors, fields and methods. Modifying means e.g. changing return value
of method invocations or suppressing a constructor.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MethodReplaceStrategy
Replace a method invocation.static <T> MethodStubStrategy
<T> Add a method that should be intercepted and return another value (i.e.static void
suppress
(AccessibleObject[] accessibleObjects) Suppress an array of accessible objects.static void
suppress
(Constructor<?> constructor) Suppress a constructor.static void
suppress
(Constructor<?>[] constructors) Suppress multiple constructors.static void
Suppress a field.static void
Suppress multiple fields.static void
Suppress a specific method.static void
Suppress multiple methods.Methods inherited from class org.powermock.api.support.membermodification.MemberMatcher
constructor, constructor, constructors, constructorsDeclaredIn, defaultConstructorIn, everythingDeclaredIn, field, fields, fields, fields, fields, method, method, methods, methods, methods, methodsDeclaredIn
-
Constructor Details
-
MemberModifier
public MemberModifier()
-
-
Method Details
-
suppress
Suppress a specific method. This works on both instance methods and static methods. -
suppress
Suppress multiple methods. This works on both instance methods and static methods. -
suppress
Suppress a constructor. -
suppress
Suppress multiple constructors. -
suppress
Suppress a field. -
suppress
Suppress multiple fields. -
suppress
Suppress an array of accessible objects. -
stub
Add a method that should be intercepted and return another value (i.e. the method is stubbed). -
replace
Replace a method invocation.
-