title: inherited class passing in @RequestMapping with MockMVC
body: <p>I have class <code>Type1</code> like this:</p>
  
  <pre><code>public class Type1 extends TypeParent {}
  </code></pre>
  
  <p>I have a method post in my controller witch I'll test with <code>MockMvc</code> :</p>
  
  <pre><code>@RequestMapping(value = "/actions", method = RequestMethod.POST)
  public Map&lt;String, Name&gt; gettypes(@Valid @RequestBody Type1 request) { ... }
  </code></pre>
  
  <p>But I don't understand why the following test code doesn't work.</p>
  
  <pre><code>Type1 type= new Type1();
  
  mockMvc.perform(post("/actions").contentType(JsonUtils.APPLICATION_JSON_UTF8).content(JsonUtils.toJson(type)))
      .andExpect(status().isOk())
      .andDo(print());
  </code></pre>
  
  <p>Output:</p>
  
  <blockquote>
    <p>java.lang.AssertionError: Status expected:&lt;200> but was:&lt;400></p>
  </blockquote>
  
  <p>Otherwise with : <code>TypeParent typeParent = new TypeParent();</code> it's work very fine:</p>
  
  <pre><code>mockMvc.perform(post("/actions").contentType(JsonUtils.APPLICATION_JSON_UTF8)
      .content(JsonUtils.toJson(typeParent)))
      .andExpect(status().isOk())
      .andDo(print());
  </code></pre>
  
  <p>I understood that to passing an inherited object doesn't work, how can I do to solve this problem?</p>