FolderBasedAsciidocPagesStructureProvider implements AsciidocPagesStructureProvider { @Override public AsciidocPagesStructure structure() { return this.structure; } FolderBasedAsciidocPagesStructureProvider(Path documentationRootFolder, Charset sourceEncoding); @Override AsciidocPagesStructure structure(); @Override Charset sourceEncoding();  }
@Test public void structure_nestedStructure_returnsAsciidocPagesStructureWithAllNonIncludeAdocFiles() { Path documentationRootFolder = Paths.get("src/test/resources/folder-based-asciidoc-page-structure"); FolderBasedAsciidocPagesStructureProvider folderBasedAsciidocSourceStructureProvider = new FolderBasedAsciidocPagesStructureProvider(documentationRootFolder, UTF_8); AsciidocPagesStructureProvider.AsciidocPagesStructure structure = folderBasedAsciidocSourceStructureProvider.structure(); assertThat(structure.pages().size(), is(1)); AsciidocPage indexPage = asciidocPageByPath(structure.pages(), documentationRootFolder.resolve("index.adoc")); assertThat(indexPage, is(not(nullValue()))); assertThat(indexPage.children().size(), is(2)); AsciidocPage subPageOne = asciidocPageByPath(indexPage.children(), documentationRootFolder.resolve("index/sub-page-one.adoc")); assertThat(subPageOne, is(not(nullValue()))); assertThat(subPageOne.children().size(), is(1)); AsciidocPage subPageTwo = asciidocPageByPath(indexPage.children(), documentationRootFolder.resolve("index/sub-page-two.adoc")); assertThat(subPageTwo, is(not(nullValue()))); assertThat(subPageTwo.children().size(), is(0)); AsciidocPage subSubPageOne = asciidocPageByPath(indexPage.children(), documentationRootFolder.resolve("index/sub-page-one/sub-sub-page-one.adoc")); assertThat(subSubPageOne, is(not(nullValue()))); assertThat(subSubPageOne.children().size(), is(0)); }