Hi,
We have our tests implemented in RestAssured, using nice and readable
convention of indentation for given/when/then parts.
given().
param("key1", "value1").
param("key2", "value2").
when().
post("/somewhere").
then().
body(containsString("OK"));
However, when I apply automatic formatting with template (Google code
style for Java) in Intellij IDEA, the formatting I had gets destroyed.
given().
param("key1", "value1").
param("key2", "value2").
when().
post("/somewhere").
then().
body(containsString("OK"));
Is there a way my IDE or maven formats RestAssured statements with
expected indentations, while the rest keeps with respect to the Google
template? Or at least, it doesn't destroy what I have set for
RestAssured statements?
What I found so far is to disable formatting for certain sections:
1. Surround the code fragment with
// @formatter:off
...
// @formatter:on
2. Preferences -> Code Style -> General -> Formatter Control -> Enable
formatter markers in comments
Thanks,
Maciej