Ejemplo n.º 1
0
  @Test
  public void constructor_de() {

    // given
    Locale locale = Locale.GERMAN;
    Collator collator = Collator.getInstance(locale);

    // when
    SitemapNode node =
        new SitemapNode("one", PublicHomeView.class, TestLabelKey.Yes, locale, collator, translate);
    // then
    assertThat(node.getUriSegment()).isEqualTo("one");
    assertThat(node.getViewClass()).isEqualTo(PublicHomeView.class);
    assertThat(node.getLabel()).isEqualTo("Ja");
    assertThat(node.getCollationKey()).isEqualTo(collator.getCollationKey("Ja"));
  }
Ejemplo n.º 2
0
  @Test
  public void setLabelKey_de() {

    // given
    SitemapNode node = new SitemapNode();
    node.setTranslate(translate);
    Locale locale = Locale.GERMAN;
    Collator collator = Collator.getInstance(locale);
    // when

    node.setLabelKey(TestLabelKey.Yes, locale, collator);
    // then
    assertThat(node.getLabelKey()).isEqualTo(TestLabelKey.Yes);
    assertThat(node.getLabel()).isEqualTo("Ja");
    assertThat(node.getCollationKey()).isEqualTo(collator.getCollationKey("Ja"));
  }