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

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notElasticsearchHealthIndicator() {
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.elasticsearch.enabled:false",
            "spring.data.elasticsearch.properties.path.home:target",
            "management.health.diskspace.enabled:false");
    this.context.register(JestClientConfiguration.class,
            JestAutoConfiguration.class, ElasticsearchAutoConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    this.context.refresh();

    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(1);
    assertThat(beans.values().iterator().next().getClass())
            .isEqualTo(ApplicationHealthIndicator.class);
}
项目:spring-boot-concourse    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notElasticSearchHealthIndicator() {
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.elasticsearch.enabled:false",
            "spring.data.elasticsearch.properties.path.home:target",
            "management.health.diskspace.enabled:false");
    this.context.register(ElasticsearchAutoConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    this.context.refresh();

    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(1);
    assertThat(beans.values().iterator().next().getClass())
            .isEqualTo(ApplicationHealthIndicator.class);
}
项目:contestparser    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notElasticSearchHealthIndicator() {
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.elasticsearch.enabled:false",
            "spring.data.elasticsearch.properties.path.data:target/data",
            "spring.data.elasticsearch.properties.path.logs:target/logs",
            "management.health.diskspace.enabled:false");
    this.context.register(ElasticsearchAutoConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    this.context.refresh();

    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertEquals(1, beans.size());
    assertEquals(ApplicationHealthIndicator.class,
            beans.values().iterator().next().getClass());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void defaultHealthIndicator() {
    this.context.register(HealthIndicatorAutoConfiguration.class,
            ManagementServerProperties.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.diskspace.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(1);
    assertThat(beans.values().iterator().next().getClass())
            .isEqualTo(ApplicationHealthIndicator.class);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void defaultHealthIndicatorsDisabled() {
    this.context.register(HealthIndicatorAutoConfiguration.class,
            ManagementServerProperties.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.defaults.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(1);
    assertThat(beans.values().iterator().next().getClass())
            .isEqualTo(ApplicationHealthIndicator.class);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notRedisHealthIndicator() {
    this.context.register(RedisAutoConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.redis.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(1);
    assertThat(beans.values().iterator().next().getClass())
            .isEqualTo(ApplicationHealthIndicator.class);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notMongoHealthIndicator() {
    this.context.register(MongoAutoConfiguration.class,
            ManagementServerProperties.class, MongoDataAutoConfiguration.class,
            HealthIndicatorAutoConfiguration.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.mongo.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(1);
    assertThat(beans.values().iterator().next().getClass())
            .isEqualTo(ApplicationHealthIndicator.class);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notDataSourceHealthIndicator() {
    this.context.register(EmbeddedDataSourceConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.db.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(1);
    assertThat(beans.values().iterator().next().getClass())
            .isEqualTo(ApplicationHealthIndicator.class);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notRabbitHealthIndicator() {
    this.context.register(RabbitAutoConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.rabbit.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(1);
    assertThat(beans.values().iterator().next().getClass())
            .isEqualTo(ApplicationHealthIndicator.class);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notSolrHealthIndicator() {
    this.context.register(SolrAutoConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.solr.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(1);
    assertThat(beans.values().iterator().next().getClass())
            .isEqualTo(ApplicationHealthIndicator.class);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notMailHealthIndicator() {
    EnvironmentTestUtils.addEnvironment(this.context,
            "spring.mail.host:smtp.acme.org", "management.health.mail.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.register(MailSenderAutoConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    this.context.refresh();

    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(1);
    assertThat(beans.values().iterator().next().getClass())
            .isEqualTo(ApplicationHealthIndicator.class);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notJmsHealthIndicator() {
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.jms.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.register(ActiveMQAutoConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    this.context.refresh();

    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(1);
    assertThat(beans.values().iterator().next().getClass())
            .isEqualTo(ApplicationHealthIndicator.class);
}
项目:spring-boot-concourse    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void defaultHealthIndicator() {
    this.context.register(HealthIndicatorAutoConfiguration.class,
            ManagementServerProperties.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.diskspace.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(1);
    assertThat(beans.values().iterator().next().getClass())
            .isEqualTo(ApplicationHealthIndicator.class);
}
项目:spring-boot-concourse    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void defaultHealthIndicatorsDisabled() {
    this.context.register(HealthIndicatorAutoConfiguration.class,
            ManagementServerProperties.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.defaults.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(1);
    assertThat(beans.values().iterator().next().getClass())
            .isEqualTo(ApplicationHealthIndicator.class);
}
项目:spring-boot-concourse    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notRedisHealthIndicator() {
    this.context.register(RedisAutoConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.redis.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(1);
    assertThat(beans.values().iterator().next().getClass())
            .isEqualTo(ApplicationHealthIndicator.class);
}
项目:spring-boot-concourse    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notMongoHealthIndicator() {
    this.context.register(MongoAutoConfiguration.class,
            ManagementServerProperties.class, MongoDataAutoConfiguration.class,
            HealthIndicatorAutoConfiguration.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.mongo.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(1);
    assertThat(beans.values().iterator().next().getClass())
            .isEqualTo(ApplicationHealthIndicator.class);
}
项目:spring-boot-concourse    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notDataSourceHealthIndicator() {
    this.context.register(EmbeddedDataSourceConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.db.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(1);
    assertThat(beans.values().iterator().next().getClass())
            .isEqualTo(ApplicationHealthIndicator.class);
}
项目:spring-boot-concourse    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notRabbitHealthIndicator() {
    this.context.register(RabbitAutoConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.rabbit.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(1);
    assertThat(beans.values().iterator().next().getClass())
            .isEqualTo(ApplicationHealthIndicator.class);
}
项目:spring-boot-concourse    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notSolrHealthIndicator() {
    this.context.register(SolrAutoConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.solr.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(1);
    assertThat(beans.values().iterator().next().getClass())
            .isEqualTo(ApplicationHealthIndicator.class);
}
项目:spring-boot-concourse    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notMailHealthIndicator() {
    EnvironmentTestUtils.addEnvironment(this.context,
            "spring.mail.host:smtp.acme.org", "management.health.mail.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.register(MailSenderAutoConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    this.context.refresh();

    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(1);
    assertThat(beans.values().iterator().next().getClass())
            .isEqualTo(ApplicationHealthIndicator.class);
}
项目:spring-boot-concourse    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notJmsHealthIndicator() {
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.jms.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.register(ActiveMQAutoConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    this.context.refresh();

    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(1);
    assertThat(beans.values().iterator().next().getClass())
            .isEqualTo(ApplicationHealthIndicator.class);
}
项目:contestparser    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void defaultHealthIndicator() {
    this.context.register(HealthIndicatorAutoConfiguration.class,
            ManagementServerProperties.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.diskspace.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertEquals(1, beans.size());
    assertEquals(ApplicationHealthIndicator.class,
            beans.values().iterator().next().getClass());
}
项目:contestparser    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void defaultHealthIndicatorsDisabled() {
    this.context.register(HealthIndicatorAutoConfiguration.class,
            ManagementServerProperties.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.defaults.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertEquals(1, beans.size());
    assertEquals(ApplicationHealthIndicator.class,
            beans.values().iterator().next().getClass());
}
项目:contestparser    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notRedisHealthIndicator() {
    this.context.register(RedisAutoConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.redis.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertEquals(1, beans.size());
    assertEquals(ApplicationHealthIndicator.class,
            beans.values().iterator().next().getClass());
}
项目:contestparser    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notMongoHealthIndicator() {
    this.context.register(MongoAutoConfiguration.class,
            ManagementServerProperties.class, MongoDataAutoConfiguration.class,
            HealthIndicatorAutoConfiguration.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.mongo.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertEquals(1, beans.size());
    assertEquals(ApplicationHealthIndicator.class,
            beans.values().iterator().next().getClass());
}
项目:contestparser    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notDataSourceHealthIndicator() {
    this.context.register(EmbeddedDataSourceConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.db.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertEquals(1, beans.size());
    assertEquals(ApplicationHealthIndicator.class,
            beans.values().iterator().next().getClass());
}
项目:contestparser    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notRabbitHealthIndicator() {
    this.context.register(RabbitAutoConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.rabbit.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertEquals(1, beans.size());
    assertEquals(ApplicationHealthIndicator.class,
            beans.values().iterator().next().getClass());
}
项目:contestparser    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notSolrHeathIndicator() {
    this.context.register(SolrAutoConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.solr.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertEquals(1, beans.size());
    assertEquals(ApplicationHealthIndicator.class,
            beans.values().iterator().next().getClass());
}
项目:contestparser    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notMailHealthIndicator() {
    EnvironmentTestUtils.addEnvironment(this.context,
            "spring.mail.host:smtp.acme.org", "management.health.mail.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.register(MailSenderAutoConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    this.context.refresh();

    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertEquals(1, beans.size());
    assertEquals(ApplicationHealthIndicator.class,
            beans.values().iterator().next().getClass());
}
项目:contestparser    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void notJmsHealthIndicator() {
    EnvironmentTestUtils.addEnvironment(this.context,
            "management.health.jms.enabled:false",
            "management.health.diskspace.enabled:false");
    this.context.register(ActiveMQAutoConfiguration.class,
            ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
    this.context.refresh();

    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertEquals(1, beans.size());
    assertEquals(ApplicationHealthIndicator.class,
            beans.values().iterator().next().getClass());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthIndicatorAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean(HealthIndicator.class)
public ApplicationHealthIndicator applicationHealthIndicator() {
    return new ApplicationHealthIndicator();
}
项目:spring-boot-concourse    文件:HealthIndicatorAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean(HealthIndicator.class)
public ApplicationHealthIndicator applicationHealthIndicator() {
    return new ApplicationHealthIndicator();
}
项目:contestparser    文件:HealthIndicatorAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean(HealthIndicator.class)
public ApplicationHealthIndicator applicationHealthIndicator() {
    return new ApplicationHealthIndicator();
}
项目:spring-cloud-stream    文件:StubBinder1Configuration.java   
@Bean
public HealthIndicator binderHealthIndicator() {
    return new ApplicationHealthIndicator();
}