Java 类org.springframework.boot.actuate.health.CompositeHealthIndicator 实例源码

项目:spring-cloud-stream-binder-redis    文件:RedisBinderModuleTests.java   
@Test
public void testParentConnectionFactoryInheritedByDefault() {
    context = SpringApplication.run(SimpleProcessor.class, "--server.port=0");
    BinderFactory<?> binderFactory = context.getBean(BinderFactory.class);
    Binder binder = binderFactory.getBinder(null);
    assertThat(binder, instanceOf(RedisMessageChannelBinder.class));
    DirectFieldAccessor binderFieldAccessor = new DirectFieldAccessor(binder);
    RedisConnectionFactory binderConnectionFactory =
            (RedisConnectionFactory) binderFieldAccessor.getPropertyValue("connectionFactory");
    assertThat(binderConnectionFactory, instanceOf(RedisConnectionFactory.class));
    RedisConnectionFactory connectionFactory = context.getBean(RedisConnectionFactory.class);
    assertThat(binderConnectionFactory, is(connectionFactory));
    CompositeHealthIndicator bindersHealthIndicator =
            context.getBean("bindersHealthIndicator", CompositeHealthIndicator.class);
    assertNotNull(bindersHealthIndicator);
    DirectFieldAccessor directFieldAccessor = new DirectFieldAccessor(bindersHealthIndicator);
    @SuppressWarnings("unchecked")
    Map<String,HealthIndicator> healthIndicators =
            (Map<String, HealthIndicator>) directFieldAccessor.getPropertyValue("indicators");
    assertThat(healthIndicators, hasKey("redis"));
    assertThat(healthIndicators.get("redis").health().getStatus(), equalTo(Status.UP));
}
项目:spring-cloud-stream-binder-redis    文件:RedisBinderModuleTests.java   
@Test
public void testParentConnectionFactoryInheritedIfOverridden() {
    context = new SpringApplication(SimpleProcessor.class, ConnectionFactoryConfiguration.class).run("--server.port=0");
    BinderFactory<?> binderFactory = context.getBean(BinderFactory.class);
    Binder binder = binderFactory.getBinder(null);
    assertThat(binder, instanceOf(RedisMessageChannelBinder.class));
    DirectFieldAccessor binderFieldAccessor = new DirectFieldAccessor(binder);
    RedisConnectionFactory binderConnectionFactory =
            (RedisConnectionFactory) binderFieldAccessor.getPropertyValue("connectionFactory");
    assertThat(binderConnectionFactory, is(MOCK_CONNECTION_FACTORY));
    RedisConnectionFactory connectionFactory = context.getBean(RedisConnectionFactory.class);
    assertThat(binderConnectionFactory, is(connectionFactory));
    CompositeHealthIndicator bindersHealthIndicator =
            context.getBean("bindersHealthIndicator", CompositeHealthIndicator.class);
    assertNotNull(bindersHealthIndicator);
    DirectFieldAccessor directFieldAccessor = new DirectFieldAccessor(bindersHealthIndicator);
    @SuppressWarnings("unchecked")
    Map<String,HealthIndicator> healthIndicators =
            (Map<String, HealthIndicator>) directFieldAccessor.getPropertyValue("indicators");
    assertThat(healthIndicators, hasKey("redis"));
    assertThat(healthIndicators.get("redis").health().getStatus(), equalTo(Status.UP));
}
项目:spring-cloud-stream-binder-rabbit    文件:RabbitBinderModuleTests.java   
@Test
public void testParentConnectionFactoryInheritedIfOverridden() {
    context = new SpringApplicationBuilder(SimpleProcessor.class, ConnectionFactoryConfiguration.class)
            .web(WebApplicationType.NONE)
            .run("--server.port=0");
    BinderFactory binderFactory = context.getBean(BinderFactory.class);
    Binder<?, ?, ?> binder = binderFactory.getBinder(null, MessageChannel.class);
    assertThat(binder).isInstanceOf(RabbitMessageChannelBinder.class);
    DirectFieldAccessor binderFieldAccessor = new DirectFieldAccessor(binder);
    ConnectionFactory binderConnectionFactory = (ConnectionFactory) binderFieldAccessor
            .getPropertyValue("connectionFactory");
    assertThat(binderConnectionFactory).isSameAs(MOCK_CONNECTION_FACTORY);
    ConnectionFactory connectionFactory = context.getBean(ConnectionFactory.class);
    assertThat(binderConnectionFactory).isSameAs(connectionFactory);
    CompositeHealthIndicator bindersHealthIndicator = context.getBean("bindersHealthIndicator",
            CompositeHealthIndicator.class);
    assertThat(bindersHealthIndicator).isNotNull();
    DirectFieldAccessor directFieldAccessor = new DirectFieldAccessor(bindersHealthIndicator);
    @SuppressWarnings("unchecked")
    Map<String, HealthIndicator> healthIndicators = (Map<String, HealthIndicator>) directFieldAccessor
            .getPropertyValue("indicators");
    assertThat(healthIndicators).containsKey("rabbit");
    // mock connection factory behaves as if down
    assertThat(healthIndicators.get("rabbit").health().getStatus()).isEqualTo(Status.DOWN);
}
项目:spring-cloud-stream    文件:HealthIndicatorsConfigurationTests.java   
@SuppressWarnings("rawtypes")
@Test
public void healthIndicatorsCheck() throws Exception {
    ConfigurableApplicationContext context = createBinderTestContext(new String[] { "binder1", "binder2" },
            "spring.cloud.stream.defaultBinder:binder2");
    Binder binder1 = context.getBean(BinderFactory.class).getBinder("binder1", MessageChannel.class);
    assertThat(binder1).isInstanceOf(StubBinder1.class);
    Binder binder2 = context.getBean(BinderFactory.class).getBinder("binder2", MessageChannel.class);
    assertThat(binder2).isInstanceOf(StubBinder2.class);
    CompositeHealthIndicator bindersHealthIndicator = context.getBean("bindersHealthIndicator",
            CompositeHealthIndicator.class);
    DirectFieldAccessor directFieldAccessor = new DirectFieldAccessor(bindersHealthIndicator);
    assertThat(bindersHealthIndicator).isNotNull();
    assertThat(context.getBean("testHealthIndicator1", CompositeHealthIndicator.class)).isNotNull();
    assertThat(context.getBean("testHealthIndicator2", CompositeHealthIndicator.class)).isNotNull();
    @SuppressWarnings("unchecked")
    Map<String, HealthIndicator> healthIndicators = (Map<String, HealthIndicator>) directFieldAccessor
            .getPropertyValue("indicators");
    assertThat(healthIndicators).containsKey("binder1");
    assertThat(healthIndicators.get("binder1").health().getStatus()).isEqualTo(Status.UP);
    assertThat(healthIndicators).containsKey("binder2");
    assertThat(healthIndicators.get("binder2").health().getStatus()).isEqualTo(Status.UNKNOWN);
    context.close();
}
项目:spring-cloud-stream    文件:HealthIndicatorsConfigurationTests.java   
@SuppressWarnings("rawtypes")
@Test
public void healthIndicatorsCheckWhenDisabled() throws Exception {
    ConfigurableApplicationContext context = createBinderTestContext(
            new String[] { "binder1", "binder2" },
            "spring.cloud.stream.defaultBinder:binder2",
            "management.health.binders.enabled:false");

    Binder binder1 = context.getBean(BinderFactory.class).getBinder("binder1", MessageChannel.class);
    assertThat(binder1).isInstanceOf(StubBinder1.class);
    Binder binder2 = context.getBean(BinderFactory.class).getBinder("binder2", MessageChannel.class);
    assertThat(binder2).isInstanceOf(StubBinder2.class);
    try {
        context.getBean("bindersHealthIndicator", CompositeHealthIndicator.class);
        fail("The 'bindersHealthIndicator' bean should have not been defined");
    }
    catch (NoSuchBeanDefinitionException e) {
    }
    assertThat(context.getBean("testHealthIndicator1", CompositeHealthIndicator.class)).isNotNull();
    assertThat(context.getBean("testHealthIndicator2", CompositeHealthIndicator.class)).isNotNull();
    context.close();
}
项目:extended-actuator-health-endpoints    文件:ExtendedHealthEndpoint.java   
private Health internalInvokeHealthIndicators() {
    CompositeHealthIndicator healthIndicator = new CompositeHealthIndicator(
            healthAggregator);
    for (Map.Entry<String, T> h : collectIndicators().entrySet()) {
        healthIndicator.addHealthIndicator(getKey(h.getKey()), h.getValue());
    }
    return healthIndicator.health();
}
项目:generator-jhipster-grpc    文件:_HealthService.java   
public HealthService(HealthAggregator healthAggregator, Map<String, org.springframework.boot.actuate.health.HealthIndicator> healthIndicators) {
    Assert.notNull(healthAggregator, "HealthAggregator must not be null");
    Assert.notNull(healthIndicators, "HealthIndicators must not be null");
    CompositeHealthIndicator healthIndicator = new CompositeHealthIndicator(
        healthAggregator);
    for (Map.Entry<String, org.springframework.boot.actuate.health.HealthIndicator> entry : healthIndicators.entrySet()) {
        healthIndicator.addHealthIndicator(getKey(entry.getKey()), entry.getValue());
    }
    this.healthIndicators = healthIndicators;
    this.healthIndicator = healthIndicator;
}
项目:spring-cloud-stream-binder-redis    文件:RedisBinderModuleTests.java   
@Test
public void testParentConnectionFactoryNotInheritedByCustomizedBinders() {
    List<String> params = new ArrayList<>();
    params.add("--spring.cloud.stream.input.binder=custom");
    params.add("--spring.cloud.stream.output.binder=custom");
    params.add("--spring.cloud.stream.binders.custom.type=redis");
    params.add("--spring.cloud.stream.binders.custom.environment.foo=bar");
    params.add("--server.port=0");
    context = SpringApplication.run(SimpleProcessor.class, params.toArray(new String[]{}));
    BinderFactory<?> binderFactory = context.getBean(BinderFactory.class);
    Binder binder = binderFactory.getBinder(null);
    assertThat(binder, instanceOf(RedisMessageChannelBinder.class));
    DirectFieldAccessor binderFieldAccessor = new DirectFieldAccessor(binder);
    RedisConnectionFactory binderConnectionFactory =
            (RedisConnectionFactory) binderFieldAccessor.getPropertyValue("connectionFactory");
    RedisConnectionFactory connectionFactory = context.getBean(RedisConnectionFactory.class);
    assertThat(binderConnectionFactory, not(is(connectionFactory)));
    CompositeHealthIndicator bindersHealthIndicator =
            context.getBean("bindersHealthIndicator", CompositeHealthIndicator.class);
    assertNotNull(bindersHealthIndicator);
    DirectFieldAccessor directFieldAccessor = new DirectFieldAccessor(bindersHealthIndicator);
    @SuppressWarnings("unchecked")
    Map<String,HealthIndicator> healthIndicators =
            (Map<String, HealthIndicator>) directFieldAccessor.getPropertyValue("indicators");
    assertThat(healthIndicators, hasKey("custom"));
    assertThat(healthIndicators.get("custom").health().getStatus(), equalTo(Status.UP));
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:CompositeHealthIndicatorConfiguration.java   
protected HealthIndicator createHealthIndicator(Map<String, S> beans) {
    if (beans.size() == 1) {
        return createHealthIndicator(beans.values().iterator().next());
    }
    CompositeHealthIndicator composite = new CompositeHealthIndicator(
            this.healthAggregator);
    for (Map.Entry<String, S> entry : beans.entrySet()) {
        composite.addHealthIndicator(entry.getKey(),
                createHealthIndicator(entry.getValue()));
    }
    return composite;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthEndpoint.java   
/**
 * Create a new {@link HealthIndicator} instance.
 * @param healthAggregator the health aggregator
 * @param healthIndicators the health indicators
 */
public HealthEndpoint(HealthAggregator healthAggregator,
        Map<String, HealthIndicator> healthIndicators) {
    super("health", false);
    Assert.notNull(healthAggregator, "HealthAggregator must not be null");
    Assert.notNull(healthIndicators, "HealthIndicators must not be null");
    CompositeHealthIndicator healthIndicator = new CompositeHealthIndicator(
            healthAggregator);
    for (Map.Entry<String, HealthIndicator> entry : healthIndicators.entrySet()) {
        healthIndicator.addHealthIndicator(getKey(entry.getKey()), entry.getValue());
    }
    this.healthIndicator = healthIndicator;
}
项目:spring-cloud-stream-binder-rabbit    文件:RabbitBinderModuleTests.java   
@Test
public void testParentConnectionFactoryInheritedByDefault() {
    context = new SpringApplicationBuilder(SimpleProcessor.class)
            .web(WebApplicationType.NONE)
            .run("--server.port=0");
    BinderFactory binderFactory = context.getBean(BinderFactory.class);
    Binder<?, ?, ?> binder = binderFactory.getBinder(null, MessageChannel.class);
    assertThat(binder).isInstanceOf(RabbitMessageChannelBinder.class);
    DirectFieldAccessor binderFieldAccessor = new DirectFieldAccessor(binder);
    ConnectionFactory binderConnectionFactory = (ConnectionFactory) binderFieldAccessor
            .getPropertyValue("connectionFactory");
    assertThat(binderConnectionFactory).isInstanceOf(CachingConnectionFactory.class);
    ConnectionFactory connectionFactory = context.getBean(ConnectionFactory.class);
    assertThat(binderConnectionFactory).isSameAs(connectionFactory);

    ConnectionFactory producerConnectionFactory = (ConnectionFactory) binderFieldAccessor
            .getPropertyValue("producerConnectionFactory");
    assertThat(producerConnectionFactory).isNotSameAs(connectionFactory);

    CompositeHealthIndicator bindersHealthIndicator = context.getBean("bindersHealthIndicator",
            CompositeHealthIndicator.class);
    DirectFieldAccessor directFieldAccessor = new DirectFieldAccessor(bindersHealthIndicator);
    assertThat(bindersHealthIndicator).isNotNull();
    @SuppressWarnings("unchecked")
    Map<String, HealthIndicator> healthIndicators = (Map<String, HealthIndicator>) directFieldAccessor
            .getPropertyValue("indicators");
    assertThat(healthIndicators).containsKey(("rabbit"));
    assertThat(healthIndicators.get("rabbit").health().getStatus()).isEqualTo((Status.UP));
}
项目:spring-cloud-stream-binder-rabbit    文件:RabbitBinderModuleTests.java   
@Test
@SuppressWarnings("unchecked")
public void testParentConnectionFactoryInheritedByDefaultAndRabbitSettingsPropagated() {
    context = new SpringApplicationBuilder(SimpleProcessor.class)
            .web(WebApplicationType.NONE)
            .run("--server.port=0",
                    "--spring.cloud.stream.rabbit.bindings.input.consumer.transacted=true",
                    "--spring.cloud.stream.rabbit.bindings.output.producer.transacted=true");
    BinderFactory binderFactory = context.getBean(BinderFactory.class);
    Binder<?, ?, ?> binder = binderFactory.getBinder(null, MessageChannel.class);
    assertThat(binder).isInstanceOf(RabbitMessageChannelBinder.class);
    BindingService bindingService = context.getBean(BindingService.class);
    DirectFieldAccessor channelBindingServiceAccessor = new DirectFieldAccessor(bindingService);
    Map<String, List<Binding<MessageChannel>>> consumerBindings = (Map<String, List<Binding<MessageChannel>>>) channelBindingServiceAccessor
            .getPropertyValue("consumerBindings");
    Binding<MessageChannel> inputBinding = consumerBindings.get("input").get(0);
    SimpleMessageListenerContainer container = TestUtils.getPropertyValue(inputBinding,
            "lifecycle.messageListenerContainer", SimpleMessageListenerContainer.class);
    assertThat(TestUtils.getPropertyValue(container, "transactional", Boolean.class)).isTrue();
    Map<String, Binding<MessageChannel>> producerBindings = (Map<String, Binding<MessageChannel>>) TestUtils
            .getPropertyValue(bindingService, "producerBindings");
    Binding<MessageChannel> outputBinding = producerBindings.get("output");
    assertThat(TestUtils.getPropertyValue(outputBinding, "lifecycle.amqpTemplate.transactional",
            Boolean.class)).isTrue();
    DirectFieldAccessor binderFieldAccessor = new DirectFieldAccessor(binder);
    ConnectionFactory binderConnectionFactory = (ConnectionFactory) binderFieldAccessor
            .getPropertyValue("connectionFactory");
    assertThat(binderConnectionFactory).isInstanceOf(CachingConnectionFactory.class);
    ConnectionFactory connectionFactory = context.getBean(ConnectionFactory.class);
    assertThat(binderConnectionFactory).isSameAs(connectionFactory);
    CompositeHealthIndicator bindersHealthIndicator = context.getBean("bindersHealthIndicator",
            CompositeHealthIndicator.class);
    DirectFieldAccessor directFieldAccessor = new DirectFieldAccessor(bindersHealthIndicator);
    assertThat(bindersHealthIndicator).isNotNull();
    Map<String, HealthIndicator> healthIndicators = (Map<String, HealthIndicator>) directFieldAccessor
            .getPropertyValue("indicators");
    assertThat(healthIndicators).containsKey("rabbit");
    assertThat(healthIndicators.get("rabbit").health().getStatus()).isEqualTo(Status.UP);
}
项目:spring-boot-concourse    文件:HealthIndicatorAutoConfiguration.java   
protected HealthIndicator createHealthIndicator(Map<String, S> beans) {
    if (beans.size() == 1) {
        return createHealthIndicator(beans.values().iterator().next());
    }
    CompositeHealthIndicator composite = new CompositeHealthIndicator(
            this.healthAggregator);
    for (Map.Entry<String, S> entry : beans.entrySet()) {
        composite.addHealthIndicator(entry.getKey(),
                createHealthIndicator(entry.getValue()));
    }
    return composite;
}
项目:spring-boot-concourse    文件:HealthEndpoint.java   
/**
 * Create a new {@link HealthIndicator} instance.
 * @param healthAggregator the health aggregator
 * @param healthIndicators the health indicators
 */
public HealthEndpoint(HealthAggregator healthAggregator,
        Map<String, HealthIndicator> healthIndicators) {
    super("health", false);
    Assert.notNull(healthAggregator, "HealthAggregator must not be null");
    Assert.notNull(healthIndicators, "HealthIndicators must not be null");
    CompositeHealthIndicator healthIndicator = new CompositeHealthIndicator(
            healthAggregator);
    for (Map.Entry<String, HealthIndicator> entry : healthIndicators.entrySet()) {
        healthIndicator.addHealthIndicator(getKey(entry.getKey()), entry.getValue());
    }
    this.healthIndicator = healthIndicator;
}
项目:contestparser    文件:HealthIndicatorAutoConfiguration.java   
protected HealthIndicator createHealthIndicator(Map<String, S> beans) {
    if (beans.size() == 1) {
        return createHealthIndicator(beans.values().iterator().next());
    }
    CompositeHealthIndicator composite = new CompositeHealthIndicator(
            this.healthAggregator);
    for (Map.Entry<String, S> entry : beans.entrySet()) {
        composite.addHealthIndicator(entry.getKey(),
                createHealthIndicator(entry.getValue()));
    }
    return composite;
}
项目:contestparser    文件:HealthEndpoint.java   
/**
 * Create a new {@link HealthIndicator} instance.
 * @param healthAggregator the health aggregator
 * @param healthIndicators the health indicators
 */
public HealthEndpoint(HealthAggregator healthAggregator,
        Map<String, HealthIndicator> healthIndicators) {
    super("health", false);
    Assert.notNull(healthAggregator, "HealthAggregator must not be null");
    Assert.notNull(healthIndicators, "HealthIndicators must not be null");
    CompositeHealthIndicator healthIndicator = new CompositeHealthIndicator(
            healthAggregator);
    for (Map.Entry<String, HealthIndicator> entry : healthIndicators.entrySet()) {
        healthIndicator.addHealthIndicator(getKey(entry.getKey()), entry.getValue());
    }
    this.healthIndicator = healthIndicator;
}
项目:spring-boot-health-indicators    文件:ResilienceHealthAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean(RabbitMQHealthIndicator.class)
public HealthIndicator rabbitMQHealthIndicator() {
  if (this.rabbitTemplates.size() == 1) {
    return new RabbitMQHealthIndicator(this.rabbitTemplates.values().iterator().next(), rabbitMQManagement, properties);
  }

  CompositeHealthIndicator composite = new CompositeHealthIndicator(this.healthAggregator);

  rabbitTemplates.entrySet().stream().
    forEach(entry -> composite.addHealthIndicator(entry.getKey(), new RabbitMQHealthIndicator(entry.getValue(), rabbitMQManagement, properties)));

  return composite;
}
项目:spring-cloud-stream    文件:BindersHealthIndicatorAutoConfiguration.java   
@Override
public void afterBinderContextInitialized(String binderConfigurationName,
        ConfigurableApplicationContext binderContext) {
    if (this.bindersHealthIndicator != null) {
        OrderedHealthAggregator healthAggregator = new OrderedHealthAggregator();
        Map<String, HealthIndicator> indicators = binderContext.getBeansOfType(HealthIndicator.class);
        // if there are no health indicators in the child context, we just mark
        // the binder's health as unknown
        // this can happen due to the fact that configuration is inherited
        HealthIndicator binderHealthIndicator = indicators.isEmpty() ? new DefaultHealthIndicator()
                : new CompositeHealthIndicator(healthAggregator, indicators);
        this.bindersHealthIndicator.addHealthIndicator(binderConfigurationName, binderHealthIndicator);
    }
}
项目:spring-cloud-stream-binder-rabbit    文件:RabbitBinderModuleTests.java   
@Test
public void testParentConnectionFactoryNotInheritedByCustomizedBindersAndProducerRetryBootProperties() {
    List<String> params = new ArrayList<>();
    params.add("--spring.cloud.stream.input.binder=custom");
    params.add("--spring.cloud.stream.output.binder=custom");
    params.add("--spring.cloud.stream.binders.custom.type=rabbit");
    params.add("--spring.cloud.stream.binders.custom.environment.foo=bar");
    params.add("--server.port=0");
    params.add("--spring.rabbitmq.template.retry.enabled=true");
    params.add("--spring.rabbitmq.template.retry.maxAttempts=2");
    params.add("--spring.rabbitmq.template.retry.initial-interval=1000");
    params.add("--spring.rabbitmq.template.retry.multiplier=1.1");
    params.add("--spring.rabbitmq.template.retry.max-interval=3000");
    context = new SpringApplicationBuilder(SimpleProcessor.class)
            .web(WebApplicationType.NONE)
            .run(params.toArray(new String[params.size()]));
    BinderFactory binderFactory = context.getBean(BinderFactory.class);
    @SuppressWarnings("unchecked")
    Binder<MessageChannel, ExtendedConsumerProperties<RabbitConsumerProperties>, ExtendedProducerProperties<RabbitProducerProperties>> binder = (Binder<MessageChannel, ExtendedConsumerProperties<RabbitConsumerProperties>, ExtendedProducerProperties<RabbitProducerProperties>>) binderFactory
            .getBinder(null, MessageChannel.class);
    assertThat(binder).isInstanceOf(RabbitMessageChannelBinder.class);
    DirectFieldAccessor binderFieldAccessor = new DirectFieldAccessor(binder);
    ConnectionFactory binderConnectionFactory = (ConnectionFactory) binderFieldAccessor
            .getPropertyValue("connectionFactory");
    ConnectionFactory connectionFactory = context.getBean(ConnectionFactory.class);
    assertThat(binderConnectionFactory).isNotSameAs(connectionFactory);
    CompositeHealthIndicator bindersHealthIndicator = context.getBean("bindersHealthIndicator",
            CompositeHealthIndicator.class);
    assertThat(bindersHealthIndicator);
    DirectFieldAccessor directFieldAccessor = new DirectFieldAccessor(bindersHealthIndicator);
    @SuppressWarnings("unchecked")
    Map<String, HealthIndicator> healthIndicators = (Map<String, HealthIndicator>) directFieldAccessor
            .getPropertyValue("indicators");
    assertThat(healthIndicators).containsKey("custom");
    assertThat(healthIndicators.get("custom").health().getStatus()).isEqualTo(Status.UP);
    Binding<MessageChannel> binding = binder.bindProducer("foo", new DirectChannel(),
            new ExtendedProducerProperties<>(new RabbitProducerProperties()));
    RetryTemplate template = TestUtils.getPropertyValue(binding, "lifecycle.amqpTemplate.retryTemplate",
            RetryTemplate.class);
    assertThat(template).isNotNull();
    SimpleRetryPolicy retryPolicy = TestUtils.getPropertyValue(template, "retryPolicy", SimpleRetryPolicy.class);
    ExponentialBackOffPolicy backOff = TestUtils.getPropertyValue(template, "backOffPolicy",
            ExponentialBackOffPolicy.class);
    assertThat(retryPolicy.getMaxAttempts()).isEqualTo(2);
    assertThat(backOff.getInitialInterval()).isEqualTo(1000L);
    assertThat(backOff.getMultiplier()).isEqualTo(1.1);
    assertThat(backOff.getMaxInterval()).isEqualTo(3000L);
    binding.unbind();
    context.close();
}
项目:spring-cloud-stream    文件:BindersHealthIndicatorAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean(name = "bindersHealthIndicator")
public CompositeHealthIndicator bindersHealthIndicator() {
    return new CompositeHealthIndicator(new OrderedHealthAggregator());
}
项目:spring-cloud-stream    文件:BindersHealthIndicatorAutoConfiguration.java   
@Bean
public DefaultBinderFactory.Listener bindersHealthIndicatorListener(
        @Qualifier("bindersHealthIndicator") CompositeHealthIndicator compositeHealthIndicator) {
    return new BindersHealthIndicatorListener(compositeHealthIndicator);
}
项目:spring-cloud-stream    文件:BindersHealthIndicatorAutoConfiguration.java   
BindersHealthIndicatorListener(CompositeHealthIndicator bindersHealthIndicator) {
    this.bindersHealthIndicator = bindersHealthIndicator;
}
项目:spring-cloud-stream    文件:HealthIndicatorsConfigurationTests.java   
@Bean
public CompositeHealthIndicator testHealthIndicator1() {
    return new CompositeHealthIndicator(new OrderedHealthAggregator());
}
项目:spring-cloud-stream    文件:HealthIndicatorsConfigurationTests.java   
@Bean
public CompositeHealthIndicator testHealthIndicator2() {
    return new CompositeHealthIndicator(new OrderedHealthAggregator());
}
项目:kork    文件:BootHealthCheckHandler.java   
public BootHealthCheckHandler(ApplicationInfoManager applicationInfoManager,
                              HealthAggregator aggregator,
                              Map<String, HealthIndicator> healthIndicators) {
  this.applicationInfoManager = Objects.requireNonNull(applicationInfoManager, "applicationInfoManager");
  this.aggregateHealth = new CompositeHealthIndicator(aggregator, healthIndicators);
}
项目:spring-cloud-netflix    文件:EurekaHealthCheckHandler.java   
public EurekaHealthCheckHandler(HealthAggregator healthAggregator) {
    Assert.notNull(healthAggregator, "HealthAggregator must not be null");
    this.healthIndicator = new CompositeHealthIndicator(healthAggregator);
}
项目:spring-cloud-netflix    文件:EurekaHealthCheckHandler.java   
protected CompositeHealthIndicator getHealthIndicator() {
    return healthIndicator;
}