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

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void mongoHealthIndicator() {
    this.context.register(MongoAutoConfiguration.class,
            ManagementServerProperties.class, MongoDataAutoConfiguration.class,
            HealthIndicatorAutoConfiguration.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(MongoHealthIndicator.class);
}
项目:spring-boot-concourse    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void mongoHealthIndicator() {
    this.context.register(MongoAutoConfiguration.class,
            ManagementServerProperties.class, MongoDataAutoConfiguration.class,
            HealthIndicatorAutoConfiguration.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(MongoHealthIndicator.class);
}
项目:contestparser    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void mongoHealthIndicator() {
    this.context.register(MongoAutoConfiguration.class,
            ManagementServerProperties.class, MongoDataAutoConfiguration.class,
            HealthIndicatorAutoConfiguration.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(MongoHealthIndicator.class,
            beans.values().iterator().next().getClass());
}