@Test void check_failsOnInvalidBootstrapServers() throws Exception {

    KafkaCollector.Builder builder =
      builder("fail_invalid_bootstrap_servers").bootstrapServers("1.1.1.1");

    try (KafkaCollector collector = builder.build()) {
      collector.start();

      Thread.sleep(1000L); // wait for crash

      assertThat(collector.check().error())
        .isInstanceOf(KafkaException.class)
        .hasMessage("Invalid url in bootstrap.servers: 1.1.1.1");
    }
  }
Don't raise exception (crash process), rather fail status check! This allows the health check
to report the cause.
zipkin-collector/kafka/src/test/java/zipkin2/collector/kafka/ITKafkaCollector.java