Containers
General
Mandatory builder class calls
Certain container Builder classes have properties that if are unset, i.e. no Builder method is called to set that property, the container would not execute. This inspection can recognize such calls.
It can report both individual missing calls, and multiple calls if two or more are required to be missing to cause the container execution to fail.
The following are analyzed:
- Missing
when()
inConditional.Builder.conditional()
chains. - Missing
condition()
inWait.Builder.waitFor()
chains.
Conditional
Code folding as Java-style code
In order to lessen the cognitive load on parsing the conditional container logic, and to make the code blend in more as Java-like code, code folding is in place to collapse conditional().when().actions()
call chains in the Java and Groovy DSLs.
This code folding is disabled by default, and can be enabled in Settings
/ Editor
/ General
/ Code Folding
.
It is available:
- in
Conditional.Builder.conditional()
call chains in which there is both awhen()
and anactions()
call with arguments, - when the
when()
call precedesactions()
in the call chain, - when the call chain is an argument of a
$()
orrun()
call, as well as in other places like within other containers.
The folding happens as follows:
The list of actions are left unfolded for easier editing, without having to unfold the whole chain.
NOTE: when actions()
is multi-line, the folded code along with the indentation can look a bit weird.
Iterate
Code folding as Java-style code
In order to lessen the cognitive load on parsing the iterate container logic, and to make the code blend in more as Java-like code, code folding is in place to collapse iterate()...actions()
call chains, in the Java and Groovy DSLs.
This code folding is disabled by default, and can be enabled in Settings
/ Editor
/ General
/ Code Folding
.
It is available:
- in
Iterate.Builder.iterate()
call chains in which there is both acondition()
and anactions()
call with arguments, - when the call chain is an argument of a
$()
orrun()
call, as well as in other places like within other containers.
The folding happens as follows:
Incrementation
The incrementation part of the for-loop is assembled based on the index variable name and the step, and it uses the ++, –, += and -= operators according to the step value.
If the step value is 0, it shows the text <no increment>, while if the increment could not be assembled, for example because the step value comes from a method that cannot be evaluated compile-time, it shows <unresolved increment>.
Editing
The list of actions are left unfolded for easier editing, without having to unfold the whole chain.
NOTE: when actions()
is multi-line, the folded code along with the indentation can look a bit weird.
Sequence
Code folding as Java-style code
In order to lessen the cognitive load on parsing the sequence container logic, and to make the code blend in more as Java-like code, code folding is in place to collapse sequential()...actions()
call chains, in the Java and Groovy DSLs.
This code folding is disabled by default, and can be enabled in Settings
/ Editor
/ General
/ Code Folding
.
It is available:
- in
Sequence.Builder.sequential()
call chains in which there is anactions()
call with one or more arguments, - when the call chain is an argument of a
$()
orrun()
call, as well as in other places like within other containers.
The folding happens as follows:
Wait
Code completion for HTTP method values
To simplify the insertion of HTTP method values, they are provided at the following locations:
- Java and Groovy DSLs: the String argument of
WaitHttpConditionBuilder#method()
, - YAML DSL: the value of the
actions.waitFor.http.method
property, - XML DSL: the
method
attribute value of the<wait-for> / <http>
tag, - Spring XML DSL: the
method
attribute value of the<wait> / <http>
tag.
Customization of the list might be available in future releases.
Hamcrest condition expressions
Code folding
In order to lessen the cognitive load on parsing the Hamcrest condition expressions, and to make the code blend in more, code folding is in place to collapse HamcrestConditionExpression.assertThat()
calls, in the Java and Groovy DSLs.
This code folding is disabled by default, and can be enabled in Settings
/ Editor
/ General
/ Code Folding
.
The folding happens as follows: