Search in sources :

Example 1 with ReactiveCqlTemplate

use of org.springframework.data.cassandra.core.cql.ReactiveCqlTemplate in project spring-data-cassandra by spring-projects.

the class ReactiveCassandraTemplateIntegrationTests method setUp.

@BeforeEach
void setUp() {
    MappingCassandraConverter converter = new MappingCassandraConverter();
    CassandraTemplate cassandraTemplate = new CassandraTemplate(this.session, converter);
    DefaultBridgedReactiveSession session = new DefaultBridgedReactiveSession(this.session);
    template = new ReactiveCassandraTemplate(new ReactiveCqlTemplate(session), converter);
    prepareTemplate(template);
    SchemaTestUtils.potentiallyCreateTableFor(User.class, cassandraTemplate);
    SchemaTestUtils.potentiallyCreateTableFor(UserToken.class, cassandraTemplate);
    SchemaTestUtils.truncate(User.class, cassandraTemplate);
    SchemaTestUtils.truncate(UserToken.class, cassandraTemplate);
}
Also used : DefaultBridgedReactiveSession(org.springframework.data.cassandra.core.cql.session.DefaultBridgedReactiveSession) MappingCassandraConverter(org.springframework.data.cassandra.core.convert.MappingCassandraConverter) ReactiveCqlTemplate(org.springframework.data.cassandra.core.cql.ReactiveCqlTemplate) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with ReactiveCqlTemplate

use of org.springframework.data.cassandra.core.cql.ReactiveCqlTemplate in project spring-data-cassandra by spring-projects.

the class ReactiveCassandraBatchTemplateIntegrationTests method setUp.

@BeforeEach
void setUp() {
    MappingCassandraConverter converter = new MappingCassandraConverter();
    CassandraTemplate cassandraTemplate = new CassandraTemplate(this.session, converter);
    DefaultBridgedReactiveSession session = new DefaultBridgedReactiveSession(this.session);
    template = new ReactiveCassandraTemplate(new ReactiveCqlTemplate(session), converter);
    SchemaTestUtils.potentiallyCreateTableFor(Group.class, cassandraTemplate);
    SchemaTestUtils.potentiallyCreateTableFor(FlatGroup.class, cassandraTemplate);
    SchemaTestUtils.truncate(Group.class, cassandraTemplate);
    SchemaTestUtils.truncate(FlatGroup.class, cassandraTemplate);
    // 
    this.template.insert(walter).then(this.template.insert(mike)).as(// 
    StepVerifier::create).expectNextCount(// 
    1).verifyComplete();
}
Also used : StepVerifier(reactor.test.StepVerifier) DefaultBridgedReactiveSession(org.springframework.data.cassandra.core.cql.session.DefaultBridgedReactiveSession) MappingCassandraConverter(org.springframework.data.cassandra.core.convert.MappingCassandraConverter) ReactiveCqlTemplate(org.springframework.data.cassandra.core.cql.ReactiveCqlTemplate) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

BeforeEach (org.junit.jupiter.api.BeforeEach)2 MappingCassandraConverter (org.springframework.data.cassandra.core.convert.MappingCassandraConverter)2 ReactiveCqlTemplate (org.springframework.data.cassandra.core.cql.ReactiveCqlTemplate)2 DefaultBridgedReactiveSession (org.springframework.data.cassandra.core.cql.session.DefaultBridgedReactiveSession)2 StepVerifier (reactor.test.StepVerifier)1