title: Response from JUnit is different then normal response
body: <p>Current tech stack:</p>
  <ul>
  <li>Spring Boot 2.3.2</li>
  <li>JUnit5</li>
  <li>MockMvc</li>
  </ul>
  <p>In my application.properties, I have included:</p>
  <pre><code>server.servlet.encoding.force=true
  </code></pre>
  <p>So all responses get <code>&quot;;charset=UTF-8&quot;</code> appended. This works as expected in Swagger, Fiddler, real world.</p>
  <p>I built my unit test as:</p>
  <pre><code>    String result = mockMvc().perform(get(&quot;/customers&quot;)
          .accept(MediaType.APPLICATION_xxx)
          .header(HttpHeaders.AUTHORIZATION, authorization()))
              .andExpect(status().isOk())
              .andExpect(content().contentType(MediaType.APPLICATION_xxx_UTF8))
              .andReturn()
                  .getResponse()
                      .getContentAsString();
  
      List&lt;CustomerDto&gt; customers = this.objectMapper.readValue(result, new TypeReference&lt;List&lt;CustomerDto&gt;&gt;(){});
      
  </code></pre>
  <p>Note that I have set expected contentType as <code>MediaType.APPLICATION_xxx_UTF8</code> which is <code>MediaType.APPLICATION_xxx</code> with the <code>&quot;;charset=UTF-8&quot;</code> appended.</p>
  <p>However, the response is coming back as just <code>MediaType.APPLICATION_xxx</code>.</p>
  <p>I'm new to junit and mockmvc, but I'm assuming mockmvc isn't really sending an http request? So its not going through the servlet to append the charset?</p>
  <p>How can I get it to append the charset? I know I can just accept the non-UTF8 type, but I'm wanting to test what the real world will get.</p>
  <p>EDIT: Mockmvc is created as:</p>
  <pre><code>public ControllerTestsBase(WebApplicationContext webApplicationContext,
                             FilterChainProxy springSecurityFilterChain) {
      this.mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext)
          .addFilter(springSecurityFilterChain)
          .build();
  }
  </code></pre>