always run tests with locale en_US, no matter of system settings

This commit is contained in:
Michael Hoennig 2022-10-25 13:08:17 +02:00
parent e5ec867819
commit d7eed08420
2 changed files with 20 additions and 1 deletions

View File

@ -98,9 +98,11 @@ tasks.withType(JavaCompile) {
] ]
} }
// Use JUnit Jupiter // Configure tests
tasks.named('test') { tasks.named('test') {
useJUnitPlatform() useJUnitPlatform()
jvmArgs '-Duser.language=en'
jvmArgs '-Duser.country=US'
} }
// OpenAPI Source Code Generation // OpenAPI Source Code Generation

View File

@ -0,0 +1,17 @@
package net.hostsharing.test;
import org.junit.jupiter.api.Test;
import java.math.BigDecimal;
import java.util.Locale;
import static org.assertj.core.api.Assertions.assertThat;
public class LocaleUnitTest {
@Test
void testsAreUsingEnUsUtf8Locale() {
assertThat(Locale.getDefault()).isEqualTo(new Locale("en", "US"));
assertThat(new BigDecimal("64.00").toString()).isEqualTo("64.00");
}
}