org.unitils.mock.mockbehavior.impl
Class DummyValueReturningMockBehavior
java.lang.Object
org.unitils.mock.mockbehavior.impl.DefaultValueReturningMockBehavior
org.unitils.mock.mockbehavior.impl.DummyValueReturningMockBehavior
- All Implemented Interfaces:
- MockBehavior, ValidatableMockBehavior
public class DummyValueReturningMockBehavior
- extends DefaultValueReturningMockBehavior
Mock behavior that returns a default value. The default value for an object will be a proxy object with the same behaviour. When doing
the same call multiple times the same 'proxy' object will be returned each time. Doing the same method call with other parameters will
howerver result a new object returned.
Following defaults are used:
- Number values: 0
- Object values: DummyObject
- Collection: DummyObject
- arrays etc: empty values
- Author:
- Jeroen Horemans
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DummyValueReturningMockBehavior
public DummyValueReturningMockBehavior()
execute
public Object execute(ProxyInvocation proxyInvocation)
- Executes the mock behavior.
- Specified by:
execute
in interface MockBehavior
- Overrides:
execute
in class DefaultValueReturningMockBehavior
- Parameters:
proxyInvocation
- The proxy method invocation, not null
- Returns:
- The default value defined by this behavior
Copyright © 2011. All Rights Reserved.