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 @Test
public void conversionServiceShouldAlwaysUseLocaleEnglish() { public void conversionServiceShouldAlwaysUseLocaleEnglish() {
Locale.setDefault(new Locale("tr")); Locale defaultLocale = Locale.getDefault();
TestEnum result = this.conversionService try {
.convert("accept-case-insensitive-properties", TestEnum.class); Locale.setDefault(new Locale("tr"));
assertThat(result.equals(TestEnum.ACCEPT_CASE_INSENSITIVE_PROPERTIES)); 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 { enum TestEnum {

Loading…
Cancel
Save