Class StepContext
java.lang.Object
codes.grow.packages.skywalking.testing.StepContext
Everything an
OpHandler needs for one step.-
Method Summary
Modifier and TypeMethodDescriptionReturns a required string argument.com.fasterxml.jackson.databind.JsonNodeargs()Returns the arguments with${...}variables substituted (#{i}is kept).Optional<com.fasterxml.jackson.databind.JsonNode> Returns an optional argument.scenario()Returns the running scenario.step()Returns the current step.substitute(String text) Substitutes${name}variables in a string.target()Returns the scenario target.<T> TReturns the target cast to a type.Returns a variable (run,prefix,serviceNameor a saved name).
-
Method Details
-
scenario
Returns the running scenario.- Returns:
- the scenario
-
step
Returns the current step.- Returns:
- the step
-
args
public com.fasterxml.jackson.databind.JsonNode args()Returns the arguments with${...}variables substituted (#{i}is kept).- Returns:
- the arguments object
-
arg
Returns a required string argument.- Parameters:
name- argument name- Returns:
- the text value
- Throws:
IllegalArgumentException- when missing
-
optArg
Returns an optional argument.- Parameters:
name- argument name- Returns:
- the node, or empty
-
target
Returns the scenario target.- Returns:
- the object the target factory created
-
target
Returns the target cast to a type.- Type Parameters:
T- target type- Parameters:
type- expected class- Returns:
- the target
-
substitute
Substitutes${name}variables in a string.- Parameters:
text- text with placeholders- Returns:
- the substituted text
-
variable
Returns a variable (run,prefix,serviceNameor a saved name).- Parameters:
name- variable name- Returns:
- the value, or empty
-