When running mvn clean install -Dgpg.skip=true on a system with a german locale, many tests fail with:
java.lang.NumberFormatException: For input string: "18,58"
The number in the exception messages changes randomly as it is generated by javafaker. It seems like javafaker does not respect the locale when formatting prices, see: DiUS/java-faker#433.
Possible solutions:
- update javafaker to https://github.com/datafaker-net/datafaker (which fixes the underlying issue) - note that datafaker 2.x requires at least java 17
- explicitly set the locale in code for all tests that depend on
javafaker, like so: Locale.setDefault(Locale.ENGLISH);
- explicitly set the locale in surefire like so:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
<configuration>
<argLine>@{argLine} -Duser.language=en -Duser.country=EN</argLine>
</configuration>
</plugin>
When running
mvn clean install -Dgpg.skip=trueon a system with a german locale, many tests fail with:The number in the exception messages changes randomly as it is generated by
javafaker. It seems likejavafakerdoes not respect the locale when formatting prices, see: DiUS/java-faker#433.Possible solutions:
javafaker, like so:Locale.setDefault(Locale.ENGLISH);