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
- Author:
- Arjen Poutsma
-
Method Summary
Modifier and TypeMethodDescriptionstatic RequestMatcher
anything()
Expects any request.static RequestMatcher
connectionTo
(String uri) Expects a connection to the given URI.static RequestMatcher
connectionTo
(URI uri) Expects a connection to the given URI.static RequestMatcher
Expects the givenSource
XML payload.static RequestMatcher
payload
(org.springframework.core.io.Resource payload) Expects the givenResource
XML payload.static RequestMatcher
soapEnvelope
(Source soapEnvelope) Expects the givenSource
XML SOAP envelope.static RequestMatcher
soapEnvelope
(org.springframework.core.io.Resource soapEnvelope) Expects the givenResource
XML SOAP envelope.static RequestMatcher
soapHeader
(QName soapHeaderName) Expects the given SOAP header in the outgoing message.static RequestMatcher
validPayload
(org.springframework.core.io.Resource schema, org.springframework.core.io.Resource... furtherSchemas) Expects the payload to validate against the given XSD schema(s).static RequestXPathExpectations
Expects the given XPath expression to (not) exist or be evaluated to a value.static RequestXPathExpectations
Expects 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 givenSource
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 givenResource
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 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 givenSource
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 givenResource
XML 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
-