Initiate initializr documentation

This commit commit adds restdocs and stub generators and initiate
a reference guide for Initializr.

Most of the controller tests now use MockMvc via a custom version
of the MockMvcClientHttpRequestFactory (from spring-test). The
snippet names are auto-generated in the form

<HttpMethod>/<path>[/queries(/<name-value)*][/headers](/name-value)*]

when there is a comma-separated value in a header it is
abbreviated as <first-value>.MORE.

Wiremock stubs are generated in the same form under
snippets/stubs (with ".json" as the
file extension).

The controller tests that stayed as full stack use a different
base class AbstractFullStackInitializrIntegrationTests.

A long JSON body can be broken out into separate snippets
for each field (or rather a list of fields supplied by the
user). This feature was already used with hard-coded snippets
in the wiki.

See gh-295
This commit is contained in:
Dave Syer
2016-09-26 16:13:35 +01:00
committed by Stephane Nicoll
parent 6efcef1186
commit b7d8d5c813
27 changed files with 1543 additions and 211 deletions

View File

@@ -65,6 +65,11 @@
<artifactId>json-path</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.restdocs</groupId>
<artifactId>spring-restdocs-mockmvc</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>

View File

@@ -17,6 +17,8 @@
package io.spring.initializr.actuate.stat
import groovy.json.JsonSlurper
import io.spring.initializr.web.AbstractFullStackInitializrIntegrationTests;
import io.spring.initializr.web.AbstractInitializrControllerIntegrationTests
import org.junit.Before
import org.junit.Test
@@ -46,7 +48,7 @@ import static org.junit.Assert.fail
*/
@Import(StatsMockController)
@ActiveProfiles(['test-default', 'test-custom-stats'])
class MainControllerStatsIntegrationTests extends AbstractInitializrControllerIntegrationTests {
class MainControllerStatsIntegrationTests extends AbstractFullStackInitializrIntegrationTests {
@Autowired
private StatsMockController statsMockController