@Test public void checkUnhealthyNoConnection() { assertThat(healthChecker.check(connectionFactory).isHealthy(), is(false)); }
public Result check(ConnectionFactory connectionFactory) { try (Connection connection = connectionFactory.createConnection()) { if (connection == null) { return Result.unhealthy("No connection could be established"); } connection.start(); return Result.healthy(); } catch (JMSException e) { return Result.unhealthy(e); } }
JmsConnectionHealthChecker { public Result check(ConnectionFactory connectionFactory) { try (Connection connection = connectionFactory.createConnection()) { if (connection == null) { return Result.unhealthy("No connection could be established"); } connection.start(); return Result.healthy(); } catch (JMSException e) { return Result.unhealthy(e); } } }
JmsConnectionHealthChecker { public Result check(ConnectionFactory connectionFactory) { try (Connection connection = connectionFactory.createConnection()) { if (connection == null) { return Result.unhealthy("No connection could be established"); } connection.start(); return Result.healthy(); } catch (JMSException e) { return Result.unhealthy(e); } }  }
JmsConnectionHealthChecker { public Result check(ConnectionFactory connectionFactory) { try (Connection connection = connectionFactory.createConnection()) { if (connection == null) { return Result.unhealthy("No connection could be established"); } connection.start(); return Result.healthy(); } catch (JMSException e) { return Result.unhealthy(e); } }  Result check(ConnectionFactory connectionFactory); }
JmsConnectionHealthChecker { public Result check(ConnectionFactory connectionFactory) { try (Connection connection = connectionFactory.createConnection()) { if (connection == null) { return Result.unhealthy("No connection could be established"); } connection.start(); return Result.healthy(); } catch (JMSException e) { return Result.unhealthy(e); } }  Result check(ConnectionFactory connectionFactory);  }