Skip to content

Commit 537f96b

Browse files
Sample IN test
1 parent d6dc3a0 commit 537f96b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

spring-data-cassandra/src/test/java/org/springframework/data/cassandra/repository/ReactiveCassandraRepositoryIntegrationTests.java

+11
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import java.util.Arrays;
2323
import java.util.HashSet;
24+
import java.util.List;
2425
import java.util.Set;
2526

2627
import org.junit.jupiter.api.BeforeEach;
@@ -125,6 +126,14 @@ void setUp() throws Exception {
125126
.verifyComplete();
126127
}
127128

129+
@Test
130+
void shouldFindByIdIn() {
131+
// Statement generated does not use a bind marker for the IN clause (uses hard-coded values, causing issues
132+
// with prepared statement generation)
133+
List<String> ids = Arrays.asList(dave.getId(), carter.getId());
134+
repository.findByIdIn(new HashSet<>(ids)).as(StepVerifier::create).expectNextCount(2).verifyComplete();
135+
}
136+
128137
@Test // DATACASS-335
129138
void shouldFindByLastName() {
130139
repository.findByLastname(dave.getLastname()).as(StepVerifier::create).expectNextCount(2).verifyComplete();
@@ -232,6 +241,8 @@ void shouldApplyExistsProjection() {
232241

233242
interface UserRepository extends ReactiveCassandraRepository<User, String> {
234243

244+
Flux<User> findByIdIn(Set<String> ids);
245+
235246
Flux<User> findByLastname(String lastname);
236247

237248
Mono<Slice<User>> findByLastname(String firstname, Pageable pageable);

0 commit comments

Comments
 (0)