title: MockMvc post junit test returning 415 when ResponseBody have collection
body: <p>I am using mockmvc for my rest services integration test. I have a post rest service, called it from postman and getted 200 but when i call it with mockmvc porform method returned 415 unsupported media type exception. </p>
  
  <p>Rest method</p>
  
  <pre><code>@RequestMapping(value = "/users/test/{groupId}",
          method = RequestMethod.POST,
          produces=MediaType.APPLICATION_JSON_VALUE,
          consumes=MediaType.APPLICATION_JSON_VALUE)
  private GenericResponse postTest(@PathVariable("groupId")String groupId,@RequestBody List&lt;Contact&gt; test, @RequestHeader("Authorization")String authorization) {
      return new GenericResponse();
  }
  </code></pre>
  
  <p>Test Method</p>
  
  <pre><code>@Test
  public void testPost() throws Exception {
      Contact contact = new Contact();
      contact.setName("contact1");
      contact.setMsisdn("901234567890");
  
      Contact contact2 = new Contact();
      contact2.setName("contact2");
      contact2.setMsisdn("901234567890");
  
      List&lt;Contact&gt; contactList = new ArrayList&lt;&gt;();
      contactList.add(contact);
      contactList.add(contact2);
  
      Gson gson = new Gson();
      String request = gson.toJson(contactList);
  
      MvcResult result = mvc.perform(
              post("/users/test/{groupId}","123")
                      .with(httpBasic(username,password))
                      .contentType(MediaType.APPLICATION_JSON_VALUE)
                      .accept(MediaType.APPLICATION_JSON_VALUE)
                      .content(request)
      )
              .andDo(print())
              .andExpect(status().isOk())
              .andReturn();
  
  }
  </code></pre>
  
  <p>When use String instead of List in RequestBody 200 success returned. What is my mistake about collection in requestbody how can i fix it?</p>