Make things less Gradle-specific and provide Maven config in samples

Previously, the project provided a Gradle plugin and was only really
intended for use with Gradle. This had influenced a number of design
choices that have proven to be less than ideal when attempting to
use the project with Maven.

This commit backs off from a number of design decisions that worked
well with Gradle but less so with Maven. Part of this is that the
Gradle plugin is (temporarily?) no more. It's been removed in favour
of configuring things directly in build.gradle. While this slightly
increases the amount of configuration required it makes things far
more flexible.

Both samples have been updated with modified Gradle configuration and
new Maven configuration. The README has also been updated to reflect
these changes.
This commit is contained in:
Andy Wilkinson
2015-01-08 16:51:47 +00:00
parent f67b74304c
commit 6ec522069a
26 changed files with 467 additions and 561 deletions

View File

@@ -1 +0,0 @@
org.springframework.restdocs.outputDir = build/generated-documentation

View File

@@ -23,6 +23,7 @@ import static org.springframework.restdocs.core.RestDocumentation.document;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@@ -172,6 +173,7 @@ public class GettingStartedDocumentation {
.andReturn(), "note-tags");
this.mockMvc.perform(get(tagsLocation))
.andExpect(status().isOk())
.andDo(print())
.andExpect(jsonPath("_embedded.tags", hasSize(1)))
.andDo(document("get-tags"));
}