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

    HttpExchange exchange = prepareExchange("http://localhost:8080/jolokia/read/java.lang:type=Memory/HeapMemoryUsage?callback=data");
    // Simple GET method
    expect(exchange.getRequestMethod()).andReturn("GET");
    Headers header = new Headers();
    ByteArrayOutputStream out = prepareResponse(handler, exchange, header);
    handler.doHandle(exchange);
    assertEquals(header.getFirst("content-type"),"text/javascript; charset=utf-8");
    String result = out.toString("utf-8");
    assertTrue(result.endsWith("});"));
    assertTrue(result.startsWith("data({"));
}