Reset default local after test completes

pull/12120/merge
Phillip Webb 7 years ago
parent 8f9c067a92
commit 98f58caeaf

@ -36,10 +36,16 @@ public class RelaxedConversionServiceTests {
@Test
public void conversionServiceShouldAlwaysUseLocaleEnglish() {
Locale.setDefault(new Locale("tr"));
TestEnum result = this.conversionService
.convert("accept-case-insensitive-properties", TestEnum.class);
assertThat(result.equals(TestEnum.ACCEPT_CASE_INSENSITIVE_PROPERTIES));
Locale defaultLocale = Locale.getDefault();
try {
Locale.setDefault(new Locale("tr"));
TestEnum result = this.conversionService
.convert("accept-case-insensitive-properties", TestEnum.class);
assertThat(result.equals(TestEnum.ACCEPT_CASE_INSENSITIVE_PROPERTIES));
}
finally {
Locale.setDefault(defaultLocale);
}
}
enum TestEnum {

Loading…
Cancel
Save