Future<Collection<StepExecution>> resultsFuture = poller.poll(callback);
@Test public void testWithError() throws Exception { Callable<String> callback = new Callable<String>() { @Override public String call() throws Exception { Set<String> executions = new HashSet<>(repository); if (executions.isEmpty()) { return null; } throw new RuntimeException("Expected"); } }; Poller<String> poller = new DirectPoller<>(100L); sleepAndCreateStringInBackground(500L); try { String value = poller.poll(callback).get(1000L, TimeUnit.MILLISECONDS); assertEquals(null, value); fail("Expected ExecutionException"); } catch (ExecutionException e) { assertEquals("Expected", e.getCause().getMessage()); } }
Future<Collection<StepExecution>> resultsFuture = poller.poll(callback);
Future<Collection<StepExecution>> resultsFuture = poller.poll(callback);