Search in sources :

Example 1 with CassandraConverter

use of org.springframework.data.cassandra.core.convert.CassandraConverter in project spring-data-cassandra by spring-projects.

the class CqlSessionFactoryBean method getMappingContext.

/**
 * @return the {@link CassandraMappingContext}.
 */
protected CassandraMappingContext getMappingContext() {
    CassandraConverter converter = getConverter();
    Assert.state(converter != null, "CassandraConverter was not properly initialized");
    return converter.getMappingContext();
}
Also used : CassandraConverter(org.springframework.data.cassandra.core.convert.CassandraConverter)

Example 2 with CassandraConverter

use of org.springframework.data.cassandra.core.convert.CassandraConverter in project spring-boot by spring-projects.

the class CassandraDataAutoConfigurationTests method userTypeResolverShouldBeSet.

@Test
void userTypeResolverShouldBeSet() {
    load();
    CassandraConverter cassandraConverter = this.context.getBean(CassandraConverter.class);
    assertThat(cassandraConverter).extracting("userTypeResolver").isInstanceOf(SimpleUserTypeResolver.class);
}
Also used : CassandraConverter(org.springframework.data.cassandra.core.convert.CassandraConverter) Test(org.junit.jupiter.api.Test)

Example 3 with CassandraConverter

use of org.springframework.data.cassandra.core.convert.CassandraConverter in project spring-boot by spring-projects.

the class CassandraDataAutoConfigurationTests method codecRegistryShouldBeSet.

@Test
void codecRegistryShouldBeSet() {
    load();
    CassandraConverter cassandraConverter = this.context.getBean(CassandraConverter.class);
    assertThat(cassandraConverter.getCodecRegistry()).isSameAs(this.context.getBean(CassandraMockConfiguration.class).codecRegistry);
}
Also used : CassandraConverter(org.springframework.data.cassandra.core.convert.CassandraConverter) Test(org.junit.jupiter.api.Test)

Example 4 with CassandraConverter

use of org.springframework.data.cassandra.core.convert.CassandraConverter in project spring-boot by spring-projects.

the class CassandraReactiveDataAutoConfigurationTests method userTypeResolverShouldBeSet.

@Test
void userTypeResolverShouldBeSet() {
    load("spring.data.cassandra.keyspaceName:boot_test");
    CassandraConverter cassandraConverter = this.context.getBean(CassandraConverter.class);
    assertThat(cassandraConverter).extracting("userTypeResolver").isInstanceOf(SimpleUserTypeResolver.class);
}
Also used : CassandraConverter(org.springframework.data.cassandra.core.convert.CassandraConverter) Test(org.junit.jupiter.api.Test)

Aggregations

CassandraConverter (org.springframework.data.cassandra.core.convert.CassandraConverter)4 Test (org.junit.jupiter.api.Test)3