org.unitils.mock.mockbehavior
Interface MockBehavior
- All Known Subinterfaces:
- ValidatableMockBehavior
- All Known Implementing Classes:
- BehaviorDefiningMatchingInvocationHandler.ChainedMockBehavior, DefaultValueReturningMockBehavior, ExceptionThrowingMockBehavior, NoopMockBehavior, OriginalBehaviorInvokingMockBehavior, ValueReturningMockBehavior
public interface MockBehavior
Behavior for a mock instance. Mock behavior is defined before the test is performed and then executed during
the test when needed. If a certain proxy method invocation requires the mock behavior, the execute(org.unitils.mock.core.proxy.ProxyInvocation) method
is called with the invocation as argument. The result value will then be used as return value of the proxy method.
- Author:
- Filip Neven, Tim Ducheyne, Kenny Claes
execute
java.lang.Object execute(ProxyInvocation proxyInvocation)
throws java.lang.Throwable
- Executes the mock behavior.
- Parameters:
proxyInvocation - The proxy method invocation, not null
- Returns:
- The return value, null if there is no return value
- Throws:
java.lang.Throwable
Copyright © 2009. All Rights Reserved.