Package org.citrusframework.actions
Class ReceiveMessageAction
java.lang.Object
org.citrusframework.actions.AbstractTestAction
org.citrusframework.actions.ReceiveMessageAction
- All Implemented Interfaces:
Described,Named,TestAction,TestActorAware
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classAction builder.static classReceiveMessageAction.ReceiveMessageActionBuilder<T extends ReceiveMessageAction,M extends ReceiveMessageBuilderSupport<T, B, M>, B extends ReceiveMessageAction.ReceiveMessageActionBuilder<T, M, B>> static class -
Field Summary
Fields inherited from class org.citrusframework.actions.AbstractTestAction
description -
Constructor Summary
ConstructorsConstructorDescriptionReceiveMessageAction(ReceiveMessageAction.ReceiveMessageActionBuilder<?, ?, ?> builder) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected MessagecreateControlMessage(TestContext context, String messageType) Create control message that is expected.voiddoExecute(TestContext context) Method receives a message viaEndpointinstance constructs a validation context and starts the message validation viaMessageValidator.Obtains the control message processors.Gets the data dictionary.Get the message endpoint.Gets the endpoint uri.Gets the messageBuilder.Obtains the message processors.Gets the messageSelector.Gets the messageSelectorMap.Gets the message type for this receive action.getOrCreateEndpoint(TestContext context) Creates or gets the endpoint instance.longGets the receiveTimeout.Gets the validationContexts.Gets the validationProcessor.List<MessageValidator<? extends ValidationContext>>Gets the validator.Gets the variable extractors.booleanisDisabled(TestContext context) Checks if this test action is disabled.protected voidvalidateMessage(Message message, TestContext context) Override this message if you want to add additional message validationMethods inherited from class org.citrusframework.actions.AbstractTestAction
execute, getActor, getDescription, getName, setActor, setDescription, setName
-
Constructor Details
-
ReceiveMessageAction
Default constructor.
-
-
Method Details
-
doExecute
Method receives a message viaEndpointinstance constructs a validation context and starts the message validation viaMessageValidator.- Specified by:
doExecutein classAbstractTestAction
-
validateMessage
Override this message if you want to add additional message validation- Parameters:
message-
-
createControlMessage
Create control message that is expected. Apply global and local message processors and data dictionaries.- Parameters:
context-messageType-- Returns:
-
isDisabled
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 interfaceTestAction- Overrides:
isDisabledin classAbstractTestAction- Parameters:
context- the current test context.
-
getOrCreateEndpoint
Creates or gets the endpoint instance.- Parameters:
context-- Returns:
-
getEndpoint
Get the message endpoint.- Returns:
- the message endpoint
-
getEndpointUri
Gets the endpoint uri.- Returns:
-
getVariableExtractors
Gets the variable extractors.- Returns:
- the variableExtractors
-
getMessageProcessors
Obtains the message processors.- Returns:
-
getControlMessageProcessors
Obtains the control message processors.- Returns:
-
getMessageType
Gets the message type for this receive action.- Returns:
- the messageType
-
getMessageSelectorMap
Gets the messageSelectorMap.- Returns:
- the messageSelectorMap
-
getMessageSelector
Gets the messageSelector.- Returns:
- the messageSelector
-
getReceiveTimeout
public long getReceiveTimeout()Gets the receiveTimeout.- Returns:
- the receiveTimeout
-
getValidators
Gets the validator.- Returns:
- the validator
-
getValidationContexts
Gets the validationContexts.- Returns:
- the validationContexts
-
getValidationProcessor
Gets the validationProcessor.- Returns:
- the validationProcessor to get.
-
getDataDictionary
Gets the data dictionary.- Returns:
-
getMessageBuilder
Gets the messageBuilder.- Returns:
- the messageBuilder
-