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