title: Create POST request, using Java RestAssured, returns status code 422
body: <p>I have Ubuntu server instance on Windows 10. I have application, which is running on localhost on Ubuntu.
  When I create request on Ubuntu terminal:</p>
  
  <pre><code>curl http://localhost:8000/test \
      -H "Content-Type: application/json;charset=UTF-8" \
      -H "Authorization: Basic cJJdlJ26p62JG23j34==" \
      -d '{
      "test": {
        "id": "564624232443234",
        "type": "book"
      }
  }'
  </code></pre>
  
  <p>It works and insert into database.</p>
  
  <p>When I have JUnit test in Eclipse with same JSON values above:</p>
  
  <pre><code>public class Test extends Connection {
  .......
  
      @Test
      public void test_Insert() {
          Map&lt;Object, String&gt; mapRequest = new HashMap&lt;&gt;();
          mapRequest.put("id", "564624232443234");
          mapRequest.put("type", "book");
  
          given().
              contentType(ContentType.JSON).  
              header("Authorization", "Basic "+"cJJdlJ26p62JG23j34==").
              body(mapRequest).
          when().
              post("test").
          then().
              statusCode(200);
  
      }
  </code></pre>
  
  <p>It doesn't work. Returns me:</p>
  
  <blockquote>
    <p>java.lang.AssertionError: 1 expectation failed.
    Expected status code &lt;200> but was &lt;422>.</p>
  </blockquote>
  
  <p>If I only ping the server like below, the response is correct (200).</p>
  
  <pre><code>    @Test
      public void basicPingTest() {
          given().when().get("/").then().statusCode(200);
      }
  </code></pre>
  
  <p>Any ideas of the problem?
  Thanks</p>