|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.unitils.mock.mockbehavior.impl.ValueReturningMockBehavior
public class ValueReturningMockBehavior
Mock behavior that returns a given value.
| Constructor Summary | |
|---|---|
ValueReturningMockBehavior(java.lang.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. |
java.lang.Object |
execute(ProxyInvocation proxyInvocation)
Executes the mock behavior. |
protected java.lang.Object |
unwrapValueToReturnIfNeeded(java.lang.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(java.lang.Object valueToReturn)
valueToReturn - The value| Method Detail |
|---|
public void assertCanExecute(ProxyInvocation proxyInvocation)
throws UnitilsException
assertCanExecute in interface ValidatableMockBehaviorproxyInvocation - The proxy method invocation, not null
UnitilsExceptionpublic java.lang.Object execute(ProxyInvocation proxyInvocation)
execute in interface MockBehaviorproxyInvocation - The proxy method invocation, not null
protected java.lang.Object unwrapValueToReturnIfNeeded(java.lang.Object valueToReturn)
valueToReturn - The return value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||