Class SendMessageAction

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

public class SendMessageAction extends AbstractTestAction implements Completable
This action sends a messages to a specified message endpoint. The action holds a reference to a Endpoint, which is capable of the message transport implementation. So action is independent of the message transport configuration.
Since:
2008
  • Constructor Details

  • Method Details

    • doExecute

      public void doExecute(TestContext context)
      Message is constructed with payload and header entries and sent via Endpoint instance.
      Specified by:
      doExecute in class AbstractTestAction
    • validateMessage

      protected void validateMessage(Message message, TestContext context)
      Validate the message against registered schemas.
      Parameters:
      message -
    • isDisabled

      public boolean isDisabled(TestContext context)
      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.
    • isDone

      public boolean isDone(TestContext context)
      Specified by:
      isDone in interface Completable
    • createMessage

      protected Message createMessage(TestContext context, String messageType)
      Create message to be sent.
      Parameters:
      context -
      messageType -
      Returns:
    • getOrCreateEndpoint

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

      public Endpoint getEndpoint()
      Gets the message endpoint.
      Returns:
    • isSchemaValidation

      public boolean isSchemaValidation()
      Get
      Returns:
      true if schema validation is active for this message
    • getSchemaRepository

      public String getSchemaRepository()
      Get the name of the schema repository used for validation
      Returns:
      the schema repository name
    • getSchema

      public String getSchema()
      Get the name of the schema used for validation
      Returns:
      the schema
    • getVariableExtractors

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

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

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

      public boolean isForkMode()
      Gets the forkMode.
      Returns:
      the forkMode the forkMode to get.
    • getMessageType

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

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

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