Package org.citrusframework.actions
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classAction builder.static classSendMessageAction.SendMessageActionBuilder<T extends SendMessageAction,M extends SendMessageBuilderSupport<T, B, M>, B extends SendMessageAction.SendMessageActionBuilder<T, M, B>> Base send message action builder also used by subclasses of base send message action.static class -
Field Summary
Fields inherited from class org.citrusframework.actions.AbstractTestAction
description -
Constructor Summary
ConstructorsConstructorDescriptionSendMessageAction(SendMessageAction.SendMessageActionBuilder<?, ?, ?> builder) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.citrusframework.message.MessagecreateMessage(org.citrusframework.context.TestContext context, String messageType) Creates the message to be sent.voiddoExecute(org.citrusframework.context.TestContext context) Message is constructed with payload and header entries and sent viaEndpointinstance.org.citrusframework.variable.dictionary.DataDictionary<?>Gets the data dictionary.org.citrusframework.endpoint.EndpointGets the message endpoint.Gets the endpoint uri.Optional<org.citrusframework.message.Message>Get message sent by this test action.org.citrusframework.message.MessageBuilderGets the messageBuilder.List<org.citrusframework.message.MessageProcessor>Obtains the message processors.Gets the message type for this receive action.org.citrusframework.endpoint.EndpointgetOrCreateEndpoint(org.citrusframework.context.TestContext context) Creates or gets the message endpoint instance.Get the name of the schema used for validationGet the name of the schema repository used for validationList<org.citrusframework.variable.VariableExtractor>Get the variable extractors.booleanisDisabled(org.citrusframework.context.TestContext context) Checks if this test action is disabled.booleanisDone(org.citrusframework.context.TestContext context) booleanGets the forkMode.booleanGet the schema validation setting.protected voidvalidateMessage(org.citrusframework.message.Message message, org.citrusframework.context.TestContext context) Validate the message against registered schema validators.Methods inherited from class org.citrusframework.actions.AbstractTestAction
execute, getActor, getDescription, getName, setActor, setDescription, setName
-
Constructor Details
-
SendMessageAction
Default constructor.
-
-
Method Details
-
doExecute
public void doExecute(org.citrusframework.context.TestContext context) Message is constructed with payload and header entries and sent viaEndpointinstance.- Specified by:
doExecutein classAbstractTestAction
-
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:AbstractTestActionChecks 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:
isDisabledin interfaceorg.citrusframework.TestAction- Overrides:
isDisabledin classAbstractTestAction- Parameters:
context- the current test context.
-
isDone
public boolean isDone(org.citrusframework.context.TestContext context) - Specified by:
isDonein interfaceorg.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
Get message sent by this test action. Reads message from message store with saved message id.- Specified by:
getMessagein interfaceorg.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
Get the name of the schema repository used for validation- Returns:
- the schema repository name
-
getSchema
Get the name of the schema used for validation- Returns:
- the schema
-
getVariableExtractors
Get the variable extractors.- Returns:
- the variableExtractors
-
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
Gets the message type for this receive action.- Returns:
- the messageType
-
getDataDictionary
public org.citrusframework.variable.dictionary.DataDictionary<?> getDataDictionary()Gets the data dictionary. -
getEndpointUri
Gets the endpoint uri.
-