mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-26 00:39:01 +00:00
AcceptHeaderLocaleResolver keeps language match among supported locales
Issue: SPR-16599
This commit is contained in:
+12
@@ -63,6 +63,18 @@ public class AcceptHeaderLocaleResolverTests {
|
||||
assertEquals(ENGLISH, this.resolver.resolveLocale(request(GERMANY, US, UK)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void resolvePreferredAgainstCountryIfPossible() {
|
||||
this.resolver.setSupportedLocales(Arrays.asList(ENGLISH, UK));
|
||||
assertEquals(UK, this.resolver.resolveLocale(request(GERMANY, US, UK)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void resolvePreferredAgainstLanguageWithMultipleSupportedLocales() {
|
||||
this.resolver.setSupportedLocales(Arrays.asList(GERMAN, US));
|
||||
assertEquals(GERMAN, this.resolver.resolveLocale(request(GERMANY, US, UK)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void resolvePreferredNotSupportedWithDefault() {
|
||||
this.resolver.setSupportedLocales(Arrays.asList(US, JAPAN));
|
||||
|
||||
Reference in New Issue
Block a user