Skip to content

Instantly share code, notes, and snippets.

@oak-tree
Created January 30, 2014 13:36
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 oak-tree/8708433 to your computer and use it in GitHub Desktop.
Save oak-tree/8708433 to your computer and use it in GitHub Desktop.
spring controller integration test
MvcResult result = (MvcResult) mockMvc.perform(post("/api/search/report/advanced").contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(pageRequest.getBytes()))
.andExpect(status().isOk())
.andExpect(content().contentType(TestUtil.APPLICATION_JSON_UTF8))
.andExpect(jsonPath("$[0].page").value(page.intValue()))
.andExpect(jsonPath("$[0].page").exists()).andReturn();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment