@Test public void check_failsOnRuntimeException_registration() { RuntimeException exception = new RuntimeException(); EventHubCollector collector = new EventHubCollector( new LazyFuture() { @Override protected Future<?> compute() { registration.completeExceptionally(exception); return registration; } }); CheckResult result = collector.check(); assertThat(result.error()).isEqualTo(exception); }
@Override public CheckResult check() { try { Future<?> registrationFuture = lazyRegisterEventProcessorFactoryWithHost.get(); registrationFuture.get(); return CheckResult.OK; } catch (RuntimeException e) { return CheckResult.failed(e); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return CheckResult.failed(e); } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof Error) throw (Error) cause; return CheckResult.failed(cause); } }
EventHubCollector extends CollectorComponent { @Override public CheckResult check() { try { Future<?> registrationFuture = lazyRegisterEventProcessorFactoryWithHost.get(); registrationFuture.get(); return CheckResult.OK; } catch (RuntimeException e) { return CheckResult.failed(e); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return CheckResult.failed(e); } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof Error) throw (Error) cause; return CheckResult.failed(cause); } } }
EventHubCollector extends CollectorComponent { @Override public CheckResult check() { try { Future<?> registrationFuture = lazyRegisterEventProcessorFactoryWithHost.get(); registrationFuture.get(); return CheckResult.OK; } catch (RuntimeException e) { return CheckResult.failed(e); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return CheckResult.failed(e); } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof Error) throw (Error) cause; return CheckResult.failed(cause); } } EventHubCollector(Builder builder);   EventHubCollector(
      LazyRegisterEventProcessorFactoryWithHost lazyRegisterEventProcessorFactoryWithHost); }
EventHubCollector extends CollectorComponent { @Override public CheckResult check() { try { Future<?> registrationFuture = lazyRegisterEventProcessorFactoryWithHost.get(); registrationFuture.get(); return CheckResult.OK; } catch (RuntimeException e) { return CheckResult.failed(e); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return CheckResult.failed(e); } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof Error) throw (Error) cause; return CheckResult.failed(cause); } } EventHubCollector(Builder builder);   EventHubCollector(
      LazyRegisterEventProcessorFactoryWithHost lazyRegisterEventProcessorFactoryWithHost); static Builder newBuilder(); @Override EventHubCollector start(); @Override CheckResult check(); @Override void close(); }
EventHubCollector extends CollectorComponent { @Override public CheckResult check() { try { Future<?> registrationFuture = lazyRegisterEventProcessorFactoryWithHost.get(); registrationFuture.get(); return CheckResult.OK; } catch (RuntimeException e) { return CheckResult.failed(e); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return CheckResult.failed(e); } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof Error) throw (Error) cause; return CheckResult.failed(cause); } } EventHubCollector(Builder builder);   EventHubCollector(
      LazyRegisterEventProcessorFactoryWithHost lazyRegisterEventProcessorFactoryWithHost); static Builder newBuilder(); @Override EventHubCollector start(); @Override CheckResult check(); @Override void close();  }