public class MockPolicyInterceptionSettingsImpl extends Object implements MockPolicyInterceptionSettings
| Constructor and Description |
|---|
MockPolicyInterceptionSettingsImpl() |
| Modifier and Type | Method and Description |
|---|---|
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. |
public void addFieldTypesToSuppress(String firstType, String... additionalFieldTypes)
MockPolicyInterceptionSettingsaddFieldTypesToSuppress in interface MockPolicyInterceptionSettingspublic void addFieldTypesToSuppress(String[] fieldTypes)
MockPolicyInterceptionSettingsaddFieldTypesToSuppress in interface MockPolicyInterceptionSettingspublic void setFieldTypesToSuppress(String[] fieldTypes)
MockPolicyInterceptionSettingssetFieldTypesToSuppress in interface MockPolicyInterceptionSettingspublic Field[] getFieldsToSuppress()
getFieldsToSuppress in interface MockPolicyInterceptionSettingsnull or other default values).public Method[] getMethodsToSuppress()
getMethodsToSuppress in interface MockPolicyInterceptionSettingspublic Map<Method,Object> getStubbedMethods()
MockPolicyInterceptionSettingsgetStubbedMethods in interface MockPolicyInterceptionSettingspublic void addFieldToSuppress(Field firstField, Field... fields)
MockPolicyInterceptionSettingsaddFieldToSuppress in interface MockPolicyInterceptionSettingspublic void addFieldToSuppress(Field[] fields)
MockPolicyInterceptionSettingsaddFieldToSuppress in interface MockPolicyInterceptionSettingspublic void addMethodsToSuppress(Method methodToSuppress, Method... additionalMethodsToSuppress)
MockPolicyInterceptionSettingsaddMethodsToSuppress in interface MockPolicyInterceptionSettingspublic void addMethodsToSuppress(Method[] methods)
MockPolicyInterceptionSettingsaddMethodsToSuppress in interface MockPolicyInterceptionSettingspublic void stubMethod(Method method, Object returnObject)
MockPolicyInterceptionSettingsreturnObject) (i.e. the method is stubbed).stubMethod in interface MockPolicyInterceptionSettingspublic void setFieldsSuppress(Field[] fields)
MockPolicyInterceptionSettingssetFieldsSuppress in interface MockPolicyInterceptionSettingspublic void setMethodsToSuppress(Method[] methods)
MockPolicyInterceptionSettingssetMethodsToSuppress in interface MockPolicyInterceptionSettingspublic void setMethodsToStub(Map<Method,Object> substituteReturnValues)
MockPolicyInterceptionSettingsNote that this overrides all previous configurations.
setMethodsToStub in interface MockPolicyInterceptionSettingspublic String[] getFieldTypesToSuppress()
getFieldTypesToSuppress in interface MockPolicyInterceptionSettingspublic void addSubtituteReturnValue(Method method, Object returnObject)
MockPolicyInterceptionSettingsreturnObject). 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 MockPolicyInterceptionSettingspublic void setSubtituteReturnValues(Map<Method,Object> substituteReturnValues)
MockPolicyInterceptionSettingsNote that this overrides all previous configurations.
setSubtituteReturnValues in interface MockPolicyInterceptionSettingspublic Map<Method,Object> getSubstituteReturnValues()
MockPolicyInterceptionSettingsgetSubstituteReturnValues in interface MockPolicyInterceptionSettingspublic Map<Method,InvocationHandler> getProxiedMethods()
MockPolicyInterceptionSettingsgetProxiedMethods in interface MockPolicyInterceptionSettingspublic void proxyMethod(Method method, InvocationHandler invocationHandler)
MockPolicyInterceptionSettingsproxyMethod in interface MockPolicyInterceptionSettingspublic void setMethodsToProxy(Map<Method,InvocationHandler> proxies)
MockPolicyInterceptionSettingsNote that this overrides all previous configurations.
setMethodsToProxy in interface MockPolicyInterceptionSettingsCopyright © 2007–2015. All rights reserved.