mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#883 Simplifying look-up of test locale
This commit is contained in:
parent
614f0ea4ee
commit
aae1527352
@ -157,13 +157,12 @@ public class StringsTest {
|
||||
}
|
||||
|
||||
private static Locale getTurkeyLocale() {
|
||||
Locale[] availableLocales = Locale.getAvailableLocales();
|
||||
for ( Locale locale : availableLocales ) {
|
||||
if ( locale.getLanguage().equals( "tr" ) ) {
|
||||
return locale;
|
||||
}
|
||||
}
|
||||
throw new IllegalStateException( "Can't find Turkey locale." );
|
||||
}
|
||||
Locale turkeyLocale = Locale.forLanguageTag( "tr" );
|
||||
|
||||
if ( turkeyLocale == null ) {
|
||||
throw new IllegalStateException( "Can't find Turkey locale." );
|
||||
}
|
||||
|
||||
return turkeyLocale;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user