Java 类org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:CassandraDataAutoConfigurationIntegrationTests.java   
@Test
public void hasRecreateSchemaActionSet() {
    createTestKeyspaceIfNotExists();
    this.context = new AnnotationConfigApplicationContext();
    String cityPackage = City.class.getPackage().getName();
    AutoConfigurationPackages.register(this.context, cityPackage);
    EnvironmentTestUtils.addEnvironment(this.context,
            "spring.data.cassandra.schemaAction:RECREATE_DROP_UNUSED",
            "spring.data.cassandra.keyspaceName:boot_test");
    this.context.register(CassandraAutoConfiguration.class,
            CassandraDataAutoConfiguration.class);
    this.context.refresh();
    CassandraSessionFactoryBean bean = this.context
            .getBean(CassandraSessionFactoryBean.class);
    assertThat(bean.getSchemaAction()).isEqualTo(SchemaAction.RECREATE_DROP_UNUSED);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:CassandraDataAutoConfigurationTests.java   
@Test
public void templateExists() {
    this.context = new AnnotationConfigApplicationContext();
    this.context.register(TestExcludeConfiguration.class, TestConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class,
            CassandraAutoConfiguration.class, CassandraDataAutoConfiguration.class);
    this.context.refresh();
    assertThat(this.context.getBeanNamesForType(CassandraTemplate.class).length)
            .isEqualTo(1);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:CassandraDataAutoConfigurationTests.java   
@Test
@SuppressWarnings("unchecked")
public void entityScanShouldSetInitialEntitySet() throws Exception {
    this.context = new AnnotationConfigApplicationContext();
    this.context.register(TestConfiguration.class, EntityScanConfig.class,
            PropertyPlaceholderAutoConfiguration.class,
            CassandraAutoConfiguration.class, CassandraDataAutoConfiguration.class);
    this.context.refresh();
    CassandraMappingContext mappingContext = this.context
            .getBean(CassandraMappingContext.class);
    Set<Class<?>> initialEntitySet = (Set<Class<?>>) ReflectionTestUtils
            .getField(mappingContext, "initialEntitySet");
    assertThat(initialEntitySet).containsOnly(City.class);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:CassandraRepositoriesAutoConfigurationTests.java   
private void addConfigurations(Class<?>... configurations) {
    this.context.register(configurations);
    this.context.register(CassandraAutoConfiguration.class,
            CassandraRepositoriesAutoConfiguration.class,
            CassandraDataAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class);
    this.context.refresh();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:CassandraDataAutoConfigurationIntegrationTests.java   
@Test
public void hasDefaultSchemaActionSet() {
    this.context = new AnnotationConfigApplicationContext();
    String cityPackage = City.class.getPackage().getName();
    AutoConfigurationPackages.register(this.context, cityPackage);
    this.context.register(CassandraAutoConfiguration.class,
            CassandraDataAutoConfiguration.class);
    this.context.refresh();

    CassandraSessionFactoryBean bean = this.context
            .getBean(CassandraSessionFactoryBean.class);
    assertThat(bean.getSchemaAction()).isEqualTo(SchemaAction.NONE);
}
项目:spring-boot-concourse    文件:CassandraDataAutoConfigurationTests.java   
@Test
public void templateExists() {
    this.context = new AnnotationConfigApplicationContext();
    this.context.register(TestExcludeConfiguration.class, TestConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class,
            CassandraAutoConfiguration.class, CassandraDataAutoConfiguration.class);
    this.context.refresh();
    assertThat(this.context.getBeanNamesForType(CassandraTemplate.class).length)
            .isEqualTo(1);
}
项目:spring-boot-concourse    文件:CassandraRepositoriesAutoConfigurationTests.java   
private void addConfigurations(Class<?>... configurations) {
    this.context.register(configurations);
    this.context.register(CassandraAutoConfiguration.class,
            CassandraRepositoriesAutoConfiguration.class,
            CassandraDataAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class);
    this.context.refresh();
}
项目:contestparser    文件:CassandraDataAutoConfigurationTests.java   
@Test
public void templateExists() {
    this.context = new AnnotationConfigApplicationContext();
    this.context.register(TestExcludeConfiguration.class, TestConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class,
            CassandraAutoConfiguration.class, CassandraDataAutoConfiguration.class);
    this.context.refresh();
    assertEquals(1, this.context.getBeanNamesForType(CassandraTemplate.class).length);
}
项目:contestparser    文件:CassandraRepositoriesAutoConfigurationTests.java   
private void addConfigurations(Class<?>... configurations) {
    this.context.register(configurations);
    this.context.register(CassandraAutoConfiguration.class,
            CassandraRepositoriesAutoConfiguration.class,
            CassandraDataAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class);
    this.context.refresh();
}