@Test public void testSetStringMessageWithLocalizationIfNoTranslation() throws Exception { String expected = "Good morning"; WelcomeMessage welcomeMessage = new WelcomeMessage(); PropertiesReader.setStringMessageWithLocalization(welcomeMessage, "welcomeObj1", Locale.CHINA); String result = welcomeMessage.getHelloMessage(); assertThat(result, is(expected)); }
@Test public void testSetStringMessageWithLocalizationRu() throws Exception { String expected = "Доброе утро"; WelcomeMessage welcomeMessage = new WelcomeMessage(); PropertiesReader.setStringMessageWithLocalization( welcomeMessage, "welcomeObj1", new Locale("ru")); String result = welcomeMessage.getHelloMessage(); assertThat(result, is(expected)); }