org.mockserver.integration.server
Class AbstractClientServerIntegrationTest

java.lang.Object
  extended by org.mockserver.integration.server.AbstractClientServerIntegrationTest
Direct Known Subclasses:
SameJVMAbstractClientServerIntegrationTest

public abstract class AbstractClientServerIntegrationTest
extends Object

Author:
jamesdbloom

Field Summary
protected  List<String> headersToIgnore
           
protected static MockServerClient mockServerClient
           
protected static String servletContext
           
static String TEXT_PLAIN
           
 
Constructor Summary
AbstractClientServerIntegrationTest()
           
 
Method Summary
protected  String calculatePath(String path)
           
static Expectation expectation(HttpRequest httpRequest)
           
abstract  int getMockServerPort()
           
abstract  int getMockServerSecurePort()
           
abstract  int getTestServerPort()
           
protected  HttpResponse makeRequest(HttpRequest httpRequest)
           
protected  HttpResponse makeRequest(HttpRequest httpRequest, Collection<String> headersToIgnore)
           
 void resetServer()
           
 void shouldAllowSimultaneousForwardAndResponseExpectations()
           
 void shouldCallbackToSpecifiedClassWithPrecannedResponse()
           
 void shouldClearAllExpectationsWithEmptyRequest()
           
 void shouldClearAllExpectationsWithNull()
           
 void shouldClearExpectations()
           
 void shouldClearExpectationsWithJsonSchemaBody()
           
 void shouldClearExpectationsWithParameterBody()
           
 void shouldClearExpectationsWithXPathBody()
           
 void shouldEnsureThatRequestDelaysDoNotAffectOtherRequests()
           
 void shouldForwardRequestInHTTP()
           
 void shouldForwardRequestInHTTPS()
           
 void shouldNotReturnResponseForMatchingBodyParameterWithNotOperator()
           
 void shouldNotReturnResponseForMatchingBodyWithNotOperator()
           
 void shouldNotReturnResponseForMatchingCookieWithNotOperator()
           
 void shouldNotReturnResponseForMatchingHeaderWithNotOperator()
           
 void shouldNotReturnResponseForMatchingMethodWithNotOperator()
           
 void shouldNotReturnResponseForMatchingPathWithNotOperator()
           
 void shouldNotReturnResponseForMatchingQueryStringParameterWithNotOperator()
           
 void shouldNotReturnResponseForNonMatchingBody()
           
 void shouldNotReturnResponseForNonMatchingBodyParameterName()
           
 void shouldNotReturnResponseForNonMatchingBodyParameterValue()
           
 void shouldNotReturnResponseForNonMatchingCookieName()
           
 void shouldNotReturnResponseForNonMatchingCookieValue()
           
 void shouldNotReturnResponseForNonMatchingHeaderName()
           
 void shouldNotReturnResponseForNonMatchingHeaderValue()
           
 void shouldNotReturnResponseForNonMatchingJsonBody()
           
 void shouldNotReturnResponseForNonMatchingJsonBodyWithMatchType()
           
 void shouldNotReturnResponseForNonMatchingJsonSchema()
           
 void shouldNotReturnResponseForNonMatchingPath()
           
 void shouldNotReturnResponseForNonMatchingQueryStringParameterName()
           
 void shouldNotReturnResponseForNonMatchingQueryStringParameterValue()
           
 void shouldNotReturnResponseForNonMatchingXmlBody()
           
 void shouldNotReturnResponseForNonMatchingXPathBody()
           
 void shouldNotReturnResponseForWhenTimeToLiveExpired()
           
 void shouldNotVerifyNoRequestsReceived()
           
 void shouldReset()
           
 void shouldRetrieveSequenceOfExpectationsSetup()
           
 void shouldRetrieveSequenceOfRequestsReceivedIncludingThoseNotMatchingAnException()
           
 void shouldReturnMatchRequestWithBodyInUTF16()
           
 void shouldReturnMatchRequestWithBodyInUTF16WithContentTypeHeader()
           
 void shouldReturnPDFResponseByMatchingBinaryPDFBody()
           
 void shouldReturnPDFResponseByMatchingPath()
           
 void shouldReturnPNGResponseByMatchingBinaryPNGBody()
           
 void shouldReturnPNGResponseByMatchingPath()
           
 void shouldReturnResponseByMatchingBodyWithJson()
           
 void shouldReturnResponseByMatchingBodyWithJsonSchema()
           
 void shouldReturnResponseByMatchingBodyWithJsonWithCharsetUTF8()
           
 void shouldReturnResponseByMatchingBodyWithJsonWithContentTypeHeader()
           
 void shouldReturnResponseByMatchingBodyWithJsonWithMatchType()
           
 void shouldReturnResponseByMatchingBodyWithXml()
           
 void shouldReturnResponseByMatchingBodyWithXPath()
           
 void shouldReturnResponseByMatchingPath()
           
 void shouldReturnResponseByMatchingPathAndMethod()
           
 void shouldReturnResponseByMatchingPathAndMethodAndBody()
           
 void shouldReturnResponseByMatchingPathAndMethodAndBodyParameters()
           
 void shouldReturnResponseByMatchingPathAndMethodAndCookies()
           
 void shouldReturnResponseByMatchingPathAndMethodAndHeaders()
           
 void shouldReturnResponseByMatchingPathAndMethodAndParametersAndHeadersAndCookies()
           
 void shouldReturnResponseByMatchingPathAndMethodAndQueryStringParameters()
           
 void shouldReturnResponseByMatchingPathAndMethodAndQueryStringParametersAndBody()
           
 void shouldReturnResponseByMatchingPathAndMethodAndQueryStringParametersAndBodyParameters()
           
 void shouldReturnResponseByMatchingPathExactTimes()
           
 void shouldReturnResponseByNotMatchingBodyParameterWithNotOperatorForName()
           
 void shouldReturnResponseByNotMatchingBodyParameterWithNotOperatorForNameAndValue()
           
 void shouldReturnResponseByNotMatchingBodyParameterWithNotOperatorForValue()
           
 void shouldReturnResponseByNotMatchingCookieWithNotOperatorForName()
           
 void shouldReturnResponseByNotMatchingCookieWithNotOperatorForNameAndValue()
           
 void shouldReturnResponseByNotMatchingCookieWithNotOperatorForValue()
           
 void shouldReturnResponseByNotMatchingHeaderWithNotOperatorForName()
           
 void shouldReturnResponseByNotMatchingHeaderWithNotOperatorForNameAndValue()
           
 void shouldReturnResponseByNotMatchingHeaderWithNotOperatorForValue()
           
 void shouldReturnResponseByNotMatchingMethodWithNotOperator()
           
 void shouldReturnResponseByNotMatchingPathWithNotOperator()
           
 void shouldReturnResponseByNotMatchingQueryStringParameterWithNotOperatorForName()
           
 void shouldReturnResponseByNotMatchingQueryStringParameterWithNotOperatorForNameAndValue()
           
 void shouldReturnResponseByNotMatchingQueryStringParameterWithNotOperatorForValue()
           
 void shouldReturnResponseForExpectationWithDelay()
           
 void shouldReturnResponseForRequestInSsl()
           
 void shouldReturnResponseForRequestNotInSsl()
           
 void shouldReturnResponseWhenTimeToLiveHasNotExpired()
           
 void shouldReturnResponseWithBodyInUTF16WithContentTypeHeader()
           
 void shouldReturnResponseWithBodyInUTF8()
           
 void shouldReturnResponseWithOnlyBody()
           
 void shouldReturnResponseWithOnlyStatusCode()
           
 void shouldVerifyNoMatchingRequestsReceived()
           
 void shouldVerifyNoMatchingRequestsReceivedInSsl()
           
 void shouldVerifyNoRequestsReceived()
           
 void shouldVerifyNotEnoughRequestsReceived()
           
 void shouldVerifyReceivedRequestInSsl()
           
 void shouldVerifyReceivedRequests()
           
 void shouldVerifyReceivedRequestsWithNoBody()
           
 void shouldVerifySequenceOfRequestsNotReceived()
           
 void shouldVerifySequenceOfRequestsReceived()
           
 void shouldVerifySequenceOfRequestsReceivedIncludingThoseNotMatchingAnException()
           
 void shouldVerifyTooManyRequestsReceived()
           
protected  void verifyRequestMatches(HttpRequest[] httpRequests, HttpRequest... httpRequestMatchers)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEXT_PLAIN

public static final String TEXT_PLAIN

mockServerClient

protected static MockServerClient mockServerClient

servletContext

protected static String servletContext

headersToIgnore

protected List<String> headersToIgnore
Constructor Detail

AbstractClientServerIntegrationTest

public AbstractClientServerIntegrationTest()
Method Detail

expectation

public static Expectation expectation(HttpRequest httpRequest)

getMockServerPort

public abstract int getMockServerPort()

getMockServerSecurePort

public abstract int getMockServerSecurePort()

getTestServerPort

public abstract int getTestServerPort()

calculatePath

protected String calculatePath(String path)

resetServer

public void resetServer()

shouldForwardRequestInHTTP

public void shouldForwardRequestInHTTP()

shouldForwardRequestInHTTPS

public void shouldForwardRequestInHTTPS()

shouldAllowSimultaneousForwardAndResponseExpectations

public void shouldAllowSimultaneousForwardAndResponseExpectations()

shouldCallbackToSpecifiedClassWithPrecannedResponse

public void shouldCallbackToSpecifiedClassWithPrecannedResponse()

shouldReturnResponseWithOnlyBody

public void shouldReturnResponseWithOnlyBody()

shouldReturnResponseForRequestInSsl

public void shouldReturnResponseForRequestInSsl()

shouldReturnResponseForRequestNotInSsl

public void shouldReturnResponseForRequestNotInSsl()

shouldReturnMatchRequestWithBodyInUTF16

public void shouldReturnMatchRequestWithBodyInUTF16()

shouldReturnMatchRequestWithBodyInUTF16WithContentTypeHeader

public void shouldReturnMatchRequestWithBodyInUTF16WithContentTypeHeader()

shouldReturnResponseWithBodyInUTF8

public void shouldReturnResponseWithBodyInUTF8()

shouldReturnResponseWithBodyInUTF16WithContentTypeHeader

public void shouldReturnResponseWithBodyInUTF16WithContentTypeHeader()

shouldReturnResponseWithOnlyStatusCode

public void shouldReturnResponseWithOnlyStatusCode()

shouldReturnResponseByMatchingPath

public void shouldReturnResponseByMatchingPath()

shouldReturnResponseByMatchingPathExactTimes

public void shouldReturnResponseByMatchingPathExactTimes()

shouldReturnResponseWhenTimeToLiveHasNotExpired

public void shouldReturnResponseWhenTimeToLiveHasNotExpired()

shouldReturnResponseByMatchingBodyWithXPath

public void shouldReturnResponseByMatchingBodyWithXPath()

shouldReturnResponseByMatchingBodyWithXml

public void shouldReturnResponseByMatchingBodyWithXml()

shouldReturnResponseByMatchingBodyWithJson

public void shouldReturnResponseByMatchingBodyWithJson()

shouldReturnResponseByMatchingBodyWithJsonWithCharsetUTF8

public void shouldReturnResponseByMatchingBodyWithJsonWithCharsetUTF8()

shouldReturnResponseByMatchingBodyWithJsonWithContentTypeHeader

public void shouldReturnResponseByMatchingBodyWithJsonWithContentTypeHeader()

shouldReturnResponseByMatchingBodyWithJsonWithMatchType

public void shouldReturnResponseByMatchingBodyWithJsonWithMatchType()

shouldReturnResponseByMatchingBodyWithJsonSchema

public void shouldReturnResponseByMatchingBodyWithJsonSchema()

shouldReturnPDFResponseByMatchingPath

public void shouldReturnPDFResponseByMatchingPath()
                                           throws IOException
Throws:
IOException

shouldReturnPNGResponseByMatchingPath

public void shouldReturnPNGResponseByMatchingPath()
                                           throws IOException
Throws:
IOException

shouldReturnPDFResponseByMatchingBinaryPDFBody

public void shouldReturnPDFResponseByMatchingBinaryPDFBody()
                                                    throws IOException
Throws:
IOException

shouldReturnPNGResponseByMatchingBinaryPNGBody

public void shouldReturnPNGResponseByMatchingBinaryPNGBody()
                                                    throws IOException
Throws:
IOException

shouldReturnResponseForExpectationWithDelay

public void shouldReturnResponseForExpectationWithDelay()

shouldReturnResponseByMatchingPathAndMethod

public void shouldReturnResponseByMatchingPathAndMethod()

shouldReturnResponseByNotMatchingPathWithNotOperator

public void shouldReturnResponseByNotMatchingPathWithNotOperator()

shouldReturnResponseByNotMatchingMethodWithNotOperator

public void shouldReturnResponseByNotMatchingMethodWithNotOperator()

shouldReturnResponseByMatchingPathAndMethodAndBody

public void shouldReturnResponseByMatchingPathAndMethodAndBody()

shouldReturnResponseByMatchingPathAndMethodAndQueryStringParameters

public void shouldReturnResponseByMatchingPathAndMethodAndQueryStringParameters()

shouldReturnResponseByMatchingPathAndMethodAndHeaders

public void shouldReturnResponseByMatchingPathAndMethodAndHeaders()

shouldReturnResponseByMatchingPathAndMethodAndCookies

public void shouldReturnResponseByMatchingPathAndMethodAndCookies()

shouldReturnResponseByMatchingPathAndMethodAndQueryStringParametersAndBodyParameters

public void shouldReturnResponseByMatchingPathAndMethodAndQueryStringParametersAndBodyParameters()

shouldReturnResponseByMatchingPathAndMethodAndQueryStringParametersAndBody

public void shouldReturnResponseByMatchingPathAndMethodAndQueryStringParametersAndBody()

shouldReturnResponseByMatchingPathAndMethodAndBodyParameters

public void shouldReturnResponseByMatchingPathAndMethodAndBodyParameters()

shouldReturnResponseByMatchingPathAndMethodAndParametersAndHeadersAndCookies

public void shouldReturnResponseByMatchingPathAndMethodAndParametersAndHeadersAndCookies()

shouldReturnResponseByNotMatchingBodyParameterWithNotOperatorForNameAndValue

public void shouldReturnResponseByNotMatchingBodyParameterWithNotOperatorForNameAndValue()

shouldReturnResponseByNotMatchingBodyParameterWithNotOperatorForName

public void shouldReturnResponseByNotMatchingBodyParameterWithNotOperatorForName()

shouldReturnResponseByNotMatchingBodyParameterWithNotOperatorForValue

public void shouldReturnResponseByNotMatchingBodyParameterWithNotOperatorForValue()

shouldReturnResponseByNotMatchingQueryStringParameterWithNotOperatorForNameAndValue

public void shouldReturnResponseByNotMatchingQueryStringParameterWithNotOperatorForNameAndValue()

shouldReturnResponseByNotMatchingQueryStringParameterWithNotOperatorForName

public void shouldReturnResponseByNotMatchingQueryStringParameterWithNotOperatorForName()

shouldReturnResponseByNotMatchingQueryStringParameterWithNotOperatorForValue

public void shouldReturnResponseByNotMatchingQueryStringParameterWithNotOperatorForValue()

shouldReturnResponseByNotMatchingCookieWithNotOperatorForNameAndValue

public void shouldReturnResponseByNotMatchingCookieWithNotOperatorForNameAndValue()

shouldReturnResponseByNotMatchingCookieWithNotOperatorForName

public void shouldReturnResponseByNotMatchingCookieWithNotOperatorForName()

shouldReturnResponseByNotMatchingCookieWithNotOperatorForValue

public void shouldReturnResponseByNotMatchingCookieWithNotOperatorForValue()

shouldReturnResponseByNotMatchingHeaderWithNotOperatorForNameAndValue

public void shouldReturnResponseByNotMatchingHeaderWithNotOperatorForNameAndValue()

shouldReturnResponseByNotMatchingHeaderWithNotOperatorForName

public void shouldReturnResponseByNotMatchingHeaderWithNotOperatorForName()

shouldReturnResponseByNotMatchingHeaderWithNotOperatorForValue

public void shouldReturnResponseByNotMatchingHeaderWithNotOperatorForValue()

shouldNotReturnResponseForWhenTimeToLiveExpired

public void shouldNotReturnResponseForWhenTimeToLiveExpired()

shouldNotReturnResponseForNonMatchingBody

public void shouldNotReturnResponseForNonMatchingBody()

shouldNotReturnResponseForMatchingBodyWithNotOperator

public void shouldNotReturnResponseForMatchingBodyWithNotOperator()

shouldNotReturnResponseForNonMatchingXPathBody

public void shouldNotReturnResponseForNonMatchingXPathBody()

shouldNotReturnResponseForNonMatchingXmlBody

public void shouldNotReturnResponseForNonMatchingXmlBody()

shouldNotReturnResponseForNonMatchingJsonBody

public void shouldNotReturnResponseForNonMatchingJsonBody()

shouldNotReturnResponseForNonMatchingJsonBodyWithMatchType

public void shouldNotReturnResponseForNonMatchingJsonBodyWithMatchType()

shouldNotReturnResponseForNonMatchingJsonSchema

public void shouldNotReturnResponseForNonMatchingJsonSchema()

shouldNotReturnResponseForNonMatchingPath

public void shouldNotReturnResponseForNonMatchingPath()

shouldNotReturnResponseForMatchingPathWithNotOperator

public void shouldNotReturnResponseForMatchingPathWithNotOperator()

shouldNotReturnResponseForMatchingMethodWithNotOperator

public void shouldNotReturnResponseForMatchingMethodWithNotOperator()

shouldNotReturnResponseForNonMatchingBodyParameterName

public void shouldNotReturnResponseForNonMatchingBodyParameterName()

shouldNotReturnResponseForMatchingBodyParameterWithNotOperator

public void shouldNotReturnResponseForMatchingBodyParameterWithNotOperator()

shouldNotReturnResponseForNonMatchingBodyParameterValue

public void shouldNotReturnResponseForNonMatchingBodyParameterValue()

shouldNotReturnResponseForNonMatchingQueryStringParameterName

public void shouldNotReturnResponseForNonMatchingQueryStringParameterName()

shouldNotReturnResponseForNonMatchingQueryStringParameterValue

public void shouldNotReturnResponseForNonMatchingQueryStringParameterValue()

shouldNotReturnResponseForMatchingQueryStringParameterWithNotOperator

public void shouldNotReturnResponseForMatchingQueryStringParameterWithNotOperator()

shouldNotReturnResponseForNonMatchingCookieName

public void shouldNotReturnResponseForNonMatchingCookieName()

shouldNotReturnResponseForNonMatchingCookieValue

public void shouldNotReturnResponseForNonMatchingCookieValue()

shouldNotReturnResponseForMatchingCookieWithNotOperator

public void shouldNotReturnResponseForMatchingCookieWithNotOperator()

shouldNotReturnResponseForNonMatchingHeaderName

public void shouldNotReturnResponseForNonMatchingHeaderName()

shouldNotReturnResponseForNonMatchingHeaderValue

public void shouldNotReturnResponseForNonMatchingHeaderValue()

shouldNotReturnResponseForMatchingHeaderWithNotOperator

public void shouldNotReturnResponseForMatchingHeaderWithNotOperator()

shouldVerifyReceivedRequests

public void shouldVerifyReceivedRequests()

shouldVerifyReceivedRequestInSsl

public void shouldVerifyReceivedRequestInSsl()

shouldVerifyReceivedRequestsWithNoBody

public void shouldVerifyReceivedRequestsWithNoBody()

shouldVerifyNotEnoughRequestsReceived

public void shouldVerifyNotEnoughRequestsReceived()

shouldVerifyTooManyRequestsReceived

public void shouldVerifyTooManyRequestsReceived()

shouldVerifyNoMatchingRequestsReceived

public void shouldVerifyNoMatchingRequestsReceived()

shouldVerifyNoRequestsReceived

public void shouldVerifyNoRequestsReceived()

shouldNotVerifyNoRequestsReceived

public void shouldNotVerifyNoRequestsReceived()

shouldVerifyNoMatchingRequestsReceivedInSsl

public void shouldVerifyNoMatchingRequestsReceivedInSsl()

shouldVerifySequenceOfRequestsReceived

public void shouldVerifySequenceOfRequestsReceived()

shouldVerifySequenceOfRequestsReceivedIncludingThoseNotMatchingAnException

public void shouldVerifySequenceOfRequestsReceivedIncludingThoseNotMatchingAnException()

shouldRetrieveSequenceOfRequestsReceivedIncludingThoseNotMatchingAnException

public void shouldRetrieveSequenceOfRequestsReceivedIncludingThoseNotMatchingAnException()

shouldRetrieveSequenceOfExpectationsSetup

public void shouldRetrieveSequenceOfExpectationsSetup()

shouldVerifySequenceOfRequestsNotReceived

public void shouldVerifySequenceOfRequestsNotReceived()

shouldClearExpectations

public void shouldClearExpectations()

shouldClearAllExpectationsWithNull

public void shouldClearAllExpectationsWithNull()

shouldClearAllExpectationsWithEmptyRequest

public void shouldClearAllExpectationsWithEmptyRequest()

shouldClearExpectationsWithXPathBody

public void shouldClearExpectationsWithXPathBody()

shouldClearExpectationsWithJsonSchemaBody

public void shouldClearExpectationsWithJsonSchemaBody()

shouldClearExpectationsWithParameterBody

public void shouldClearExpectationsWithParameterBody()

shouldReset

public void shouldReset()

shouldEnsureThatRequestDelaysDoNotAffectOtherRequests

public void shouldEnsureThatRequestDelaysDoNotAffectOtherRequests()
                                                           throws Exception
Throws:
Exception

verifyRequestMatches

protected void verifyRequestMatches(HttpRequest[] httpRequests,
                                    HttpRequest... httpRequestMatchers)

makeRequest

protected HttpResponse makeRequest(HttpRequest httpRequest)

makeRequest

protected HttpResponse makeRequest(HttpRequest httpRequest,
                                   Collection<String> headersToIgnore)


Copyright © 2016. All rights reserved.