|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.unitils.mock.mockbehavior.impl.ValueReturningMockBehavior
public class ValueReturningMockBehavior
Mock behavior that returns a given value.
Constructor Summary | |
---|---|
ValueReturningMockBehavior(Object valueToReturn)
Creates the returning behavior for the given value. |
Method Summary | |
---|---|
void |
assertCanExecute(ProxyInvocation proxyInvocation)
Checks whether the mock behavior can be executed for the given invocation. |
Object |
execute(ProxyInvocation proxyInvocation)
Executes the mock behavior. |
protected Object |
unwrapValueToReturnIfNeeded(Object valueToReturn)
If the value to return is an wrapper object, e.g. a mock, this will return the wrapped instance instead of the wrapper. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ValueReturningMockBehavior(Object valueToReturn)
valueToReturn
- The valueMethod Detail |
---|
public void assertCanExecute(ProxyInvocation proxyInvocation) throws UnitilsException
assertCanExecute
in interface ValidatableMockBehavior
proxyInvocation
- The proxy method invocation, not null
UnitilsException
public Object execute(ProxyInvocation proxyInvocation)
execute
in interface MockBehavior
proxyInvocation
- The proxy method invocation, not null
protected Object unwrapValueToReturnIfNeeded(Object valueToReturn)
valueToReturn
- The return value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |