Spring Web Services Framework

org.springframework.ws.test.client
Class RequestMatchers

java.lang.Object
  extended by org.springframework.ws.test.client.RequestMatchers

public abstract class RequestMatchers
extends Object

Factory methods for RequestMatcher classes. Typically used to provide input for MockWebServiceServer.expect(RequestMatcher).

Since:
2.0
Author:
Arjen Poutsma

Method Summary
static 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 payload(Resource payload)
          Expects the given Resource XML payload.
static RequestMatcher payload(Source payload)
          Expects the given Source XML payload.
static RequestMatcher soapEnvelope(Resource soapEnvelope)
          Expects the given Resource XML SOAP envelope.
static RequestMatcher soapEnvelope(Source soapEnvelope)
          Expects the given Source XML SOAP envelope.
static RequestMatcher soapHeader(QName soapHeaderName)
          Expects the given SOAP header in the outgoing message.
static RequestMatcher validPayload(Resource schema, Resource... furtherSchemas)
          Expects the payload to validate against the given XSD schema(s).
static RequestXPathExpectations xpath(String xpathExpression)
          Expects the given XPath expression to (not) exist or be evaluated to a value.
static RequestXPathExpectations xpath(String xpathExpression, Map<String,String> namespaceMapping)
          Expects the given XPath expression to (not) exist or be evaluated to a value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

anything

public static RequestMatcher anything()
Expects any request.

Returns:
the request matcher

payload

public static RequestMatcher payload(Source payload)
Expects the given Source XML payload.

Parameters:
payload - the XML payload
Returns:
the request matcher

payload

public static RequestMatcher payload(Resource payload)
                              throws IOException
Expects the given Resource XML payload.

Parameters:
payload - the XML payload
Returns:
the request matcher
Throws:
IOException

validPayload

public static RequestMatcher validPayload(Resource schema,
                                          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 request matcher
Throws:
IOException

xpath

public static RequestXPathExpectations 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 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 expression
namespaceMapping - the namespaces
Returns:
the XPath expectations, to be further configured

soapEnvelope

public static RequestMatcher soapEnvelope(Source soapEnvelope)
Expects the given Source XML SOAP envelope.

Parameters:
soapEnvelope - the XML SOAP envelope
Returns:
the request matcher
Since:
2.1.1

soapEnvelope

public static RequestMatcher soapEnvelope(Resource soapEnvelope)
                                   throws IOException
Expects the given Resource XML SOAP envelope.

Parameters:
soapEnvelope - the XML SOAP envelope
Returns:
the request matcher
Throws:
IOException
Since:
2.1.1

soapHeader

public static RequestMatcher 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

connectionTo

public static RequestMatcher connectionTo(String uri)
Expects a connection to the given URI.

Parameters:
uri - the String uri expected to connect to
Returns:
the request matcher

connectionTo

public static RequestMatcher connectionTo(URI uri)
Expects a connection to the given URI.

Parameters:
uri - the String uri expected to connect to
Returns:
the request matcher

Spring Web Services Framework

Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.