Exemplo n.º 1
0
  @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));
  }
Exemplo n.º 2
0
  @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));
  }