OcelotI18nServices { public String getLocalizedMessage(String bundleName, String entry, Object[] args) { ResourceBundle bundle = ResourceBundle.getBundle(bundleName, getUserLocale()); return MessageFormat.format(bundle.getString(entry), args); }  Locale getUserLocale(); String getLocalizedMessage(String bundleName, String entry, Object[] args);  }
@Test public void testGetLocalizedMessage() { System.out.println("getLocalizedMessage"); String bundleName = "test"; when(ocelotContext.getLocale()).thenReturn(Locale.US).thenReturn(Locale.FRANCE); String expResult = "Hello François"; String result = ocelotI18nServices.getLocalizedMessage(bundleName, "HELLOGUY", new Object[]{"François"}); assertThat(result).isEqualTo(expResult); expResult = "Bonjour François"; result = ocelotI18nServices.getLocalizedMessage(bundleName, "HELLOGUY", new Object[]{"François"}); assertThat(result).isEqualTo(expResult); }