-
Bug
-
Resolution: Unresolved
-
Minor
-
None
When developing a step which can both have a body or doesn't (eg a meta step of sorts), it is impossible to define a correct descriptor:
When defining with takesImplicitBlockArgument() = false, you obviously can't accept a body, but when defining with takesImplicitBlockArgument() = true, you get:
java.lang.IllegalStateException: stepName step must be called with a body
Yet, the documentation states:
Return true if this step can accept an implicit block argument. (If it can, but it is called without a block, StepContext.hasBody() will be false.)
Eg per documentation the implicit block argument is NOT mandatory when defined as true. Yet it is still required by the code.
Running the step with an empty body as:
stepName {}
is kinda a workaround for such a case, but kinda clunky.