Class ReceiveMessageAction

java.lang.Object
org.citrusframework.actions.AbstractTestAction
org.citrusframework.actions.ReceiveMessageAction
All Implemented Interfaces:
Described, Named, TestAction, TestActorAware

public class ReceiveMessageAction extends AbstractTestAction
This action receives messages from a service destination. Action uses a Endpoint to receive the message, this means that this action is independent of any message transport. The received message is validated using a MessageValidator supporting expected control message payload and header templates.
Since:
2008
Author:
Christoph Deppisch
  • Constructor Details

  • Method Details

    • doExecute

      public void doExecute(TestContext context)
      Method receives a message via Endpoint instance constructs a validation context and starts the message validation via MessageValidator.
      Specified by:
      doExecute in class AbstractTestAction
    • validateMessage

      protected void validateMessage(Message message, TestContext context)
      Override this message if you want to add additional message validation
      Parameters:
      message -
    • createControlMessage

      protected Message createControlMessage(TestContext context, String messageType)
      Create control message that is expected. Apply global and local message processors and data dictionaries.
      Parameters:
      context -
      messageType -
      Returns:
    • isDisabled

      public boolean isDisabled(TestContext context)
      Description copied from class: AbstractTestAction
      Checks if this test action is disabled. Delegates to test actor defined for this test action by default. Subclasses may add additional disabled logic here.
      Specified by:
      isDisabled in interface TestAction
      Overrides:
      isDisabled in class AbstractTestAction
      Parameters:
      context - the current test context.
    • getOrCreateEndpoint

      public Endpoint getOrCreateEndpoint(TestContext context)
      Creates or gets the endpoint instance.
      Parameters:
      context -
      Returns:
    • getEndpoint

      public Endpoint getEndpoint()
      Get the message endpoint.
      Returns:
      the message endpoint
    • getEndpointUri

      public String getEndpointUri()
      Gets the endpoint uri.
      Returns:
    • getVariableExtractors

      public List<VariableExtractor> getVariableExtractors()
      Gets the variable extractors.
      Returns:
      the variableExtractors
    • getMessageProcessors

      public List<MessageProcessor> getMessageProcessors()
      Obtains the message processors.
      Returns:
    • getControlMessageProcessors

      public List<MessageProcessor> getControlMessageProcessors()
      Obtains the control message processors.
      Returns:
    • getMessageType

      public String getMessageType()
      Gets the message type for this receive action.
      Returns:
      the messageType
    • getMessageSelectorMap

      public Map<String,Object> getMessageSelectorMap()
      Gets the messageSelectorMap.
      Returns:
      the messageSelectorMap
    • getMessageSelector

      public String getMessageSelector()
      Gets the messageSelector.
      Returns:
      the messageSelector
    • getReceiveTimeout

      public long getReceiveTimeout()
      Gets the receiveTimeout.
      Returns:
      the receiveTimeout
    • getValidators

      public List<MessageValidator<? extends ValidationContext>> getValidators()
      Gets the validator.
      Returns:
      the validator
    • getValidationContexts

      public List<ValidationContext> getValidationContexts()
      Gets the validationContexts.
      Returns:
      the validationContexts
    • getValidationProcessor

      public ValidationProcessor getValidationProcessor()
      Gets the validationProcessor.
      Returns:
      the validationProcessor to get.
    • getDataDictionary

      public DataDictionary<?> getDataDictionary()
      Gets the data dictionary.
      Returns:
    • getMessageBuilder

      public MessageBuilder getMessageBuilder()
      Gets the messageBuilder.
      Returns:
      the messageBuilder