Class SendMessageAction

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

public class SendMessageAction extends AbstractTestAction implements org.citrusframework.Completable, org.citrusframework.message.MessageAwareTestAction
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(org.citrusframework.context.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(org.citrusframework.message.Message message, org.citrusframework.context.TestContext context)
      Validate the message against registered schema validators.
    • isDisabled

      public boolean isDisabled(org.citrusframework.context.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 org.citrusframework.TestAction
      Overrides:
      isDisabled in class AbstractTestAction
      Parameters:
      context - the current test context.
    • isDone

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

      protected org.citrusframework.message.Message createMessage(org.citrusframework.context.TestContext context, String messageType)
      Creates the message to be sent.
    • getOrCreateEndpoint

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

      public Optional<org.citrusframework.message.Message> getMessage()
      Get message sent by this test action. Reads message from message store with saved message id.
      Specified by:
      getMessage in interface org.citrusframework.message.MessageAwareTestAction
    • getEndpoint

      public org.citrusframework.endpoint.Endpoint getEndpoint()
      Gets the message endpoint.
    • isSchemaValidation

      public boolean isSchemaValidation()
      Get the schema validation setting.
      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<org.citrusframework.variable.VariableExtractor> getVariableExtractors()
      Get the variable extractors.
      Returns:
      the variableExtractors
    • getMessageProcessors

      public List<org.citrusframework.message.MessageProcessor> getMessageProcessors()
      Obtains the message processors.
    • getMessageBuilder

      public org.citrusframework.message.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 org.citrusframework.variable.dictionary.DataDictionary<?> getDataDictionary()
      Gets the data dictionary.
    • getEndpointUri

      public String getEndpointUri()
      Gets the endpoint uri.