Class RequestMatchers
java.lang.Object
org.springframework.ws.test.client.RequestMatchers
Factory methods for
RequestMatcher classes. Typically used to provide input for
MockWebServiceServer.expect(RequestMatcher).- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic RequestMatcheranything()Expects any request.static RequestMatcherconnectionTo(String uri) Expects a connection to the given URI.static RequestMatcherconnectionTo(URI uri) Expects a connection to the given URI.static RequestMatcherExpects the givenSourceXML payload.static RequestMatcherpayload(org.springframework.core.io.Resource payload) Expects the givenResourceXML payload.static RequestMatchersoapEnvelope(Source soapEnvelope) Expects the givenSourceXML SOAP envelope.static RequestMatchersoapEnvelope(org.springframework.core.io.Resource soapEnvelope) Expects the givenResourceXML SOAP envelope.static RequestMatchersoapHeader(QName soapHeaderName) Expects the given SOAP header in the outgoing message.static RequestMatchervalidPayload(org.springframework.core.io.Resource schema, org.springframework.core.io.Resource... furtherSchemas) Expects the payload to validate against the given XSD schema(s).static RequestXPathExpectationsExpects the given XPath expression to (not) exist or be evaluated to a value.static RequestXPathExpectationsExpects the given XPath expression to (not) exist or be evaluated to a value.
-
Method Details
-
anything
Expects any request.- Returns:
- the request matcher
-
payload
Expects the givenSourceXML 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 givenResourceXML 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 schemafurtherSchemas- further schemas, if necessary- Returns:
- the request matcher
- Throws:
IOException
-
xpath
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 expressionnamespaceMapping- the namespaces- Returns:
- the XPath expectations, to be further configured
-
soapEnvelope
Expects the givenSourceXML 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 givenResourceXML SOAP envelope.- Parameters:
soapEnvelope- the XML SOAP envelope- Returns:
- the request matcher
- Throws:
IOException- Since:
- 2.1.1
-
soapHeader
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
Expects a connection to the given URI.- Parameters:
uri- the String uri expected to connect to- Returns:
- the request matcher
-
connectionTo
Expects a connection to the given URI.- Parameters:
uri- the String uri expected to connect to- Returns:
- the request matcher
-