예제 #1
0
  @Test
  public void should_check_resource_language() {
    ViewProxy proxy = mock(ViewProxy.class);
    assertThat(Views.acceptResourceLanguage(proxy, Java.KEY)).isEqualTo(true);

    when(proxy.getResourceLanguages()).thenReturn(new String[] {"foo"});
    assertThat(Views.acceptResourceLanguage(proxy, Java.KEY)).isEqualTo(false);
    assertThat(Views.acceptResourceLanguage(proxy, "foo")).isEqualTo(true);
  }
예제 #2
0
  @Test
  public void checkResourceLanguage() {
    ViewProxy proxy = mock(ViewProxy.class);
    assertThat(Views.acceptResourceLanguage(proxy, Java.KEY), is(true));

    when(proxy.getResourceLanguages()).thenReturn(new String[] {"foo"});
    assertThat(Views.acceptResourceLanguage(proxy, Java.KEY), is(false));
    assertThat(Views.acceptResourceLanguage(proxy, "foo"), is(true));
  }