org.qi4j.test.mock
Class MockPlayerMixin
java.lang.Object
org.qi4j.test.mock.MockPlayerMixin
- All Implemented Interfaces:
- InvocationHandler
public class MockPlayerMixin
- extends Object
- implements InvocationHandler
Generic mixin for mock composites. Overrides any generic mixins but not typed mixins, as typed mixins have precedence
over generic mixins. To override a typed mixin MockPlayerConcern
can be used.
MockResolver player mixin will delegate method invocations to registered mocks. Mocks can be registered by using
MockComposite
.
If there is no mock registered to handle the method invocation invocation will fail by throwing an
IllegalStateException.
Method Summary |
Object |
invoke(Object proxy,
Method method,
Object[] args)
Finds a registered mock that can handle the method invocation and delegate to it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MockPlayerMixin
public MockPlayerMixin()
invoke
public Object invoke(Object proxy,
Method method,
Object[] args)
throws Throwable
- Finds a registered mock that can handle the method invocation and delegate to it. If there is no such mock throws
IllegalStateException.
- Specified by:
invoke
in interface InvocationHandler
- Throws:
Throwable
- See Also:
InvocationHandler.invoke(Object, java.lang.reflect.Method, Object[])