Package org.citrusframework.variable
Interface VariableExtractor
- All Superinterfaces:
MessageProcessor,MessageTransformer
Class extracting variables form messages. Implementing classes may read
message contents and save those to test variables.
- Author:
- Christoph Deppisch
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceVariableExtractor.Builder<T extends VariableExtractor,B extends VariableExtractor.Builder<T, B>> Fluent builder -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.slf4j.LoggerLoggerstatic final StringVariable extractor resource lookup pathstatic final TypeResolverType resolver to find custom variable extractors on classpath via resource path lookup -
Method Summary
Modifier and TypeMethodDescriptionvoidextractVariables(Message message, TestContext context) Extract variables from given message.static <T extends VariableExtractor,B extends VariableExtractor.Builder<T, B>>
Optional<VariableExtractor.Builder<T,B>> Resolves extractor from resource path lookup with given extractor resource name.default voidprocess(Message message, TestContext context) Process message with given test context.Methods inherited from interface org.citrusframework.message.MessageProcessor
transform
-
Field Details
-
logger
static final org.slf4j.Logger loggerLogger -
RESOURCE_PATH
Variable extractor resource lookup path- See Also:
-
TYPE_RESOLVER
Type resolver to find custom variable extractors on classpath via resource path lookup
-
-
Method Details
-
lookup
static <T extends VariableExtractor,B extends VariableExtractor.Builder<T, Optional<VariableExtractor.Builder<T,B>> B>> lookup(String extractor) Resolves extractor from resource path lookup with given extractor resource name. Scans classpath for extractor meta information with given name and returns instance of extractor. Returns optional instead of throwing exception when no extractor could be found.- Parameters:
extractor-- Returns:
-
process
Description copied from interface:MessageProcessorProcess message with given test context. Processors can change the message payload and headers.- Specified by:
processin interfaceMessageProcessor- Parameters:
message- the message to process.context- the current test context.
-
extractVariables
Extract variables from given message.- Parameters:
message-context-
-