Skip to content

Instantly share code, notes, and snippets.

@warmuuh
Last active August 29, 2015 14:23
Show Gist options
  • Save warmuuh/15120d13e8fdabb476b3 to your computer and use it in GitHub Desktop.
Save warmuuh/15120d13e8fdabb476b3 to your computer and use it in GitHub Desktop.
documenting-and-testing-versioned-apis
@Test
public void user() throws Exception {
this.mockMvc
.perform(get("/user"))
.andExpect(status().isOk())
.andDo(response()
.common(fieldWithPath("id").description("user-id"),
fieldWithPath("name").description("name of user"))
.v1( fieldWithPath("g").description("gender of the user"))
.v2( fieldWithPath("gender").description("gender of the user"))
.build());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment