title: Body is empty when using MockMvc
body: <pre><code>&lt;pre&gt;&lt;code&gt;
  
  @RunWith(SpringRunner.class) 
  @WebMvcTest(CustomerController.class) 
  public class CustomerControllerMvcTest {
  
      @Autowired  
      private WebApplicationContext wac;
  
      private MockMvc mockMvc;
  
      @MockBean   
      private ICustomerService customerService;
  
      @Before     
      public void before() {
      MockitoAnnotations.initMocks(this);
      this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac)
                         .dispatchOptions(true).build();  
      }
  
      @Test   
      public void getTaskByUserdId1() throws Exception {      
         String expectedOutput = "{\"id\":3,\"name\":\"vikas\"}";
         this.mockMvc.perform(MockMvcRequestBuilders.get("/customer/get/vikas")
         .accept(MediaType.APPLICATION_JSON_UTF8_VALUE))
         .andExpect(status().isOk())
         .andExpect(content().string(expectedOutput));
      }
  
      @Test   
      public void getTaskByUserdId2() throws Exception {      
          String expectedOutput = "{\"id\":3,\"name\":\"vikas\"}";
          this.mockMvc.perform(get("/customer/get/vikas"))
          .andDo(print())
          .andExpect(status().isOk())
          .andExpect(content().string(containsString(expectedOutput)));
      }
  }
  
  &lt;/code&gt; &lt;/pre&gt;
  </code></pre>
  
  <p>It always gives empty body:</p>
  
  <pre><code>&lt;pre&gt;
  &lt;code&gt;
  
  MockHttpServletRequest:
  
        HTTP Method = GET
        Request URI = /customer/get/vikas
         Parameters = {}
            Headers = {}
  
  MockHttpServletResponse:
             Status = 200
      Error message = null
            Headers = {}
       Content type = null
               Body = 
      Forwarded URL = null    Redirected URL = null
            Cookies = []
  
  &lt;/code&gt;
  &lt;/pre&gt;
  </code></pre>
  
  <p>It is working fine when I use TestRestTemplate. But, when I use <strong>MockMvc</strong> and <strong>@MockBean</strong>, it always gives empty output. I have also used <code>com.gargoylesoftware.htmlunit.WebClient</code>. But, that also gives empty body. I don't know what is happening. Please help. Is it a version issue or I am doing something wrong?
  <em>Spring boot version: 1.5.10</em></p>