public void testRequestTimeoutAndOk() throws Exception {
try {
template.requestBody("netty4:tcp://localhost:{{port}}?textline=true&sync=true&requestTimeout=1000", "Hello Camel", String.class);
fail("Should have thrown exception");
} catch (CamelExecutionException e) {
ReadTimeoutException cause = assertIsInstanceOf(ReadTimeoutException.class, e.getCause());
assertNotNull(cause);
}
// now we try again but this time the is no delay on server and thus faster
String out = template.requestBody("netty4:tcp://localhost:{{port}}?textline=true&sync=true&requestTimeout=1000", "Hello World", String.class);