I have simple integration test
@Test public void shouldReturnErrorMessageToAdminWhenCreatingUserWithUsedUserName()
Another option is:
when: def response = mockMvc.perform( get('/path/to/api') .header("Content-Type", "application/json")) then: response.andExpect(status().isOk()) response.andReturn().getResponse().getContentAsString() == "what you expect"