org.spockframework.mock
Class WrongInvocationOrderError

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Error
          extended by java.lang.AssertionError
              extended by org.spockframework.runtime.SpockAssertionError
                  extended by org.spockframework.mock.InteractionNotSatisfiedError
                      extended by org.spockframework.mock.WrongInvocationOrderError
All Implemented Interfaces:
java.io.Serializable

public class WrongInvocationOrderError
extends InteractionNotSatisfiedError

Thrown if an invocation on a mock object occurs too late. Example:

 when:
 ...

 then:
 1 * foo.me()
 1 * bar.me()

 then: // indicates that subsequent interactions must take place after previous interactions
 1 * baz.me()
 
Assuming the following invocation order:
  1. bar.me()
  2. baz.me()
  3. foo.me()
A WrongInvocationOrderError will be thrown on the third call.

See Also:
Serialized Form

Constructor Summary
WrongInvocationOrderError(IMockInteraction interaction, IMockInvocation lastInvocation)
           
 
Method Summary
 IMockInteraction getInteraction()
           
 IMockInvocation getLastInvocation()
           
 java.lang.String getMessage()
           
 
Methods inherited from class org.spockframework.runtime.SpockAssertionError
toString
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WrongInvocationOrderError

public WrongInvocationOrderError(IMockInteraction interaction,
                                 IMockInvocation lastInvocation)
Method Detail

getInteraction

public IMockInteraction getInteraction()

getLastInvocation

public IMockInvocation getLastInvocation()

getMessage

public java.lang.String getMessage()
Overrides:
getMessage in class java.lang.Throwable


Copyright © 2013. All rights reserved