@Test
public void testGetCustomers() throws Exception {
HttpGet get = new HttpGet("http://localhost:" + getPort() + "/CxfRsRouterTest/route/customerservice/customers/");
get.addHeader("Accept" , "application/xml");
CloseableHttpClient httpclient = HttpClientBuilder.create().build();
try {
HttpResponse response = httpclient.execute(get);
assertEquals(200, response.getStatusLine().getStatusCode());
// order returned can differ on OS so match for both orders
String s = EntityUtils.toString(response.getEntity());
assertNotNull(s);
boolean m1 = s.endsWith("<Customers><Customer><id>123</id><name>John</name></Customer><Customer><id>113</id><name>Dan</name></Customer></Customers>");
boolean m2 = s.endsWith("<Customers><Customer><id>113</id><name>Dan</name></Customer><Customer><id>123</id><name>John</name></Customer></Customers>");
if (!m1 && !m2) {
fail("Not expected body returned: " + s);
}
} finally {
httpclient.close();
}
}