From a8b37662e50029661d2be2ccee9687d42f68bed2 Mon Sep 17 00:00:00 2001 From: John Thompson Date: Mon, 27 May 2019 16:57:12 -0400 Subject: [PATCH] adding maven config --- pom.xml | 30 ++++++++++++++++++++++++++++++ src/main/asciidoc/index.adoc | 29 +++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 src/main/asciidoc/index.adoc diff --git a/pom.xml b/pom.xml index f74e056..45ee7a9 100644 --- a/pom.xml +++ b/pom.xml @@ -89,6 +89,11 @@ mockito-junit-jupiter test + + org.springframework.restdocs + spring-restdocs-mockmvc + test + @@ -121,6 +126,31 @@ + + org.asciidoctor + asciidoctor-maven-plugin + 1.5.3 + + + generate-docs + prepare-package + + process-asciidoc + + + html + book + + + + + + org.springframework.restdocs + spring-restdocs-asciidoctor + ${spring-restdocs.version} + + + diff --git a/src/main/asciidoc/index.adoc b/src/main/asciidoc/index.adoc new file mode 100644 index 0000000..e509c69 --- /dev/null +++ b/src/main/asciidoc/index.adoc @@ -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[] \ No newline at end of file