title: 400 BAD_REQUEST. Can't catch Post request from RestTemplate.PostForEntity() call
body: <p>I have a Test method for testing to save a one-to-many cascade data into two tables: Customer and Address, but the controller is  not able to catch the Post call in this cascade testing, however the controller can Post receive call from posting data only for the Customer table, without data for the ShippingAddress.</p>
  <p>Here is the test case for posting cascade data for the Customer and ShippingAddress tables:
  @Test
  public void create_shipping_address_and_customer() throws Exception {</p>
  <pre><code>    Customer newCustomer = new Customer(&quot;Alex&quot;, &quot;Maxim&quot;, &quot;alexmaxim@gmail.com&quot;, &quot;43323222222&quot;);
      ShippingAddress shippingAddress1 = new ShippingAddress(&quot;unit 1&quot;, &quot;89 hanson road&quot;, &quot;New York&quot;, &quot;CA&quot;, &quot;KKKDLDL&quot;);
      newCustomer.addShippingAddress(shippingAddress1);
  
      HttpHeaders headers = new HttpHeaders();
      headers.setContentType(MediaType.APPLICATION_JSON);
      HttpEntity&lt;Customer&gt; requestEntity = new HttpEntity&lt;&gt;(newCustomer, headers);
      ResponseEntity&lt;Customer&gt; response = restTemplate.postForEntity(&quot;/customer/add&quot;, requestEntity, Customer.class);
      assertEquals(HttpStatus.CREATED, response.getStatusCode());
  
  }
  </code></pre>
  <p>Error is:
  [ERROR] Failures:
  [ERROR]   ShippingAddressControllerRestTemplateTest.create_shipping_address_and_customer:85 expected:&lt;201 CREATED&gt; but was:&lt;400 BAD_REQUEST&gt;</p>
  <p>I have been stuck in this issue for more than a week, have tried to use exchange() method, still failed. Could anyone shred some light to me ?
  Thanks</p>