I18nUtil { public static String getMessage(String key) { return getMessage(key.trim(), getDefaultLocale()); } private  I18nUtil(); static Locale getDefaultLocale(); static Locale getEPersonLocale(EPerson ep); static Locale[] getSupportedLocales(); static Locale getSupportedLocale(Locale locale); static Locale getSupportedLocale(String locale); static String getInputFormsFileName(Locale locale); static String getMessage(String key); static String getMessage(String key, Locale locale); static String getMessage(String key, Context c); static String getDefaultLicense(Context context); static String getEmailFilename(Locale locale, String name); static Locale[] parseLocales(String[] locales); static boolean isSupportedLocale(Locale locale);  }
@Test public void testGetMessage_String_Locale() { System.out.println("getMessage"); Locale locale = Locale.US; String key = "jsp.general.home"; String expResult = "DSpace Home"; String result = I18nUtil.getMessage(key, locale); assertEquals("Returns the translation of the key if it is defined", expResult, result); key = expResult = "bogus key"; result = I18nUtil.getMessage(key, locale); assertEquals("Returns the key if it is not defined", expResult, result); }