Ejemplo n.º 1
0
  @Test
  public void itReturnsStaticPages() throws IOException {
    StaticPagePathFinder.PagePaths paths =
        new StaticPagePathFinder.PagePaths("/template/path", "/foo");
    given(staticPagePathFinder.findPaths()).willReturn(Arrays.asList(paths));

    Iterable<String> pages = indexer.indexableItems();

    assertThat(pages, containsInAnyOrder("http://www.example.com/foo"));
  }
Ejemplo n.º 2
0
  @Test
  public void itIgnoresErrorPages() throws IOException {
    StaticPagePathFinder.PagePaths paths =
        new StaticPagePathFinder.PagePaths("/template/path", "/foo");
    StaticPagePathFinder.PagePaths error1 =
        new StaticPagePathFinder.PagePaths("/template/path", "/error");
    StaticPagePathFinder.PagePaths error2 =
        new StaticPagePathFinder.PagePaths("/template/path", "/404");
    StaticPagePathFinder.PagePaths error3 =
        new StaticPagePathFinder.PagePaths("/template/path", "/500");
    given(staticPagePathFinder.findPaths())
        .willReturn(Arrays.asList(paths, error1, error2, error3));

    Iterable<String> pages = indexer.indexableItems();

    assertThat(pages, containsInAnyOrder("http://www.example.com/foo"));
  }