Spring MVC controller Test - print the result JSON String

Try this code:

resultActions.andDo(MockMvcResultHandlers.print());

The trick is to use andReturn()

MvcResult result = springMvc.perform(MockMvcRequestBuilders
         .get("/jobsdetails/2").accept(MediaType.APPLICATION_JSON)).andReturn();

String content = result.getResponse().getContentAsString();