@Test(dataProvider = "notReadyStatus") public void returnsUnhealthyOnNotReadyStatus(StatusType statusType) { mockSendRequest(statusType); assertThat(target.isReady(), is(false)); }
@Override public boolean isReady() { try { for (Integer port : this.ports){ URI uri = UriUtils.buildUri(this.protocol, address, port, ServiceUriPaths.STATUS_SERVICE, null); Operation getOperation = Operation .createGet(uri) .setUri(uri) .forceRemote(); Operation completedOperation = ServiceUtils.doServiceOperation(service, getOperation); Status status = completedOperation.getBody(Status.class); logger.info("Xenon service returned status [{}:{}]: {}", address, port, status.getType()); if (status.getType() != StatusType.READY) { return false; } } return true; } catch (Throwable e) { logger.error("GET to Xenon service failed [{}:{}]: {}", address, ports, e); return false; } }
XenonBasedHealthChecker implements HealthChecker { @Override public boolean isReady() { try { for (Integer port : this.ports){ URI uri = UriUtils.buildUri(this.protocol, address, port, ServiceUriPaths.STATUS_SERVICE, null); Operation getOperation = Operation .createGet(uri) .setUri(uri) .forceRemote(); Operation completedOperation = ServiceUtils.doServiceOperation(service, getOperation); Status status = completedOperation.getBody(Status.class); logger.info("Xenon service returned status [{}:{}]: {}", address, port, status.getType()); if (status.getType() != StatusType.READY) { return false; } } return true; } catch (Throwable e) { logger.error("GET to Xenon service failed [{}:{}]: {}", address, ports, e); return false; } } }
XenonBasedHealthChecker implements HealthChecker { @Override public boolean isReady() { try { for (Integer port : this.ports){ URI uri = UriUtils.buildUri(this.protocol, address, port, ServiceUriPaths.STATUS_SERVICE, null); Operation getOperation = Operation .createGet(uri) .setUri(uri) .forceRemote(); Operation completedOperation = ServiceUtils.doServiceOperation(service, getOperation); Status status = completedOperation.getBody(Status.class); logger.info("Xenon service returned status [{}:{}]: {}", address, port, status.getType()); if (status.getType() != StatusType.READY) { return false; } } return true; } catch (Throwable e) { logger.error("GET to Xenon service failed [{}:{}]: {}", address, ports, e); return false; } } XenonBasedHealthChecker(Service service, String protocol, String address, int port);  XenonBasedHealthChecker(Service service, String protocol, String address, List<Integer> ports); }
XenonBasedHealthChecker implements HealthChecker { @Override public boolean isReady() { try { for (Integer port : this.ports){ URI uri = UriUtils.buildUri(this.protocol, address, port, ServiceUriPaths.STATUS_SERVICE, null); Operation getOperation = Operation .createGet(uri) .setUri(uri) .forceRemote(); Operation completedOperation = ServiceUtils.doServiceOperation(service, getOperation); Status status = completedOperation.getBody(Status.class); logger.info("Xenon service returned status [{}:{}]: {}", address, port, status.getType()); if (status.getType() != StatusType.READY) { return false; } } return true; } catch (Throwable e) { logger.error("GET to Xenon service failed [{}:{}]: {}", address, ports, e); return false; } } XenonBasedHealthChecker(Service service, String protocol, String address, int port);  XenonBasedHealthChecker(Service service, String protocol, String address, List<Integer> ports); @Override boolean isReady(); }
XenonBasedHealthChecker implements HealthChecker { @Override public boolean isReady() { try { for (Integer port : this.ports){ URI uri = UriUtils.buildUri(this.protocol, address, port, ServiceUriPaths.STATUS_SERVICE, null); Operation getOperation = Operation .createGet(uri) .setUri(uri) .forceRemote(); Operation completedOperation = ServiceUtils.doServiceOperation(service, getOperation); Status status = completedOperation.getBody(Status.class); logger.info("Xenon service returned status [{}:{}]: {}", address, port, status.getType()); if (status.getType() != StatusType.READY) { return false; } } return true; } catch (Throwable e) { logger.error("GET to Xenon service failed [{}:{}]: {}", address, ports, e); return false; } } XenonBasedHealthChecker(Service service, String protocol, String address, int port);  XenonBasedHealthChecker(Service service, String protocol, String address, List<Integer> ports); @Override boolean isReady();  }