org.unitils.mock.mockbehavior.impl
Class DummyValueReturningMockBehavior

java.lang.Object
  extended by org.unitils.mock.mockbehavior.impl.DefaultValueReturningMockBehavior
      extended by 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:

Author:
Jeroen Horemans

Constructor Summary
DummyValueReturningMockBehavior()
           
 
Method Summary
 Object execute(ProxyInvocation proxyInvocation)
          Executes the mock behavior.
 
Methods inherited from class org.unitils.mock.mockbehavior.impl.DefaultValueReturningMockBehavior
assertCanExecute, resolveNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DummyValueReturningMockBehavior

public DummyValueReturningMockBehavior()
Method Detail

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.