SpringGatewayBridge { public Optional<BrokerClusterState> getClusterState() { if (clusterStateSupplier != null) { return Optional.ofNullable(clusterStateSupplier.get()); } else { return Optional.empty(); } }  void registerGatewayStatusSupplier(Supplier<Status> gatewayStatusSupplier); void registerClusterStateSupplier(Supplier<BrokerClusterState> clusterStateSupplier); Optional<Status> getGatewayStatus(); Optional<BrokerClusterState> getClusterState();  }
@Test public void shouldReturnNoClusterStateByDefault() { final var actual = sutBrigde.getClusterState(); assertThat(actual).describedAs("Cluster status when no supplier is set").isEmpty(); }