|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.powermock.mockpolicies.impl.MockPolicyInterceptionSettingsImpl
public class MockPolicyInterceptionSettingsImpl
Constructor Summary | |
---|---|
MockPolicyInterceptionSettingsImpl()
|
Method Summary | |
---|---|
void |
addFieldToSuppress(Field[] fields)
Add specific fields that should be suppressed upon invocation. |
void |
addFieldToSuppress(Field firstField,
Field... fields)
Add specific fields that should be suppressed upon invocation. |
void |
addFieldTypesToSuppress(String[] fieldTypes)
Add field types that should be suppressed. |
void |
addFieldTypesToSuppress(String firstType,
String... additionalFieldTypes)
Add field types that should be suppressed. |
void |
addMethodsToSuppress(Method[] methods)
Add methods to suppress upon invocation. |
void |
addMethodsToSuppress(Method methodToSuppress,
Method... additionalMethodsToSuppress)
Add methods to suppress upon invocation. |
void |
addSubtituteReturnValue(Method method,
Object returnObject)
Add a method that should be intercepted and return another value ( returnObject ). |
Field[] |
getFieldsToSuppress()
|
String[] |
getFieldTypesToSuppress()
|
Method[] |
getMethodsToSuppress()
|
Map<Method,InvocationHandler> |
getProxiedMethods()
Get all methods that should be proxied and the invocation handler for each method. |
Map<Method,Object> |
getStubbedMethods()
Get all substitute return values and also returns an unmodifiable map of all method-object pairs the were initialized. |
Map<Method,Object> |
getSubstituteReturnValues()
Get all substitute return values and also returns an unmodifiable map of all method-object pairs the were initialized. |
void |
proxyMethod(Method method,
InvocationHandler invocationHandler)
Proxy a method with the given invocation handler. |
void |
setFieldsSuppress(Field[] fields)
Set specific fields that should be suppressed upon invocation. |
void |
setFieldTypesToSuppress(String[] fieldTypes)
Set which field types that should be suppressed. |
void |
setMethodsToProxy(Map<Method,InvocationHandler> proxies)
Set the methods to proxy. |
void |
setMethodsToStub(Map<Method,Object> substituteReturnValues)
Set the substitute return values. |
void |
setMethodsToSuppress(Method[] methods)
Set which methods to suppress. |
void |
setSubtituteReturnValues(Map<Method,Object> substituteReturnValues)
Set the substitute return values. |
void |
stubMethod(Method method,
Object returnObject)
Add a method that should be intercepted and return another value ( returnObject ) (i.e. the method is stubbed). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MockPolicyInterceptionSettingsImpl()
Method Detail |
---|
public void addFieldTypesToSuppress(String firstType, String... additionalFieldTypes)
MockPolicyInterceptionSettings
addFieldTypesToSuppress
in interface MockPolicyInterceptionSettings
public void addFieldTypesToSuppress(String[] fieldTypes)
MockPolicyInterceptionSettings
addFieldTypesToSuppress
in interface MockPolicyInterceptionSettings
public void setFieldTypesToSuppress(String[] fieldTypes)
MockPolicyInterceptionSettings
setFieldTypesToSuppress
in interface MockPolicyInterceptionSettings
public Field[] getFieldsToSuppress()
getFieldsToSuppress
in interface MockPolicyInterceptionSettings
null
or other default values).public Method[] getMethodsToSuppress()
getMethodsToSuppress
in interface MockPolicyInterceptionSettings
public Map<Method,Object> getStubbedMethods()
MockPolicyInterceptionSettings
getStubbedMethods
in interface MockPolicyInterceptionSettings
public void addFieldToSuppress(Field firstField, Field... fields)
MockPolicyInterceptionSettings
addFieldToSuppress
in interface MockPolicyInterceptionSettings
public void addFieldToSuppress(Field[] fields)
MockPolicyInterceptionSettings
addFieldToSuppress
in interface MockPolicyInterceptionSettings
public void addMethodsToSuppress(Method methodToSuppress, Method... additionalMethodsToSuppress)
MockPolicyInterceptionSettings
addMethodsToSuppress
in interface MockPolicyInterceptionSettings
public void addMethodsToSuppress(Method[] methods)
MockPolicyInterceptionSettings
addMethodsToSuppress
in interface MockPolicyInterceptionSettings
public void stubMethod(Method method, Object returnObject)
MockPolicyInterceptionSettings
returnObject
) (i.e. the method is stubbed).
stubMethod
in interface MockPolicyInterceptionSettings
public void setFieldsSuppress(Field[] fields)
MockPolicyInterceptionSettings
setFieldsSuppress
in interface MockPolicyInterceptionSettings
public void setMethodsToSuppress(Method[] methods)
MockPolicyInterceptionSettings
setMethodsToSuppress
in interface MockPolicyInterceptionSettings
public void setMethodsToStub(Map<Method,Object> substituteReturnValues)
MockPolicyInterceptionSettings
Note that this overrides all previous configurations.
setMethodsToStub
in interface MockPolicyInterceptionSettings
public String[] getFieldTypesToSuppress()
getFieldTypesToSuppress
in interface MockPolicyInterceptionSettings
public void addSubtituteReturnValue(Method method, Object returnObject)
MockPolicyInterceptionSettings
returnObject
). The substitute return values is a key-value
map where each key is a method that should be intercepted and each value
is the new return value for that method when it's intercepted.
addSubtituteReturnValue
in interface MockPolicyInterceptionSettings
public void setSubtituteReturnValues(Map<Method,Object> substituteReturnValues)
MockPolicyInterceptionSettings
Note that this overrides all previous configurations.
setSubtituteReturnValues
in interface MockPolicyInterceptionSettings
public Map<Method,Object> getSubstituteReturnValues()
MockPolicyInterceptionSettings
getSubstituteReturnValues
in interface MockPolicyInterceptionSettings
public Map<Method,InvocationHandler> getProxiedMethods()
MockPolicyInterceptionSettings
getProxiedMethods
in interface MockPolicyInterceptionSettings
public void proxyMethod(Method method, InvocationHandler invocationHandler)
MockPolicyInterceptionSettings
proxyMethod
in interface MockPolicyInterceptionSettings
public void setMethodsToProxy(Map<Method,InvocationHandler> proxies)
MockPolicyInterceptionSettings
Note that this overrides all previous configurations.
setMethodsToProxy
in interface MockPolicyInterceptionSettings
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |