Java 类org.springframework.boot.autoconfigure.solr.SolrAutoConfiguration 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void combinedHealthIndicator() {
    this.context.register(MongoAutoConfiguration.class, RedisAutoConfiguration.class,
            MongoDataAutoConfiguration.class, SolrAutoConfiguration.class,
            HealthIndicatorAutoConfiguration.class);
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(4);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void solrHealthIndicator() {
    this.context.register(SolrAutoConfiguration.class,
            ManagementServerProperties.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(SolrHealthIndicator.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    文件:SolrHealthIndicatorTests.java   
@Test
public void indicatorExists() {
    this.context = new AnnotationConfigApplicationContext(
            PropertyPlaceholderAutoConfiguration.class, SolrAutoConfiguration.class,
            EndpointAutoConfiguration.class, HealthIndicatorAutoConfiguration.class);
    assertThat(this.context.getBeanNamesForType(SolrClient.class).length)
            .isEqualTo(1);
    SolrHealthIndicator healthIndicator = this.context
            .getBean(SolrHealthIndicator.class);
    assertThat(healthIndicator).isNotNull();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:SolrRepositoriesAutoConfigurationTests.java   
private void initContext(Class<?> configClass) {

        this.context = new AnnotationConfigApplicationContext();
        this.context.register(configClass, SolrAutoConfiguration.class,
                SolrRepositoriesAutoConfiguration.class,
                PropertyPlaceholderAutoConfiguration.class);
        this.context.refresh();
    }
项目:spring-boot-concourse    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void combinedHealthIndicator() {
    this.context.register(MongoAutoConfiguration.class, RedisAutoConfiguration.class,
            MongoDataAutoConfiguration.class, SolrAutoConfiguration.class,
            HealthIndicatorAutoConfiguration.class);
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertThat(beans).hasSize(4);
}
项目:spring-boot-concourse    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void solrHealthIndicator() {
    this.context.register(SolrAutoConfiguration.class,
            ManagementServerProperties.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(SolrHealthIndicator.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    文件:SolrHealthIndicatorTests.java   
@Test
public void indicatorExists() {
    this.context = new AnnotationConfigApplicationContext(
            PropertyPlaceholderAutoConfiguration.class, SolrAutoConfiguration.class,
            EndpointAutoConfiguration.class, HealthIndicatorAutoConfiguration.class);
    assertThat(this.context.getBeanNamesForType(SolrClient.class).length)
            .isEqualTo(1);
    SolrHealthIndicator healthIndicator = this.context
            .getBean(SolrHealthIndicator.class);
    assertThat(healthIndicator).isNotNull();
}
项目:spring-boot-concourse    文件:SolrRepositoriesAutoConfigurationTests.java   
private void initContext(Class<?> configClass) {

        this.context = new AnnotationConfigApplicationContext();
        this.context.register(configClass, SolrAutoConfiguration.class,
                SolrRepositoriesAutoConfiguration.class,
                PropertyPlaceholderAutoConfiguration.class);
        this.context.refresh();
    }
项目:contestparser    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void combinedHealthIndicator() {
    this.context.register(MongoAutoConfiguration.class, RedisAutoConfiguration.class,
            MongoDataAutoConfiguration.class, SolrAutoConfiguration.class,
            HealthIndicatorAutoConfiguration.class);
    this.context.refresh();
    Map<String, HealthIndicator> beans = this.context
            .getBeansOfType(HealthIndicator.class);
    assertEquals(4, beans.size());
}
项目:contestparser    文件:HealthIndicatorAutoConfigurationTests.java   
@Test
public void solrHeathIndicator() {
    this.context.register(SolrAutoConfiguration.class,
            ManagementServerProperties.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(SolrHealthIndicator.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    文件:SolrHealthIndicatorTests.java   
@Test
public void indicatorExists() {
    this.context = new AnnotationConfigApplicationContext(
            PropertyPlaceholderAutoConfiguration.class, SolrAutoConfiguration.class,
            EndpointAutoConfiguration.class, HealthIndicatorAutoConfiguration.class);
    assertEquals(1, this.context.getBeanNamesForType(SolrServer.class).length);
    SolrHealthIndicator healthIndicator = this.context
            .getBean(SolrHealthIndicator.class);
    assertNotNull(healthIndicator);
}
项目:contestparser    文件:SolrRepositoriesAutoConfigurationTests.java   
private void initContext(Class<?> configClass) {

        this.context = new AnnotationConfigApplicationContext();
        this.context.register(configClass, SolrAutoConfiguration.class,
                SolrRepositoriesAutoConfiguration.class,
                PropertyPlaceholderAutoConfiguration.class);
        this.context.refresh();
    }