org.unitils.mock.core
Class BehaviorDefiningInvocation
java.lang.Object
org.unitils.mock.core.proxy.ProxyInvocation
org.unitils.mock.core.BehaviorDefiningInvocation
public class BehaviorDefiningInvocation
- extends ProxyInvocation
- Author:
- Filip Neven, Tim Ducheyne, Kenny Claes
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
argumentMatchers
protected List<ArgumentMatcher> argumentMatchers
mockBehavior
protected MockBehavior mockBehavior
BehaviorDefiningInvocation
public BehaviorDefiningInvocation(ProxyInvocation proxyInvocation,
MockBehavior mockBehavior,
List<ArgumentMatcher> argumentMatchers)
- Creates a behavior defining invocation for the given prosy invocation.
The argumentsAtInvocationTime should be copies (deep clones) of the arguments at the time of
the invocation. This way the original values can still be used later-on even when changes
occur to the original values (pass-by-value vs pass-by-reference).
- Parameters:
proxyInvocation
- The proxy invocation, not nullmockBehavior
- The behavior to execute, not nullargumentMatchers
- The argument matchers to use when matching the invocation, not null
getMockBehavior
public MockBehavior getMockBehavior()
- Returns:
- The behavior to execute, not null
setMockBehavior
public void setMockBehavior(MockBehavior mockBehavior)
- Parameters:
mockBehavior
- The behavior to execute, not null
matches
public int matches(ProxyInvocation proxyInvocation)
- Returns whether or not the given
ProxyInvocation
matches this object's predefined Method
and arguments.
- Parameters:
proxyInvocation
- the ProxyInvocation
to match.
- Returns:
- A matching score for the invocation, -1 if there is no match
Copyright © 2011. All Rights Reserved.