@Test
public void simlePostRequestWithCors() throws URISyntaxException, IOException {

    HttpExchange exchange = prepareExchange("http://localhost:8080/jolokia",
                                            "Content-Type","text/plain; charset=UTF-8",
                                            "Origin","http://localhost:8080/"
                                           );
    prepareMemoryPostReadRequest(exchange);
    Headers header = new Headers();
    prepareResponse(handler, exchange, header);
    handler.doHandle(exchange);
    assertEquals(header.getFirst("content-type"), "text/plain; charset=utf-8");
    assertEquals(header.getFirst("Access-Control-Allow-Origin"),"http://localhost:8080/");
}