@Test public void healthIsDownWithServerError() { when(restTemplate.headForHeaders("url")).thenThrow(new HttpServerErrorException(INTERNAL_SERVER_ERROR)); Health.Builder builder = new Health.Builder(); sut.doHealthCheck(builder); assertThat(builder.build().getStatus(), is(Status.DOWN)); }
@Override protected void doHealthCheck(Health.Builder builder) { try { restTemplate.headForHeaders(checkUrl); builder.up(); } catch (HttpServerErrorException | UnknownHttpStatusCodeException | ResourceAccessException e) { builder.down(e); } }
AuthServerHealthIndicator extends AbstractHealthIndicator { @Override protected void doHealthCheck(Health.Builder builder) { try { restTemplate.headForHeaders(checkUrl); builder.up(); } catch (HttpServerErrorException | UnknownHttpStatusCodeException | ResourceAccessException e) { builder.down(e); } } }
AuthServerHealthIndicator extends AbstractHealthIndicator { @Override protected void doHealthCheck(Health.Builder builder) { try { restTemplate.headForHeaders(checkUrl); builder.up(); } catch (HttpServerErrorException | UnknownHttpStatusCodeException | ResourceAccessException e) { builder.down(e); } } AuthServerHealthIndicator(RestTemplate restTemplate, String checkUrl); }
AuthServerHealthIndicator extends AbstractHealthIndicator { @Override protected void doHealthCheck(Health.Builder builder) { try { restTemplate.headForHeaders(checkUrl); builder.up(); } catch (HttpServerErrorException | UnknownHttpStatusCodeException | ResourceAccessException e) { builder.down(e); } } AuthServerHealthIndicator(RestTemplate restTemplate, String checkUrl);  }
AuthServerHealthIndicator extends AbstractHealthIndicator { @Override protected void doHealthCheck(Health.Builder builder) { try { restTemplate.headForHeaders(checkUrl); builder.up(); } catch (HttpServerErrorException | UnknownHttpStatusCodeException | ResourceAccessException e) { builder.down(e); } } AuthServerHealthIndicator(RestTemplate restTemplate, String checkUrl);   }