biz.xsoftware.mock
Interface CloningBehavior

All Superinterfaces:
Behavior

public interface CloningBehavior
extends Behavior

The same exact thing as the Behavior method except a cloning method must be supplied to. Sometimes the Behavior method will make modifications to the passed in parameter methods. The cloning method allows the mockobject to take a snapshot of the parameters passed into the method before they are modified. Then the test can still verify later the correct parameters were passed in. So, if you are mocking a method

public int doSomethingCool(Map map, int i, long l);

Then you must have a cloning method of the form

public Object[] doSomethingCoolClone(Map map, int i, long l);

Notice that you probably only need to clone the Map and would need to return an object array of all the parameters as so... new Object[] { clonedMap, i, l);

Author:
dhiller