Class ScenarioInteraction
java.lang.Object
de.telekom.test.bddwebapp.interaction.FlatInteraction
de.telekom.test.bddwebapp.interaction.ScenarioInteraction
Holds context variables that are needed in the entire JBehave Scenario.
An Interaction is a spring bean which keeps ThreadLocal state information of a single specification execution available across different steps. The Interaction is setup and torn down before and after every specification execution.
After a first implementation of scenario interaction by Sven Schomaker, working for Deutsche Telekom AG in 2013.
- Author:
- Daniel Keiss <daniel.keiss@telekom.de>
Copyright (c) 2023 Daniel Keiss, Deutsche Telekom IT GmbH This file is distributed under the conditions of the Apache License, Version 2.0. For details see the file license on the toplevel.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class de.telekom.test.bddwebapp.interaction.FlatInteraction
context, LIST_ITEM_FORMAT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondefault voiddefault voidmapBody()default <S> SGet some data in the interaction context.default <S> List<S>recallList(Enum key) default <S> List<S>recallList(String key) default <S> List<S>default <S> List<S>recallMapOrCreateNew(Enum key) default <S> SrecallNotNull(Enum key) default <S> SrecallNotNull(String key) default <S> SrecallObject(Enum objectKey, String attributeKey) default <S> SrecallObject(String objectKey, String attributeKey) default <S> SrecallObjectNotNull(Enum objectKey, String attributeKey) default <S> SrecallObjectNotNull(String objectKey, String attributeKey) default voidStore some data in the interaction context for later use.voidStore some data from story interaction to the scenario interaction contextdefault voidrememberObject(Enum entityKey, String objectKey, Object value) default voidrememberObject(Enum entityKey, Map<String, Object> object) default voidrememberObject(String entityKey, String objectKey, Object value) default voidrememberObject(String entityKey, Map<String, Object> object) voidrememberObjectFromStoryInteraction(String entityKey, String objectKey) Store an object from story interaction for an specific entity in the scenario interaction context.default <S> voidrememberToList(Enum key, S value) default <S> voidrememberToList(String key, S value) voidsetStoryInteraction(StoryInteraction storyInteraction) voidMethods inherited from class de.telekom.test.bddwebapp.interaction.FlatInteraction
getContext, logAllPossibleKeysWithType, logAllPossibleKeysWithValue, recall, recallByHierarchy, remember, stopInteraction
-
Field Details
-
BODY
- See Also:
-
PATH_PARAMS
- See Also:
-
QUERY_PARAMS
- See Also:
-
OBJECT_KEY_SEPARATOR
- See Also:
-
-
Constructor Details
-
ScenarioInteraction
public ScenarioInteraction()
-
-
Method Details
-
startInteraction
public void startInteraction()- Overrides:
startInteractionin classFlatInteraction
-
arrayBody
-
mapBody
-
mapPathParam
-
mapQueryParam
-
rememberFromStoryInteraction
Store some data from story interaction to the scenario interaction context -
rememberObjectFromStoryInteraction
Store an object from story interaction for an specific entity in the scenario interaction context. Recall this object with recallObject(). -
setStoryInteraction
-
remember
Store some data in the interaction context for later use. Use enum as key. -
recall
Get some data in the interaction context. Use enum as key. -
recallNotNull
-
recallNotNull
-
rememberObject
-
rememberObject
-
rememberObject
-
rememberObject
-
recallObject
-
recallObjectNotNull
-
recallObject
-
recallObjectNotNull
-
recallMap
-
recallMap
-
recallMapOrCreateNew
-
recallMapOrCreateNew
-
rememberToList
-
rememberToList
-
recallList
-
recallList
-
recallListOrCreateNew
-
recallListOrCreateNew
-
clear
-
clear
-