Skip to content

Commit 8f8e4c6

Browse files
committed
Update sample and readme to 0.9.1
1 parent b0cea3a commit 8f8e4c6

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ buildscript {
8888
}
8989
dependencies {
9090
//..
91-
classpath("com.epages:restdocs-api-spec-gradle-plugin:0.9.0") //2
91+
classpath("com.epages:restdocs-api-spec-gradle-plugin:0.9.1") //2
9292
}
9393
}
9494
//..
@@ -102,7 +102,7 @@ repositories { //4
102102
103103
dependencies {
104104
//..
105-
testCompile('com.epages:restdocs-api-spec-mockmvc:0.9.0') //5
105+
testCompile('com.epages:restdocs-api-spec-mockmvc:0.9.1') //5
106106
}
107107
108108
openapi { //6

samples/restdocs-api-spec-sample-web-test-client/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ dependencies {
3737
testImplementation('org.springframework.boot:spring-boot-starter-test')
3838
testImplementation('org.springframework.restdocs:spring-restdocs-webtestclient')
3939
testImplementation('io.projectreactor:reactor-test')
40-
testImplementation('com.epages:restdocs-api-spec:0.9.0')
40+
testImplementation('com.epages:restdocs-api-spec:0.9.1')
4141
}
4242

4343
openapi {

samples/restdocs-api-spec-sample/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ buildscript {
99
}
1010
dependencies {
1111
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
12-
classpath("com.epages:restdocs-api-spec-gradle-plugin:0.9.0")
12+
classpath("com.epages:restdocs-api-spec-gradle-plugin:0.9.1")
1313
}
1414
}
1515

@@ -38,7 +38,7 @@ dependencies {
3838
testCompile('org.springframework.boot:spring-boot-starter-test')
3939
testCompile('org.springframework.restdocs:spring-restdocs-mockmvc')
4040

41-
testCompile('com.epages:restdocs-api-spec-mockmvc:0.9.0')
41+
testCompile('com.epages:restdocs-api-spec-mockmvc:0.9.1')
4242
// testCompile project(':restdocs-api-spec-mockmvc') //enable for depending on the submodule directly
4343
testCompile('com.google.guava:guava:23.0')
4444
}

samples/restdocs-api-spec-sample/src/test/java/com/epages/restdocs/apispec/sample/ProductRestIntegrationTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616
import static com.epages.restdocs.apispec.MockMvcRestDocumentationWrapper.document;
1717
import static org.hamcrest.Matchers.hasSize;
1818
import static org.hamcrest.Matchers.notNullValue;
19+
import static org.springframework.data.rest.webmvc.RestMediaTypes.HAL_JSON;
1920
import static org.springframework.data.rest.webmvc.RestMediaTypes.JSON_PATCH_JSON;
2021
import static org.springframework.http.MediaType.APPLICATION_JSON;
22+
import static org.springframework.restdocs.headers.HeaderDocumentation.headerWithName;
23+
import static org.springframework.restdocs.headers.HeaderDocumentation.requestHeaders;
2124
import static org.springframework.restdocs.hypermedia.HypermediaDocumentation.linkWithRel;
2225
import static org.springframework.restdocs.hypermedia.HypermediaDocumentation.links;
2326
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.get;
@@ -61,13 +64,15 @@ public void should_get_products() throws Exception {
6164
fieldWithPath("page.number").description("The current page number."),
6265
fieldWithPath("page").description("Paging information"),
6366
subsectionWithPath("_links").description("Links section")),
67+
6468
links(
6569
linkWithRel("first").description("Link to the first page"),
6670
linkWithRel("next").description("Link to the next page"),
6771
linkWithRel("last").description("Link to the next page"),
6872
linkWithRel("self").ignored(),
6973
linkWithRel("profile").ignored()
7074
),
75+
requestHeaders(headerWithName("accept").description("accept header")),
7176
requestParameters(
7277
parameterWithName("page").description("The page to be requested."),
7378
parameterWithName("size").description("Parameter determining the size of the requested page."),
@@ -187,6 +192,7 @@ private void whenProductIsPatchedJsonPatch() throws Exception {
187192

188193
private void whenProductsAreRetrieved() throws Exception {
189194
resultActions = mockMvc.perform(get("/products")
195+
.header("accept", HAL_JSON)
190196
.param("page", "0")
191197
.param("size", "2")
192198
.param("sort", "name asc"))

0 commit comments

Comments
 (0)