Skip to content

Commit

Permalink
Clarify that you can use default values
Browse files Browse the repository at this point in the history
I had to look into this myself, so once I figured it out, I'd save others the trouble.
  • Loading branch information
TurekBot authored Aug 20, 2024
1 parent ebd4e92 commit aafb9d0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/reporting/reports-custom-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ We can set this value from the command line as shown here:
mvn serenity:aggregate -DHOST=$HOST -Denvironment=INT5
```

#### Using default values
If an environment variable doesn't exist, you can have specify a fallback value.

```
report.customfields.user = ${USER:-Unknown}
report.customfields.host = ${HOST:-} # Blank instead of the literal characters "${HOST}"
```
The mechanism behind the substitution: [Apache Commons `StringSubstitutor`](https://commons.apache.org/proper/commons-text/apidocs/org/apache/commons/text/StringSubstitutor.html)

### Ordering the custom properties

By default, the fields will appear in an arbitrary order. You can force the fields to appear in a pre-determined order using the `report.customfields.order` field:
Expand Down

0 comments on commit aafb9d0

Please sign in to comment.