Class ResponseMatchers

java.lang.Object
org.springframework.ws.test.server.ResponseMatchers

public abstract class ResponseMatchers extends Object
Factory methods for ResponseMatcher classes. Typically used to provide input for ResponseActions.andExpect(ResponseMatcher).
Since:
2.0
Author:
Arjen Poutsma
  • Method Details

    • payload

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

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

      public static ResponseMatcher 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 response matcher
      Throws:
      IOException
    • xpath

      public static ResponseXPathExpectations 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 ResponseXPathExpectations 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 ResponseMatcher soapEnvelope(Source soapEnvelope)
      Expects the given Source XML SOAP envelope.
      Parameters:
      soapEnvelope - the XML SOAP envelope
      Returns:
      the response matcher
      Since:
      2.1.1
    • soapEnvelope

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

      public static ResponseMatcher 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
    • noFault

      public static ResponseMatcher noFault()
      Expects the response not to contain a SOAP fault.
      Returns:
      the response matcher
    • mustUnderstandFault

      public static ResponseMatcher mustUnderstandFault()
      Expects a MustUnderstand fault.
      See Also:
    • mustUnderstandFault

      public static ResponseMatcher mustUnderstandFault(String faultStringOrReason)
      Expects a MustUnderstand fault with a particular fault string or reason.
      Parameters:
      faultStringOrReason - the SOAP 1.1 fault string or SOAP 1.2 reason text. If null the fault string or reason text will not be verified
      See Also:
    • clientOrSenderFault

      public static ResponseMatcher clientOrSenderFault()
      Expects a Client (SOAP 1.1) or Sender (SOAP 1.2) fault.
      See Also:
    • clientOrSenderFault

      public static ResponseMatcher clientOrSenderFault(String faultStringOrReason)
      Expects a Client (SOAP 1.1) or Sender (SOAP 1.2) fault with a particular fault string or reason.
      Parameters:
      faultStringOrReason - the SOAP 1.1 fault string or SOAP 1.2 reason text. If null the fault string or reason text will not be verified
      See Also:
    • serverOrReceiverFault

      public static ResponseMatcher serverOrReceiverFault()
      Expects a Server (SOAP 1.1) or Receiver (SOAP 1.2) fault.
      See Also:
    • serverOrReceiverFault

      public static ResponseMatcher serverOrReceiverFault(String faultStringOrReason)
      Expects a Server (SOAP 1.1) or Receiver (SOAP 1.2) fault with a particular fault string or reason.
      Parameters:
      faultStringOrReason - the SOAP 1.1 fault string or SOAP 1.2 reason text. If null the fault string or reason text will not be verified
      See Also:
    • versionMismatchFault

      public static ResponseMatcher versionMismatchFault()
      Expects a VersionMismatch fault.
      See Also:
    • versionMismatchFault

      public static ResponseMatcher versionMismatchFault(String faultStringOrReason)
      Expects a VersionMismatch fault with a particular fault string or reason.
      Parameters:
      faultStringOrReason - the SOAP 1.1 fault string or SOAP 1.2 reason text. If null the fault string or reason text will not be verified
      See Also: