use of org.springframework.data.cassandra.config.SchemaAction in project spring-boot by spring-projects.
the class CassandraDataAutoConfiguration method session.
@Bean
@ConditionalOnMissingBean(Session.class)
public CassandraSessionFactoryBean session(CassandraConverter converter) throws Exception {
CassandraSessionFactoryBean session = new CassandraSessionFactoryBean();
session.setCluster(this.cluster);
session.setConverter(converter);
session.setKeyspaceName(this.properties.getKeyspaceName());
SchemaAction schemaAction = this.propertyResolver.getProperty("schemaAction", SchemaAction.class, SchemaAction.NONE);
session.setSchemaAction(schemaAction);
return session;
}
use of org.springframework.data.cassandra.config.SchemaAction in project todos by ssimmie.
the class CassandraConfigTest method shouldProvideSchemaActionAsSet.
@Test
public void shouldProvideSchemaActionAsSet() {
final SchemaAction expectedSchemaAction = SchemaAction.CREATE;
final CassandraConfig cassandraConfig = new CassandraConfig();
setField(cassandraConfig, "schemaAction", expectedSchemaAction.name());
assertThat(cassandraConfig.getSchemaAction()).isEqualTo(expectedSchemaAction);
}
use of org.springframework.data.cassandra.config.SchemaAction in project todos by ssimmie.
the class CassandraConfigTest method shouldProvideSchemaActionAsSetInLowerCase.
@Test
public void shouldProvideSchemaActionAsSetInLowerCase() {
final SchemaAction expectedSchemaAction = SchemaAction.CREATE;
final CassandraConfig cassandraConfig = new CassandraConfig();
setField(cassandraConfig, "schemaAction", expectedSchemaAction.name().toLowerCase(Locale.ROOT));
assertThat(cassandraConfig.getSchemaAction()).isEqualTo(expectedSchemaAction);
}
Aggregations