Class ResponseMatchers
java.lang.Object
org.springframework.ws.test.server.ResponseMatchers
Factory methods for
ResponseMatcher
classes. Typically used to provide input for
ResponseActions.andExpect(ResponseMatcher)
.- Since:
- 2.0
- Author:
- Arjen Poutsma
-
Method Summary
Modifier and TypeMethodDescriptionstatic ResponseMatcher
Expects aClient
(SOAP 1.1) orSender
(SOAP 1.2) fault.static ResponseMatcher
clientOrSenderFault
(String faultStringOrReason) Expects aClient
(SOAP 1.1) orSender
(SOAP 1.2) fault with a particular fault string or reason.static ResponseMatcher
Expects aMustUnderstand
fault.static ResponseMatcher
mustUnderstandFault
(String faultStringOrReason) Expects aMustUnderstand
fault with a particular fault string or reason.static ResponseMatcher
noFault()
Expects the response not to contain a SOAP fault.static ResponseMatcher
Expects the givenSource
XML payload.static ResponseMatcher
payload
(org.springframework.core.io.Resource payload) Expects the givenResource
XML payload.static ResponseMatcher
Expects aServer
(SOAP 1.1) orReceiver
(SOAP 1.2) fault.static ResponseMatcher
serverOrReceiverFault
(String faultStringOrReason) Expects aServer
(SOAP 1.1) orReceiver
(SOAP 1.2) fault with a particular fault string or reason.static ResponseMatcher
soapEnvelope
(Source soapEnvelope) Expects the givenSource
XML SOAP envelope.static ResponseMatcher
soapEnvelope
(org.springframework.core.io.Resource soapEnvelope) Expects the givenResource
XML SOAP envelope.static ResponseMatcher
soapHeader
(QName soapHeaderName) Expects the given SOAP header in the outgoing message.static ResponseMatcher
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 ResponseMatcher
Expects aVersionMismatch
fault.static ResponseMatcher
versionMismatchFault
(String faultStringOrReason) Expects aVersionMismatch
fault with a particular fault string or reason.static ResponseXPathExpectations
Expects the given XPath expression to (not) exist or be evaluated to a value.static ResponseXPathExpectations
Expects the given XPath expression to (not) exist or be evaluated to a value.
-
Method Details
-
payload
Expects the givenSource
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 givenResource
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 schemafurtherSchemas
- further schemas, if necessary- Returns:
- the response 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 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 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 response matcher
- Since:
- 2.1.1
-
soapEnvelope
public static ResponseMatcher soapEnvelope(org.springframework.core.io.Resource soapEnvelope) throws IOException Expects the givenResource
XML SOAP envelope.- Parameters:
soapEnvelope
- the XML SOAP envelope- Returns:
- the response 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
-
noFault
Expects the response not to contain a SOAP fault.- Returns:
- the response matcher
-
mustUnderstandFault
Expects aMustUnderstand
fault. -
mustUnderstandFault
Expects aMustUnderstand
fault with a particular fault string or reason.- Parameters:
faultStringOrReason
- the SOAP 1.1 fault string or SOAP 1.2 reason text. Ifnull
the fault string or reason text will not be verified- See Also:
-
clientOrSenderFault
Expects aClient
(SOAP 1.1) orSender
(SOAP 1.2) fault. -
clientOrSenderFault
Expects aClient
(SOAP 1.1) orSender
(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. Ifnull
the fault string or reason text will not be verified- See Also:
-
serverOrReceiverFault
Expects aServer
(SOAP 1.1) orReceiver
(SOAP 1.2) fault. -
serverOrReceiverFault
Expects aServer
(SOAP 1.1) orReceiver
(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. Ifnull
the fault string or reason text will not be verified- See Also:
-
versionMismatchFault
Expects aVersionMismatch
fault. -
versionMismatchFault
Expects aVersionMismatch
fault with a particular fault string or reason.- Parameters:
faultStringOrReason
- the SOAP 1.1 fault string or SOAP 1.2 reason text. Ifnull
the fault string or reason text will not be verified- See Also:
-