public void testHttpRedirect() throws Exception {
try {
template.requestBody("http://localhost:{{port}}/test", "Hello World", String.class);
fail("Should have thrown an exception");
} catch (RuntimeCamelException e) {
HttpOperationFailedException cause = assertIsInstanceOf(HttpOperationFailedException.class, e.getCause());
assertEquals(301, cause.getStatusCode());
assertEquals(true, cause.isRedirectError());
assertEquals(true, cause.hasRedirectLocation());
assertEquals("http://localhost:" + getPort() + "/newtest", cause.getRedirectLocation());
}
}