@Test public void checkStatusNotFound() throws Exception { manager.setStatus(SERVICE1, ServingStatus.SERVING); HealthCheckRequest request = HealthCheckRequest.newBuilder().setService(SERVICE2).build(); try { blockingStub.withDeadlineAfter(5, TimeUnit.SECONDS).check(request); fail("Should've failed"); } catch (StatusRuntimeException e) { assertThat(e.getStatus().getCode()).isEqualTo(Status.Code.NOT_FOUND); } assertThat(service.numWatchersForTest(SERVICE2)).isEqualTo(0); }
public void setStatus(String service, ServingStatus status) { checkNotNull(status, "status"); healthService.setStatus(service, status); }
HealthStatusManager { public void setStatus(String service, ServingStatus status) { checkNotNull(status, "status"); healthService.setStatus(service, status); } }
HealthStatusManager { public void setStatus(String service, ServingStatus status) { checkNotNull(status, "status"); healthService.setStatus(service, status); } HealthStatusManager(); }
HealthStatusManager { public void setStatus(String service, ServingStatus status) { checkNotNull(status, "status"); healthService.setStatus(service, status); } HealthStatusManager(); BindableService getHealthService(); void setStatus(String service, ServingStatus status); void clearStatus(String service); }
HealthStatusManager { public void setStatus(String service, ServingStatus status) { checkNotNull(status, "status"); healthService.setStatus(service, status); } HealthStatusManager(); BindableService getHealthService(); void setStatus(String service, ServingStatus status); void clearStatus(String service); static final String SERVICE_NAME_ALL_SERVICES; }