adding maven config

This commit is contained in:
John Thompson 2019-05-27 16:57:12 -04:00
parent d6a96f8498
commit a8b37662e5
No known key found for this signature in database
GPG Key ID: 25C80CE5BD1AF258
2 changed files with 59 additions and 0 deletions

30
pom.xml
View File

@ -89,6 +89,11 @@
<artifactId>mockito-junit-jupiter</artifactId> <artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.restdocs</groupId>
<artifactId>spring-restdocs-mockmvc</artifactId>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>
@ -121,6 +126,31 @@
</compilerArgs> </compilerArgs>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>1.5.3</version>
<executions>
<execution>
<id>generate-docs</id>
<phase>prepare-package</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
<configuration>
<backend>html</backend>
<doctype>book</doctype>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.springframework.restdocs</groupId>
<artifactId>spring-restdocs-asciidoctor</artifactId>
<version>${spring-restdocs.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins> </plugins>
</build> </build>

View File

@ -0,0 +1,29 @@
= SFG Brewery Order Service Docs
John Thompson;
:doctype: book
:icons: font
:source-highlighter: highlightjs
Sample application demonstrating how to use Spring REST Docs with JUnit 5.
`BeerOrderControllerTest` makes a call to a very simple service and produces three
documentation snippets.
One showing how to make a request using cURL:
include::{snippets}/orders/curl-request.adoc[]
One showing the HTTP request:
include::{snippets}/orders/http-request.adoc[]
And one showing the HTTP response:
include::{snippets}/orders/http-response.adoc[]
Response Body:
include::{snippets}/orders/response-body.adoc[]
Response Fields:
include::{snippets}/orders/response-fields.adoc[]