Skip to content

Instantly share code, notes, and snippets.

@donchan922
Created June 1, 2019 05:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donchan922/de1b9255c63e8a8d0d35022d542300f6 to your computer and use it in GitHub Desktop.
Save donchan922/de1b9255c63e8a8d0d35022d542300f6 to your computer and use it in GitHub Desktop.
@Test
void GETでアクセスする() throws Exception {
// GETで「/」にアクセスする
mockMvc.perform(MockMvcRequestBuilders.get("/"))
// レスポンスのステータスコードが200であることを検証する
.andExpect(status().isOk())
// レスポンスボディが「Hello World」であることを検証する
.andExpect(content().string("Hello World"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment