- All Known Implementing Classes:
AndroidClassProxyFactory,ClassProxyFactory,JavaProxyFactory
public interface IProxyFactory
Reponsible of creating proxies for objects. The implementation used for an object to proxy depends on its type but also
on the JVM we are running.
- Author:
- OFFIS, Tammo Freese
-
Method Summary
Modifier and TypeMethodDescription<T> TcreateProxy(Class<T> toMock, InvocationHandler handler, Method[] mockedMethods, ConstructorArgs constructorArgs) getInvocationHandler(Object mock) Returns the invocation handler formock;
-
Method Details
-
createProxy
<T> T createProxy(Class<T> toMock, InvocationHandler handler, Method[] mockedMethods, ConstructorArgs constructorArgs) - Type Parameters:
T- type of the class to mock- Parameters:
toMock- the class to mock by the factoryhandler- the handler that will be linked to the created proxymockedMethods- the subset oftoMock's methods to mock, or null to mock all methods.constructorArgs- the constructor arguments to use, or null to use heuristics to choose a constructor.- Returns:
- the newly created proxy
-
getInvocationHandler
Returns the invocation handler formock;- Parameters:
mock- a mock instance previously returned bycreateProxy.- Returns:
- the handler handling method calls for the
mock
-