com.github.kristofa.test.http
Class UnsatisfiedExpectationException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.github.kristofa.test.http.UnsatisfiedExpectationException
All Implemented Interfaces:
Serializable

public class UnsatisfiedExpectationException
extends Exception

Indicates there are http requests that we expected but did not get and/or that we got unexpected http requests.

Author:
kristof
See Also:
HttpResponseProvider, Serialized Form

Constructor Summary
UnsatisfiedExpectationException(Collection<HttpRequest> missingRequests, Collection<HttpRequest> unexpectedRequests)
          Creates a new instance.
 
Method Summary
 Collection<HttpRequest> getMissingHttpRequests()
          Gets the http requests that we expected but did not get.
 Collection<HttpRequest> getUnexpectedHttpRequests()
          Gets the http requests that we got but did not expect.
 String toString()
          
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, 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

UnsatisfiedExpectationException

public UnsatisfiedExpectationException(Collection<HttpRequest> missingRequests,
                                       Collection<HttpRequest> unexpectedRequests)
Creates a new instance.

Both collections should not be null. One of both collections can be empty.

Parameters:
missingRequests - Requests that we expected but did not get.
unexpectedRequests - Requests that we got but did not expect.
Method Detail

getMissingHttpRequests

public Collection<HttpRequest> getMissingHttpRequests()
Gets the http requests that we expected but did not get.

Returns:
Collection of http requests that we expected but did not get.

getUnexpectedHttpRequests

public Collection<HttpRequest> getUnexpectedHttpRequests()
Gets the http requests that we got but did not expect.

Returns:
Collection of http requests that we got but did not expect.

toString

public String toString()

Overrides:
toString in class Throwable


Copyright © 2014. All Rights Reserved.