@Test public void providesBackendStatuses() { BackendServices backendServices = newBackendServices( application("app", origin("app-01", "localhost", 9090), origin("app-02", "localhost", 9091))); MemoryBackedRegistry<BackendService> backendServicesRegistry = new MemoryBackedRegistry<>(); backendServices.forEach(backendServicesRegistry::add); DashboardData.Backend backend = newDashboardData(backendServicesRegistry).downstream().firstBackend(); eventBus.post(new OriginsSnapshot(id("app"), singleton(pool(origin("app", "app-01", "localhost", 9090))), emptyList(), singleton(pool(origin("app", "app-02", "localhost", 9091))))); assertThat(backend.statuses(), containsInAnyOrder("active", "disabled")); }
@JsonProperty("downstream") public Downstream downstream() { return downstream; }
DashboardData { @JsonProperty("downstream") public Downstream downstream() { return downstream; } }
DashboardData { @JsonProperty("downstream") public Downstream downstream() { return downstream; } DashboardData(MetricRegistry metrics, Registry<BackendService> backendServicesRegistry, String serverId, Version version, EventBus eventBus); }
DashboardData { @JsonProperty("downstream") public Downstream downstream() { return downstream; } DashboardData(MetricRegistry metrics, Registry<BackendService> backendServicesRegistry, String serverId, Version version, EventBus eventBus); @JsonProperty("server") Server server(); @JsonProperty("downstream") Downstream downstream(); @JsonProperty("publishTime") long publishTime(); }
DashboardData { @JsonProperty("downstream") public Downstream downstream() { return downstream; } DashboardData(MetricRegistry metrics, Registry<BackendService> backendServicesRegistry, String serverId, Version version, EventBus eventBus); @JsonProperty("server") Server server(); @JsonProperty("downstream") Downstream downstream(); @JsonProperty("publishTime") long publishTime();  }