| java.lang.Object org.kuali.test.MockService
MockService | public class MockService implements InvocationHandler(Code) | | This class implements a mock object for any service, using a dynamic proxy. It returns results for specific methods and
arguments, and can also relay unspecified methods or arguments to a fallback service. Note that this proxy does not do Spring
things like AOP transactions, altho the fallback service may.
|
Method Summary | |
public static I | createProxy(Class<I> iface, MockMethod[] mockMethods, Object noMethodFallback) Creates a dynamic proxy with the given mock methods.
Parameters: iface - the interface to proxy Parameters: mockMethods - the methods to mock Parameters: noMethodFallback - the Object to use when there is no mock method for the invoked method, or null if ajunit.framework.AssertionFailedError should be thrown in this case instead. | public static I | createProxy(Class<I> iface, String methodName, Object[] args, Object result) Creates a dynamic proxy with a single mock method that has a single result. | public Object | invoke(Object proxy, Method method, Object[] args) Returns the result associated with the given method and list of arguments. |
createProxy | public static I createProxy(Class<I> iface, MockMethod[] mockMethods, Object noMethodFallback)(Code) | | Creates a dynamic proxy with the given mock methods.
Parameters: iface - the interface to proxy Parameters: mockMethods - the methods to mock Parameters: noMethodFallback - the Object to use when there is no mock method for the invoked method, or null if ajunit.framework.AssertionFailedError should be thrown in this case instead. a dynamic proxy implementing the given interface |
createProxy | public static I createProxy(Class<I> iface, String methodName, Object[] args, Object result)(Code) | | Creates a dynamic proxy with a single mock method that has a single result. Invocations of other methods or arguments will
throw a
junit.framework.AssertionFailedError .
Parameters: iface - the interface to proxy Parameters: methodName - the name of the method to mock Parameters: args - the arguments to expect for the named method Parameters: result - the result to return from the named method a dynamic proxy implementing the given interface |
|
|