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
-
Method Summary
Modifier and TypeMethodDescriptionstatic ResponseMatcherExpects aClient(SOAP 1.1) orSender(SOAP 1.2) fault.static ResponseMatcherclientOrSenderFault(String faultStringOrReason) Expects aClient(SOAP 1.1) orSender(SOAP 1.2) fault with a particular fault string or reason.static ResponseMatcherExpects aMustUnderstandfault.static ResponseMatchermustUnderstandFault(String faultStringOrReason) Expects aMustUnderstandfault with a particular fault string or reason.static ResponseMatchernoFault()Expects the response not to contain a SOAP fault.static ResponseMatcherExpects the givenSourceXML payload.static ResponseMatcherpayload(org.springframework.core.io.Resource payload) Expects the givenResourceXML payload.static ResponseMatcherExpects aServer(SOAP 1.1) orReceiver(SOAP 1.2) fault.static ResponseMatcherserverOrReceiverFault(String faultStringOrReason) Expects aServer(SOAP 1.1) orReceiver(SOAP 1.2) fault with a particular fault string or reason.static ResponseMatchersoapEnvelope(Source soapEnvelope) Expects the givenSourceXML SOAP envelope.static ResponseMatchersoapEnvelope(org.springframework.core.io.Resource soapEnvelope) Expects the givenResourceXML SOAP envelope.static ResponseMatchersoapHeader(QName soapHeaderName) Expects the given SOAP header in the outgoing message.static ResponseMatchervalidPayload(org.springframework.core.io.Resource schema, org.springframework.core.io.Resource... furtherSchemas) Expects the payload to validate against the given XSD schema(s).static ResponseMatcherExpects aVersionMismatchfault.static ResponseMatcherversionMismatchFault(String faultStringOrReason) Expects aVersionMismatchfault with a particular fault string or reason.static ResponseXPathExpectationsExpects the given XPath expression to (not) exist or be evaluated to a value.static ResponseXPathExpectationsExpects the given XPath expression to (not) exist or be evaluated to a value.
-
Method Details
-
payload
Expects the givenSourceXML 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 givenResourceXML 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 givenSourceXML 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 givenResourceXML 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 aMustUnderstandfault. -
mustUnderstandFault
Expects aMustUnderstandfault with a particular fault string or reason.- Parameters:
faultStringOrReason- the SOAP 1.1 fault string or SOAP 1.2 reason text. Ifnullthe 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. Ifnullthe 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. Ifnullthe fault string or reason text will not be verified- See Also:
-
versionMismatchFault
Expects aVersionMismatchfault. -
versionMismatchFault
Expects aVersionMismatchfault with a particular fault string or reason.- Parameters:
faultStringOrReason- the SOAP 1.1 fault string or SOAP 1.2 reason text. Ifnullthe fault string or reason text will not be verified- See Also:
-