Class RequestMatchers

java.lang.Object
org.springframework.ws.test.client.RequestMatchers

public abstract class RequestMatchers extends Object
Factory methods for RequestMatcher classes. Typically used to provide input for MockWebServiceServer.expect(RequestMatcher).
Since:
2.0
Author:
Arjen Poutsma
  • Method Details

    • anything

      public static RequestMatcher anything()
      Expects any request.
      Returns:
      the request matcher
    • payload

      public static RequestMatcher payload(Source payload)
      Expects the given Source XML payload.
      Parameters:
      payload - the XML payload
      Returns:
      the request matcher
    • payload

      public static RequestMatcher payload(org.springframework.core.io.Resource payload) throws IOException
      Expects the given Resource XML payload.
      Parameters:
      payload - the XML payload
      Returns:
      the request matcher
      Throws:
      IOException
    • validPayload

      public static RequestMatcher validPayload(org.springframework.core.io.Resource schema, org.springframework.core.io.Resource... furtherSchemas) throws IOException
      Expects the payload to validate against the given XSD schema(s).
      Parameters:
      schema - the schema
      furtherSchemas - further schemas, if necessary
      Returns:
      the request matcher
      Throws:
      IOException
    • xpath

      public static RequestXPathExpectations xpath(String xpathExpression)
      Expects the given XPath expression to (not) exist or be evaluated to a value.
      Parameters:
      xpathExpression - the XPath expression
      Returns:
      the XPath expectations, to be further configured
    • xpath

      public static RequestXPathExpectations xpath(String xpathExpression, Map<String,String> namespaceMapping)
      Expects the given XPath expression to (not) exist or be evaluated to a value.
      Parameters:
      xpathExpression - the XPath expression
      namespaceMapping - the namespaces
      Returns:
      the XPath expectations, to be further configured
    • soapEnvelope

      public static RequestMatcher soapEnvelope(Source soapEnvelope)
      Expects the given Source XML SOAP envelope.
      Parameters:
      soapEnvelope - the XML SOAP envelope
      Returns:
      the request matcher
      Since:
      2.1.1
    • soapEnvelope

      public static RequestMatcher soapEnvelope(org.springframework.core.io.Resource soapEnvelope) throws IOException
      Expects the given Resource XML SOAP envelope.
      Parameters:
      soapEnvelope - the XML SOAP envelope
      Returns:
      the request matcher
      Throws:
      IOException
      Since:
      2.1.1
    • soapHeader

      public static RequestMatcher soapHeader(QName soapHeaderName)
      Expects the given SOAP header in the outgoing message.
      Parameters:
      soapHeaderName - the qualified name of the SOAP header to expect
      Returns:
      the request matcher
    • connectionTo

      public static RequestMatcher connectionTo(String uri)
      Expects a connection to the given URI.
      Parameters:
      uri - the String uri expected to connect to
      Returns:
      the request matcher
    • connectionTo

      public static RequestMatcher connectionTo(URI uri)
      Expects a connection to the given URI.
      Parameters:
      uri - the String uri expected to connect to
      Returns:
      the request matcher