Ejemplo 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"));
 }
Ejemplo 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"));
 }
Ejemplo n.º 3
0
 @Test
 public void shouldNotFailToParseDocWithUnresolvableMarkdown() {
   final Documentation documentation =
       docsGenerator()
           .documentationFrom(
               create("http://example.org/rel/foo"), ControllerWithUnresolvableMarkdown.class);
   assertEquals(documentation.getDescription(), emptyList());
 }
Ejemplo 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>");
 }
Ejemplo 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>");
 }
Ejemplo 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>");
 }
Ejemplo 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"));
 }