public abstract class FlatInteraction extends Object
If data is stored in this interaction, the values from maps and lists are stored recursively too. The following examples illustrate this: - remember("key", "value") = ["key", "value"] - remember("key.key", "value") = ["key.key", "value"] - remember("key", ["key": "value"]) = ["key": ["key": "value"], "key.key", "value"] - remember("key", [["key": "value"]] = ["key": ["value"], "key[0].key", "value"] Further examples can be found in @see FlatInteractionSpec.
The advantage of this approach is the safe and fast availability of the test data, but be careful when saving large and deep maps.
Copyright (c) 2018 Daniel Keiss, Deutsche Telekom AG This file is distributed under the conditions of the Apache License, Version 2.0. For details see the file license on the toplevel.
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Object> |
context |
static String |
OBJECT_KEY_SEPARATOR |
| Constructor and Description |
|---|
FlatInteraction() |
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
getContext() |
void |
logAllPossibleKeysWithType()
Be careful with this method.
|
void |
logAllPossibleKeysWithValue()
Be careful with this method.
|
default <S> S |
recall(Enum key)
Get some data in the interaction context.
|
default <S> S |
recall(String key)
Get some data in the interaction context.
|
default <S> List<S> |
recallList(Enum key) |
default <S> List<S> |
recallList(String key) |
default <S> Map<String,S> |
recallMap(Enum key) |
default <S> Map<String,S> |
recallMap(String key) |
default <S> S |
recallNotNull(Enum key) |
default <S> S |
recallNotNull(String key) |
default <S> S |
recallObject(Enum objectKey,
String attributeKey) |
default <S> S |
recallObject(String objectKey,
String attributeKey) |
default <S> S |
recallObjectNotNull(Enum objectKey,
String attributeKey) |
default <S> S |
recallObjectNotNull(String objectKey,
String attributeKey) |
default void |
remember(Enum key,
Object value)
Store some data in the interaction context for later use.
|
void |
remember(String key,
Object value)
Store some test data in the interaction context for later use.
|
default void |
rememberObject(Enum entityKey,
String objectKey,
Object value) |
default void |
rememberObject(String entityKey,
Map<String,Object> object) |
default void |
rememberObject(String entityKey,
String objectKey,
Object value) |
default <S> void |
rememberToList(Enum key,
S value) |
default <S> void |
rememberToList(String key,
S value) |
void |
startInteraction() |
void |
stopInteraction() |
public static final String OBJECT_KEY_SEPARATOR
public void startInteraction()
public void stopInteraction()
public void remember(String key, Object value)
public void logAllPossibleKeysWithType()
public void logAllPossibleKeysWithValue()
public void remember(Enum key, Object value)
public <S> S recall(String key)
public <S> S recall(Enum key)
public <S> S recallNotNull(String key)
public <S> S recallNotNull(Enum key)
public <S> void rememberToList(String key, S value)
public <S> void rememberToList(Enum key, S value)
Copyright © 2017–2019. All rights reserved.