Test Actions
General
NOTES: action specific language injections can be found in the language injections document.
Mandatory builder class calls
Certain action Builder classes have properties that if are unset, i.e. no Builder method is called to set that property, the action 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 action execution to fail.
The following are analyzed:
- Missing
message()
inEchoAction.Builder.echo()/print()
chains. - Missing
filePath()
inLoadPropertiesAction.Builder.load()
chains. - Missing
endpoint()
inReceiveTimeoutAction.Builder.expectTimeout()
chains. - Missing
when()
inConditional.Builder.conditional()
chains. - Missing
condition()
inWait.Builder.waitFor()
chains. - Missing pair of
source()
andsourceFile()
, or missing pair ofxslt()
andxsltFile()
inTransformAction.Builder.transform()
chains.
Java and Groovy DSLs are supported.
InputAction
InputAction.Builder#answers
with no answer specified
The InputAction.Builder#answers()
method requires at least one argument to be specified, otherwise it throws an exception. Thus, this inspection reports such calls.
Java and Groovy DSLs are supported.
JavaAction
Class references for java(String)
and className(String)
To make the navigation to specified classes easier, fully qualified classnames in java(String)
and className(String)
have class references attached, so that Ctrl+click and similar actions can be used on them.
Java and Groovy DSLs are supported.
Assert
Throwable class reference for exception(String)
The
- method
Action.Builder#exception(String)
in Java and Groovy test files, - and the
actions.assert.exception
property value in YAML test files
accept fully qualified names of java.lang.Throwable
implementations.
In order to make the work with these String arguments simpler, a reference is attached to them, so that it is easier to navigate to the referenced class when needed, with Ctrl+click.
Exception validation
These inspections report if the fully qualified name specified is not an implementation of java.lang.Throwable
in:
- Java and Groovy DSLs:
Assert.Builder.exception(String)
- YAML DSL:
actions.assert.exception
property value - XML and Spring XML DSLs:
<assert exception="...">
attribute value