Java 类org.springframework.boot.autoconfigure.mail.MailSenderAutoConfiguration 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void mailHealthIndicator() {
    EnvironmentTestUtils.addEnvironment(this.context,
            "spring.mail.host:smtp.acme.org",
            "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(MailHealthIndicator.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);
}
项目:spring-boot-concourse    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void mailHealthIndicator() {
    EnvironmentTestUtils.addEnvironment(this.context,
            "spring.mail.host:smtp.acme.org",
            "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(MailHealthIndicator.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);
}
项目:contestparser    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void mailHealthIndicator() {
    EnvironmentTestUtils.addEnvironment(this.context,
            "spring.mail.host:smtp.acme.org",
            "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(MailHealthIndicator.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());
}