|
1 | 1 | /* |
2 | | - * Copyright 2016-2021 the original author or authors. |
| 2 | + * Copyright 2025 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
6 | 6 | * You may obtain a copy of the License at |
7 | 7 | * |
8 | | - * https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
9 | 9 | * |
10 | 10 | * Unless required by applicable law or agreed to in writing, software |
11 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
|
19 | 19 |
|
20 | 20 | import example.springdata.cassandra.util.CassandraKeyspace; |
21 | 21 |
|
22 | | -import java.util.List; |
23 | 22 | import java.util.Map; |
24 | 23 | import java.util.concurrent.CountDownLatch; |
25 | | -import java.util.concurrent.TimeUnit; |
26 | 24 |
|
27 | 25 | import org.junit.jupiter.api.BeforeEach; |
28 | 26 | import org.junit.jupiter.api.Test; |
|
32 | 30 | import org.springframework.data.cassandra.core.AsyncCassandraTemplate; |
33 | 31 | import org.springframework.data.cassandra.core.CassandraOperations; |
34 | 32 | import org.springframework.data.cassandra.core.CassandraTemplate; |
35 | | -import org.springframework.util.concurrent.ListenableFuture; |
36 | 33 |
|
37 | 34 | import com.datastax.oss.driver.api.core.CqlSession; |
38 | 35 | import com.datastax.oss.driver.api.core.cql.Row; |
39 | 36 | import com.datastax.oss.driver.api.querybuilder.QueryBuilder; |
40 | | -import com.datastax.oss.driver.api.querybuilder.insert.Insert; |
41 | 37 |
|
42 | 38 | /** |
43 | 39 | * Integration test showing the basic usage of {@link CassandraTemplate}. |
|
48 | 44 | @CassandraKeyspace |
49 | 45 | class CassandraOperationsIntegrationTests { |
50 | 46 |
|
51 | | - |
52 | 47 | @Autowired CqlSession session; |
53 | 48 | @Autowired CassandraOperations template; |
54 | 49 |
|
55 | 50 | @BeforeEach |
56 | | - void setUp() throws Exception { |
| 51 | + void setUp() { |
57 | 52 | template.getCqlOperations().execute("TRUNCATE users"); |
58 | 53 | } |
59 | 54 |
|
@@ -121,7 +116,7 @@ void insertAsynchronously() throws InterruptedException { |
121 | 116 |
|
122 | 117 | var future = asyncTemplate.insert(user); |
123 | 118 |
|
124 | | - future.whenComplete((it,ex) -> { |
| 119 | + future.whenComplete((it, ex) -> { |
125 | 120 | var loaded = template.selectOneById(it.getId(), User.class); |
126 | 121 | assertThat(loaded).isEqualTo(it); |
127 | 122 | }); |
|
0 commit comments