RegisterExceptionHandler { public static void handleException(final Exception cause) { if (isIgnoredException(cause) || isIgnoredException(cause.getCause())) { log.debug("Elastic config: ignored exception for: {}", cause.getMessage()); } else if (cause instanceof InterruptedException) { Thread.currentThread().interrupt(); } else { throw new RegisterException(cause); } }  static void handleException(final Exception cause);  }
@Test public void assertHandleExceptionWithInterruptedException() { RegisterExceptionHandler.handleException(new InterruptedException()); }
@Test(expected = RegisterException.class) public void assertHandleExceptionWithOtherException() { RegisterExceptionHandler.handleException(new RuntimeException()); }
@Test public void assertHandleExceptionWithConnectionLossException() { RegisterExceptionHandler.handleException(new ConnectionLossException()); }