String endpointAddress =
"http://localhost:" + PORT + "/bookstore/quotedheaders";
WebClient wc = WebClient.create(endpointAddress);
WebClient.getConfig(wc).getRequestContext().put("org.apache.cxf.http.header.split", true);
Response r = wc.get();
List<Object> header1 = r.getMetadata().get("SomeHeader1");
assertEquals(1, header1.size());
assertEquals("\"some text, some more text\"", header1.get(0));
List<Object> header2 = r.getMetadata().get("SomeHeader2");
assertEquals(3, header2.size());
assertEquals("\"some text\"", header2.get(0));
assertEquals("\"quoted,text\"", header2.get(1));
assertEquals("\"even more text\"", header2.get(2));
List<Object> header3 = r.getMetadata().get("SomeHeader3");
assertEquals(1, header3.size());
assertEquals("\"some text, some more text with inlined \"\"", header3.get(0));
List<Object> header4 = r.getMetadata().get("SomeHeader4");
assertEquals(1, header4.size());
assertEquals("\"\"", header4.get(0));
}