org.unitils.mock.mockbehavior
Interface MockBehavior
- All Known Subinterfaces:
- ValidatableMockBehavior
- All Known Implementing Classes:
- BehaviorDefiningMatchingInvocationHandler.ChainedMockBehavior, DefaultValueReturningMockBehavior, DummyValueReturningMockBehavior, ExceptionThrowingMockBehavior, NoopMockBehavior, OriginalBehaviorInvokingMockBehavior, StubMockBehavior, 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
Object execute(ProxyInvocation proxyInvocation)
throws 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:
Throwable
Copyright © 2011. All Rights Reserved.