Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
b31e5784
Commit
b31e5784
authored
Sep 08, 2015
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade to Spring REST Docs 1.0.0.RC1
parent
f7a1db8e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
34 deletions
+33
-34
pom.xml
spring-boot-actuator-docs/pom.xml
+1
-4
EndpointDocumentation.java
...mework/boot/actuate/hypermedia/EndpointDocumentation.java
+12
-10
HealthEndpointDocumentation.java
.../boot/actuate/hypermedia/HealthEndpointDocumentation.java
+9
-9
HypermediaEndpointDocumentation.java
...t/actuate/hypermedia/HypermediaEndpointDocumentation.java
+9
-9
pom.xml
spring-boot-parent/pom.xml
+2
-2
No files found.
spring-boot-actuator-docs/pom.xml
View file @
b31e5784
...
...
@@ -50,7 +50,7 @@
</dependency>
<dependency>
<groupId>
org.springframework.restdocs
</groupId>
<artifactId>
spring-restdocs
</artifactId>
<artifactId>
spring-restdocs
-mockmvc
</artifactId>
<scope>
provided
</scope>
</dependency>
</dependencies>
...
...
@@ -96,9 +96,6 @@
<includes>
<include>
**/*Documentation.java
</include>
</includes>
<systemPropertyVariables>
<org.springframework.restdocs.outputDir>
${project.build.directory}/generated-snippets
</org.springframework.restdocs.outputDir>
</systemPropertyVariables>
<skipTests>
false
</skipTests>
</configuration>
<executions>
...
...
spring-boot-actuator-docs/src/restdoc/java/org/springframework/boot/actuate/hypermedia/EndpointDocumentation.java
View file @
b31e5784
...
...
@@ -32,15 +32,16 @@ import java.util.Map;
import
javax.servlet.Filter
;
import
org.junit.Before
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint
;
import
org.springframework.boot.actuate.endpoint.mvc.MvcEndpoints
;
import
org.springframework.boot.test.SpringApplicationConfiguration
;
import
org.springframework.http.MediaType
;
import
org.springframework.restdocs.RestDocumentation
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.TestPropertySource
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
...
...
@@ -52,8 +53,8 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.context.WebApplicationContext
;
import
static
org
.
springframework
.
restdocs
.
RestDocumentation
.
document
;
import
static
org
.
springframework
.
restdocs
.
RestDocumentation
.
documentationConfiguration
;
import
static
org
.
springframework
.
restdocs
.
mockmvc
.
MockMvc
RestDocumentation
.
document
;
import
static
org
.
springframework
.
restdocs
.
mockmvc
.
MockMvc
RestDocumentation
.
documentationConfiguration
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
request
.
MockMvcRequestBuilders
.
get
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
result
.
MockMvcResultMatchers
.
status
;
...
...
@@ -65,6 +66,12 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@DirtiesContext
public
class
EndpointDocumentation
{
private
static
final
String
RESTDOCS_OUTPUT_DIR
=
"target/generated-snippets"
;
@Rule
public
final
RestDocumentation
restDocumentation
=
new
RestDocumentation
(
RESTDOCS_OUTPUT_DIR
);
@Autowired
private
WebApplicationContext
context
;
...
...
@@ -82,18 +89,13 @@ public class EndpointDocumentation {
@Autowired
private
TemplateEngine
templates
;
@Value
(
"${org.springframework.restdocs.outputDir:${user.dir}/target/generated-snippets}"
)
private
String
restdocsOutputDir
;
private
MockMvc
mockMvc
;
@Before
public
void
setUp
()
{
System
.
setProperty
(
"org.springframework.restdocs.outputDir"
,
this
.
restdocsOutputDir
);
this
.
mockMvc
=
MockMvcBuilders
.
webAppContextSetup
(
this
.
context
)
.
addFilters
(
this
.
metricFilter
,
this
.
traceFilter
)
.
apply
(
documentationConfiguration
()).
build
();
.
apply
(
documentationConfiguration
(
this
.
restDocumentation
)).
build
();
}
@Test
...
...
@@ -129,7 +131,7 @@ public class EndpointDocumentation {
});
}
}
File
file
=
new
File
(
this
.
restdocsOutputDir
+
"/endpoints.adoc"
);
File
file
=
new
File
(
RESTDOCS_OUTPUT_DIR
+
"/endpoints.adoc"
);
file
.
getParentFile
().
mkdirs
();
PrintWriter
writer
=
new
PrintWriter
(
file
,
"UTF-8"
);
try
{
...
...
spring-boot-actuator-docs/src/restdoc/java/org/springframework/boot/actuate/hypermedia/HealthEndpointDocumentation.java
View file @
b31e5784
...
...
@@ -17,12 +17,13 @@
package
org
.
springframework
.
boot
.
actuate
.
hypermedia
;
import
org.junit.Before
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.test.SpringApplicationConfiguration
;
import
org.springframework.http.MediaType
;
import
org.springframework.restdocs.RestDocumentation
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.TestPropertySource
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
...
...
@@ -31,8 +32,8 @@ import org.springframework.test.web.servlet.MockMvc;
import
org.springframework.test.web.servlet.setup.MockMvcBuilders
;
import
org.springframework.web.context.WebApplicationContext
;
import
static
org
.
springframework
.
restdocs
.
RestDocumentation
.
document
;
import
static
org
.
springframework
.
restdocs
.
RestDocumentation
.
documentationConfiguration
;
import
static
org
.
springframework
.
restdocs
.
mockmvc
.
MockMvc
RestDocumentation
.
document
;
import
static
org
.
springframework
.
restdocs
.
mockmvc
.
MockMvc
RestDocumentation
.
documentationConfiguration
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
request
.
MockMvcRequestBuilders
.
get
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
result
.
MockMvcResultMatchers
.
status
;
...
...
@@ -44,20 +45,19 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@DirtiesContext
public
class
HealthEndpointDocumentation
{
@Rule
public
final
RestDocumentation
restDocumentation
=
new
RestDocumentation
(
"target/generated-snippets"
);
@Autowired
private
WebApplicationContext
context
;
@Value
(
"${org.springframework.restdocs.outputDir:target/generated-snippets}"
)
private
String
restdocsOutputDir
;
private
MockMvc
mockMvc
;
@Before
public
void
setUp
()
{
System
.
setProperty
(
"org.springframework.restdocs.outputDir"
,
this
.
restdocsOutputDir
);
this
.
mockMvc
=
MockMvcBuilders
.
webAppContextSetup
(
this
.
context
)
.
apply
(
documentationConfiguration
()).
build
();
.
apply
(
documentationConfiguration
(
this
.
restDocumentation
)).
build
();
}
@Test
...
...
spring-boot-actuator-docs/src/restdoc/java/org/springframework/boot/actuate/hypermedia/HypermediaEndpointDocumentation.java
View file @
b31e5784
...
...
@@ -17,12 +17,13 @@
package
org
.
springframework
.
boot
.
actuate
.
hypermedia
;
import
org.junit.Before
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.test.SpringApplicationConfiguration
;
import
org.springframework.http.MediaType
;
import
org.springframework.restdocs.RestDocumentation
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.TestPropertySource
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
...
...
@@ -31,8 +32,8 @@ import org.springframework.test.web.servlet.MockMvc;
import
org.springframework.test.web.servlet.setup.MockMvcBuilders
;
import
org.springframework.web.context.WebApplicationContext
;
import
static
org
.
springframework
.
restdocs
.
RestDocumentation
.
document
;
import
static
org
.
springframework
.
restdocs
.
RestDocumentation
.
documentationConfiguration
;
import
static
org
.
springframework
.
restdocs
.
mockmvc
.
MockMvc
RestDocumentation
.
document
;
import
static
org
.
springframework
.
restdocs
.
mockmvc
.
MockMvc
RestDocumentation
.
documentationConfiguration
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
request
.
MockMvcRequestBuilders
.
get
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
result
.
MockMvcResultMatchers
.
status
;
...
...
@@ -43,20 +44,19 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@DirtiesContext
public
class
HypermediaEndpointDocumentation
{
@Rule
public
final
RestDocumentation
restDocumentation
=
new
RestDocumentation
(
"target/generated-snippets"
);
@Autowired
private
WebApplicationContext
context
;
@Value
(
"${org.springframework.restdocs.outputDir:target/generated-snippets}"
)
private
String
restdocsOutputDir
;
private
MockMvc
mockMvc
;
@Before
public
void
setUp
()
{
System
.
setProperty
(
"org.springframework.restdocs.outputDir"
,
this
.
restdocsOutputDir
);
this
.
mockMvc
=
MockMvcBuilders
.
webAppContextSetup
(
this
.
context
)
.
apply
(
documentationConfiguration
()).
build
();
.
apply
(
documentationConfiguration
(
this
.
restDocumentation
)).
build
();
}
@Test
...
...
spring-boot-parent/pom.xml
View file @
b31e5784
...
...
@@ -23,7 +23,7 @@
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<maven.version>
3.1.1
</maven.version>
<spring-restdocs.version>
1.0.0.
M
1
</spring-restdocs.version>
<spring-restdocs.version>
1.0.0.
RC
1
</spring-restdocs.version>
</properties>
<scm>
<url>
http://github.com/spring-projects/spring-boot
</url>
...
...
@@ -199,7 +199,7 @@
</dependency>
<dependency>
<groupId>
org.springframework.restdocs
</groupId>
<artifactId>
spring-restdocs
</artifactId>
<artifactId>
spring-restdocs
-mockmvc
</artifactId>
<version>
${spring-restdocs.version}
</version>
</dependency>
<dependency>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment