// technically speaking, for these test cases, the client should return an error
// however, servers do send bad data from time to time so we try to be forgiving
for (int i = 0; i < 3; i++) {
WebClient wc = WebClient.create(endpointAddress);
WebClient.getConfig(wc).getRequestContext().put("org.apache.cxf.http.header.split", true);
Response r = wc.query("type", Integer.toString(i)).get();
assertEquals(responses[i], r.getMetadata().get("SomeHeader" + i).get(0));
}
// this test currently returns the WRONG result per RFC2616, however it is correct
// per the discussion in CXF-3518
WebClient wc = WebClient.create(endpointAddress);
WebClient.getConfig(wc).getRequestContext().put("org.apache.cxf.http.header.split", true);
Response r3 = wc.query("type", "3").get();
List<Object> r3values = r3.getMetadata().get("SomeHeader3");
assertEquals(4, r3values.size());
assertEquals("some text", r3values.get(0));
assertEquals("\"other quoted\"", r3values.get(1));
assertEquals("text", r3values.get(2));
assertEquals("blah", r3values.get(3));