@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package example.springdata.cassandra.spel;
|
||||
|
||||
import lombok.Value;
|
||||
|
||||
import org.springframework.data.cassandra.core.cql.PrimaryKeyType;
|
||||
import org.springframework.data.cassandra.core.mapping.PrimaryKeyColumn;
|
||||
import org.springframework.data.cassandra.core.mapping.Table;
|
||||
@@ -24,10 +22,8 @@ import org.springframework.data.cassandra.core.mapping.Table;
|
||||
/**
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
@Value
|
||||
@Table
|
||||
public class Employee {
|
||||
public record Employee(@PrimaryKeyColumn(type = PrimaryKeyType.PARTITIONED) String tenantId,
|
||||
@PrimaryKeyColumn(type = PrimaryKeyType.CLUSTERED) String name) {
|
||||
|
||||
@PrimaryKeyColumn(type = PrimaryKeyType.PARTITIONED) String tenantId;
|
||||
@PrimaryKeyColumn(type = PrimaryKeyType.CLUSTERED) String name;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class AuditingIntegrationTests {
|
||||
@Test
|
||||
public void shouldUpdateAuditor() throws InterruptedException {
|
||||
|
||||
Order order = new Order("4711");
|
||||
var order = new Order("4711");
|
||||
order.setNew(true);
|
||||
|
||||
orderRepository.save(order).as(StepVerifier::create).assertNext(actual -> {
|
||||
|
||||
@@ -47,7 +47,7 @@ class ReactiveCassandraTemplateIntegrationTest {
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
|
||||
Flux<Person> truncateAndInsert = template.truncate(Person.class) //
|
||||
var truncateAndInsert = template.truncate(Person.class) //
|
||||
.thenMany(Flux.just(new Person("Walter", "White", 50), //
|
||||
new Person("Skyler", "White", 45), //
|
||||
new Person("Saul", "Goodman", 42), //
|
||||
@@ -64,7 +64,7 @@ class ReactiveCassandraTemplateIntegrationTest {
|
||||
@Test
|
||||
void shouldInsertAndCountData() {
|
||||
|
||||
Mono<Long> saveAndCount = template.count(Person.class) //
|
||||
var saveAndCount = template.count(Person.class) //
|
||||
.doOnNext(System.out::println) //
|
||||
.thenMany(Flux.just(new Person("Hank", "Schrader", 43), //
|
||||
new Person("Mike", "Ehrmantraut", 62)))
|
||||
@@ -82,7 +82,7 @@ class ReactiveCassandraTemplateIntegrationTest {
|
||||
@Test
|
||||
void convertReactorTypesToRxJava1() throws Exception {
|
||||
|
||||
Flux<Person> flux = template.select("SELECT * FROM person WHERE lastname = 'White'", Person.class);
|
||||
var flux = template.select("SELECT * FROM person WHERE lastname = 'White'", Person.class);
|
||||
|
||||
long count = RxReactiveStreams.toObservable(flux) //
|
||||
.count() //
|
||||
|
||||
@@ -43,7 +43,7 @@ class ReactivePersonRepositoryIntegrationTest {
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
|
||||
Flux<Person> deleteAndInsert = repository.deleteAll() //
|
||||
var deleteAndInsert = repository.deleteAll() //
|
||||
.thenMany(repository.saveAll(Flux.just(new Person("Walter", "White", 50), //
|
||||
new Person("Skyler", "White", 45), //
|
||||
new Person("Saul", "Goodman", 42), //
|
||||
@@ -58,7 +58,7 @@ class ReactivePersonRepositoryIntegrationTest {
|
||||
@Test
|
||||
void shouldInsertAndCountData() {
|
||||
|
||||
Mono<Long> saveAndCount = repository.count() //
|
||||
var saveAndCount = repository.count() //
|
||||
.doOnNext(System.out::println) //
|
||||
.thenMany(repository.saveAll(Flux.just(new Person("Hank", "Schrader", 43), //
|
||||
new Person("Mike", "Ehrmantraut", 62)))) //
|
||||
|
||||
@@ -45,9 +45,9 @@ public class RxJava2PersonRepositoryIntegrationTest {
|
||||
@BeforeEach
|
||||
public void setUp() throws Exception {
|
||||
|
||||
Completable deleteAll = repository.deleteAll();
|
||||
var deleteAll = repository.deleteAll();
|
||||
|
||||
Flowable<Person> save = repository.saveAll(Flowable.just(new Person("Walter", "White", 50), //
|
||||
var save = repository.saveAll(Flowable.just(new Person("Walter", "White", 50), //
|
||||
new Person("Skyler", "White", 45), //
|
||||
new Person("Saul", "Goodman", 42), //
|
||||
new Person("Jesse", "Pinkman", 27)));
|
||||
|
||||
Reference in New Issue
Block a user