keycloak-service
公開メンバ関数 | 全メンバ一覧
org.keycloak.theme.beans.MessageFormatterMethodTest クラス
org.keycloak.theme.beans.MessageFormatterMethodTest 連携図
Collaboration graph

公開メンバ関数

void test () throws TemplateModelException
 

詳解

著者
Marko Strukelj

関数詳解

◆ test()

void org.keycloak.theme.beans.MessageFormatterMethodTest.test ( ) throws TemplateModelException
inline
34  {
35 
36  Locale locale = Locale.US;
37 
38  Properties properties = new Properties();
39  properties.setProperty("backToApplication", "Back to application");
40  properties.setProperty("backToClient", "Back to {0}");
41  properties.setProperty("client_admin-console", "Admin Console");
42  properties.setProperty("realm_example-realm", "Example Realm");
43 
44 
45  MessageFormatterMethod fmt = new MessageFormatterMethod(locale, properties);
46 
47  String msg = (String) fmt.exec(Arrays.asList("backToClient", "${client_admin-console}"));
48  Assert.assertEquals("Back to Admin Console", msg);
49 
50  msg = (String) fmt.exec(Arrays.asList("backToClient", "client_admin-console"));
51  Assert.assertEquals("Back to client_admin-console", msg);
52 
53  msg = (String) fmt.exec(Arrays.asList("backToClient", "client '${client_admin-console}' from '${realm_example-realm}'."));
54  Assert.assertEquals("Back to client 'Admin Console' from 'Example Realm'.", msg);
55  }

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