adding response example

This commit is contained in:
John Thompson 2019-05-27 17:54:14 -04:00
parent cd16adf327
commit 520ca97e23
No known key found for this signature in database
GPG Key ID: 25C80CE5BD1AF258

View File

@ -24,6 +24,8 @@ import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.*;
import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath;
import static org.springframework.restdocs.payload.PayloadDocumentation.responseFields;
import static org.springframework.restdocs.request.RequestDocumentation.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@ -58,6 +60,17 @@ class BeerControllerTest {
),
requestParameters(
parameterWithName("iscold").description("Is Beer Cold Query param")
),
responseFields(
fieldWithPath("id").description("Id of Beer"),
fieldWithPath("version").description("Version number"),
fieldWithPath("createdDate").description("Date Created"),
fieldWithPath("lastModifiedDate").description("Date Updated"),
fieldWithPath("beerName").description("Beer Name"),
fieldWithPath("beerStyle").description("Beer Style"),
fieldWithPath("upc").description("UPC of Beer"),
fieldWithPath("price").description("Price"),
fieldWithPath("quantityOnHand").description("Quantity On hand")
)));
}