RegExceptionHandler { public static void handleException(final Exception cause) { if (null == cause) { return; } if (isIgnoredException(cause) || null != cause.getCause() && isIgnoredException(cause.getCause())) { log.debug("Elastic job: ignored exception for: {}", cause.getMessage()); } else if (cause instanceof InterruptedException) { Thread.currentThread().interrupt(); } else { throw new RegException(cause); } }  static void handleException(final Exception cause);  }
@Test @Ignore public void assertHandleExceptionWithInterruptedException() { RegExceptionHandler.handleException(new InterruptedException()); }
@Test public void assertHandleExceptionWithNull() { RegExceptionHandler.handleException(null); }
@Test(expected = RegException.class) public void assertHandleExceptionWithOtherException() { RegExceptionHandler.handleException(new RuntimeException()); }
@Test public void assertHandleExceptionWithConnectionLossException() { RegExceptionHandler.handleException(new ConnectionLossException()); }
@Test public void assertHandleExceptionWithNoNodeException() { RegExceptionHandler.handleException(new NoNodeException()); }
@Test public void assertHandleExceptionWithNoNodeExistsException() { RegExceptionHandler.handleException(new NodeExistsException()); }
@Test public void assertHandleExceptionWithCausedConnectionLossException() { RegExceptionHandler.handleException(new RuntimeException(new ConnectionLossException())); }
@Test public void assertHandleExceptionWithCausedNoNodeException() { RegExceptionHandler.handleException(new RuntimeException(new NoNodeException())); }
@Test public void assertHandleExceptionWithCausedNoNodeExistsException() { RegExceptionHandler.handleException(new RuntimeException(new NodeExistsException())); }