Search in sources :

Example 1 with CqlIdentifier

use of com.datastax.oss.driver.api.core.CqlIdentifier in project spring-boot by spring-projects.

the class CassandraAutoConfigurationTests method cqlSessionBuildHasScopePrototype.

@Test
void cqlSessionBuildHasScopePrototype() {
    this.contextRunner.run((context) -> {
        CqlIdentifier keyspace = CqlIdentifier.fromCql("test");
        CqlSessionBuilder firstBuilder = context.getBean(CqlSessionBuilder.class);
        assertThat(firstBuilder.withKeyspace(keyspace)).hasFieldOrPropertyWithValue("keyspace", keyspace);
        CqlSessionBuilder secondBuilder = context.getBean(CqlSessionBuilder.class);
        assertThat(secondBuilder).hasFieldOrPropertyWithValue("keyspace", null);
    });
}
Also used : CqlSessionBuilder(com.datastax.oss.driver.api.core.CqlSessionBuilder) CqlIdentifier(com.datastax.oss.driver.api.core.CqlIdentifier) Test(org.junit.jupiter.api.Test)

Aggregations

CqlIdentifier (com.datastax.oss.driver.api.core.CqlIdentifier)1 CqlSessionBuilder (com.datastax.oss.driver.api.core.CqlSessionBuilder)1 Test (org.junit.jupiter.api.Test)1