keycloak-service
公開メンバ関数 | 非公開変数類 | 全メンバ一覧
org.keycloak.locale.LocaleNegotiatorTest クラス
org.keycloak.locale.LocaleNegotiatorTest 連携図
Collaboration graph

公開メンバ関数

void setUp ()
 
void shouldMatchWithoutCountryCode ()
 
void shouldMatchWithPriorityCountryCode ()
 
void shouldMatchWithPriorityNoCountryCode ()
 
void shouldMatchOmittedCountryCodeWithBestFit ()
 

非公開変数類

LocaleNegotiator localeNegotiator
 

詳解

関数詳解

◆ setUp()

void org.keycloak.locale.LocaleNegotiatorTest.setUp ( )
inline
16  {
17  Set<String> supportedLocales = new HashSet<>();
18  supportedLocales.add("de");
19  supportedLocales.add("de-AT");
20  supportedLocales.add("de-CH");
21  supportedLocales.add("de-DE");
22  supportedLocales.add("pt-BR");
23  localeNegotiator = new LocaleNegotiator(supportedLocales);
24  }
LocaleNegotiator localeNegotiator
Definition: LocaleNegotiatorTest.java:13

◆ shouldMatchOmittedCountryCodeWithBestFit()

void org.keycloak.locale.LocaleNegotiatorTest.shouldMatchOmittedCountryCodeWithBestFit ( )
inline
51  {
52  String expectedLocaleString = "pt";
53  LocaleSelection actualLocale = localeNegotiator.invoke(expectedLocaleString, "es-ES");
54  Assert.assertEquals(new Locale("pt", "BR"), actualLocale.getLocale());
55  Assert.assertEquals(expectedLocaleString, actualLocale.getLocaleString());
56  }
LocaleNegotiator localeNegotiator
Definition: LocaleNegotiatorTest.java:13
LocaleSelection invoke(String... localeStrings)
Definition: LocaleNegotiator.java:29

◆ shouldMatchWithoutCountryCode()

void org.keycloak.locale.LocaleNegotiatorTest.shouldMatchWithoutCountryCode ( )
inline
27  {
28  String expectedLocaleString = "de";
29  LocaleSelection actualLocale = localeNegotiator.invoke(expectedLocaleString);
30  Assert.assertEquals(Locale.GERMAN, actualLocale.getLocale());
31  Assert.assertEquals(expectedLocaleString, actualLocale.getLocaleString());
32  }
LocaleNegotiator localeNegotiator
Definition: LocaleNegotiatorTest.java:13
LocaleSelection invoke(String... localeStrings)
Definition: LocaleNegotiator.java:29

◆ shouldMatchWithPriorityCountryCode()

void org.keycloak.locale.LocaleNegotiatorTest.shouldMatchWithPriorityCountryCode ( )
inline
35  {
36  String expectedLocaleString = "de-CH";
37  LocaleSelection actualLocale = localeNegotiator.invoke(expectedLocaleString, "de");
38  Assert.assertEquals(new Locale("de", "CH"), actualLocale.getLocale());
39  Assert.assertEquals(expectedLocaleString, actualLocale.getLocaleString());
40  }
LocaleNegotiator localeNegotiator
Definition: LocaleNegotiatorTest.java:13
LocaleSelection invoke(String... localeStrings)
Definition: LocaleNegotiator.java:29

◆ shouldMatchWithPriorityNoCountryCode()

void org.keycloak.locale.LocaleNegotiatorTest.shouldMatchWithPriorityNoCountryCode ( )
inline
43  {
44  String expectedLocaleString = "de";
45  LocaleSelection actualLocale = localeNegotiator.invoke(expectedLocaleString, "de-CH");
46  Assert.assertEquals(new Locale(expectedLocaleString), actualLocale.getLocale());
47  Assert.assertEquals(expectedLocaleString, actualLocale.getLocaleString());
48  }
LocaleNegotiator localeNegotiator
Definition: LocaleNegotiatorTest.java:13
LocaleSelection invoke(String... localeStrings)
Definition: LocaleNegotiator.java:29

メンバ詳解

◆ localeNegotiator

LocaleNegotiator org.keycloak.locale.LocaleNegotiatorTest.localeNegotiator
private

このクラス詳解は次のファイルから抽出されました: