@Test
public void testFailedHttpGet() throws Exception {
LOG.info("STARTING HTTP GET (FAIL) TEST...");
Map<String, Object> conf = getConf(0, 0, 0);
try (DRPCServer server = new DRPCServer(conf, new StormMetricsRegistry())) {
server.start();
Thread.sleep(2000);
try (DRPCInvocationsClient invoke = new DRPCInvocationsClient(conf, "localhost", server.getDrpcInvokePort())) {
Future<String> found = exec.submit(() -> doGet(server.getHttpServerPort(), "testing", "test"));
DRPCRequest request = getNextAvailableRequest(invoke, "testing");
assertNotNull(request);
assertEquals("test", request.get_func_args());
assertNotNull(request.get_request_id());
invoke.getClient().failRequest(request.get_request_id());
try {
found.get(1000, TimeUnit.MILLISECONDS);
fail("exec did not throw an exception");
} catch (ExecutionException e) {
LOG.warn("Got Expected Exception", e);
}
}
}
}
}