To check a string in the response body with MockMvc, you can use the andExpect() method of the MockMvcResultMatchers class.