Esempio n. 1
0
 @Test
 public void docsWithRelativeLinkShouldUseRelationTypeBaseUriAsPrefix() {
   final Documentation documentation =
       docsGenerator()
           .documentationFrom(
               create("http://example.org/rel/foo"), ControllerWithRelativeLink.class);
   assertEquals(documentation.getLink(), create("http://example.org/foo/bar.html"));
 }
Esempio n. 2
0
 @Test
 public void docsWithAbsoluteLinkShouldKeepLink() {
   final Documentation documentation =
       docsGenerator()
           .documentationFrom(
               create("http://example.org/rel/foo"), ControllerWithAbsoluteLink.class);
   assertEquals(documentation.getLink(), create("http://example.org/foo/bar.html"));
 }
Esempio n. 3
0
 @Test
 public void shouldNotFailToParseDocWithUnresolvableMarkdown() {
   final Documentation documentation =
       docsGenerator()
           .documentationFrom(
               create("http://example.org/rel/foo"), ControllerWithUnresolvableMarkdown.class);
   assertEquals(documentation.getDescription(), emptyList());
 }
Esempio n. 4
0
 @Test
 public void docsGeneratorWithRelativeRootShouldWorkToo() {
   final DocsGenerator docsGenerator = new DocsGenerator(create("http://example.org"), "docs/*");
   final Documentation documentation =
       docsGenerator.documentationFrom(
           create("http://example.org/rel/foo"), ControllerWithMinimalMarkdownInclude.class);
   assertEquals(documentation.getDescription(), emptyList());
   assertEquals(documentation.getDetailedDescription(), "<h1>Hello World!</h1>");
 }
Esempio n. 5
0
 @Test
 public void markdownIncludeShouldContainRenderedMarkdown() {
   final Documentation documentation =
       docsGenerator()
           .documentationFrom(
               create("http://example.org/rel/foo"), ControllerWithMinimalMarkdownInclude.class);
   assertEquals(documentation.getDescription(), emptyList());
   assertEquals(documentation.getDetailedDescription(), "<h1>Hello World!</h1>");
 }
Esempio n. 6
0
 @Test
 public void markdownIncludeWithValuesShouldContainBothDescriptions() {
   final Documentation documentation =
       docsGenerator()
           .documentationFrom(
               create("http://example.org/rel/foo"), ControllerWithMarkdownInclude.class);
   assertEquals(documentation.getDescription(), asList("foo", "bar"));
   assertEquals(documentation.getDetailedDescription(), "<h1>Hello World!</h1>");
 }
Esempio n. 7
0
 @Test
 public void valuesShouldBeParsedAsDescription() {
   final Documentation documentation =
       docsGenerator()
           .documentationFrom(
               create("http://example.org/rel/foo"), ControllerWithAbsoluteLink.class);
   assertTrue(documentation.hasDescription());
   assertEquals(documentation.getDescription(), asList("foo", "bar"));
 }