Spring Integration

org.springframework.integration.test.support
Class AbstractResponseValidator<T>

java.lang.Object
  extended by org.springframework.integration.test.support.AbstractResponseValidator<T>
All Implemented Interfaces:
MessageHandler
Direct Known Subclasses:
MessageValidator, PayloadValidator

public abstract class AbstractResponseValidator<T>
extends java.lang.Object
implements MessageHandler

The base class for response validators used for RequestResponseScenarios

Author:
David Turanski

Constructor Summary
AbstractResponseValidator()
           
 
Method Summary
protected abstract  boolean extractPayload()
          If true will extract the payload as the parameter for validateResponse()
 Message<?> getLastMessage()
           
 void handleMessage(Message<?> message)
          handle the message
protected abstract  void validateResponse(T response)
          Implement this method to validate the response (Message or Payload)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractResponseValidator

public AbstractResponseValidator()
Method Detail

handleMessage

public void handleMessage(Message<?> message)
                   throws MessagingException
handle the message

Specified by:
handleMessage in interface MessageHandler
Parameters:
message - the message to be handled
Throws:
MessageRejectedException - if the handler doesn't accept the message
MessageHandlingException - when something fails during the handling
MessageDeliveryException - when this handler failed to deliver the reply related to the handling of the message
MessagingException

validateResponse

protected abstract void validateResponse(T response)
Implement this method to validate the response (Message or Payload)

Parameters:
response -

extractPayload

protected abstract boolean extractPayload()
If true will extract the payload as the parameter for validateResponse()

Returns:
true to extract the payload; false to process the message.

getLastMessage

public Message<?> getLastMessage()
Returns:
the lastMessage

Spring Integration