|
| 1 | +package com.redis.om.spring.annotations.document; |
| 2 | + |
| 3 | +import com.google.common.collect.Sets; |
| 4 | +import com.redis.om.spring.AbstractBaseDocumentTest; |
| 5 | +import com.redis.om.spring.annotations.document.fixtures.*; |
| 6 | +import org.junit.jupiter.api.BeforeEach; |
| 7 | +import org.junit.jupiter.api.Test; |
| 8 | +import org.springframework.beans.factory.annotation.Autowired; |
| 9 | +import org.springframework.data.geo.Distance; |
| 10 | +import org.springframework.data.geo.Point; |
| 11 | +import org.springframework.data.redis.connection.RedisGeoCommands; |
| 12 | +import redis.clients.jedis.json.Path; |
| 13 | + |
| 14 | +import java.time.LocalDate; |
| 15 | +import java.util.ArrayList; |
| 16 | +import java.util.List; |
| 17 | +import java.util.Optional; |
| 18 | +import java.util.Set; |
| 19 | +import java.util.stream.IntStream; |
| 20 | + |
| 21 | +import static org.assertj.core.api.Assertions.assertThat; |
| 22 | +import static org.junit.jupiter.api.Assertions.*; |
| 23 | + |
| 24 | +@SuppressWarnings("SpellCheckingInspection") |
| 25 | +class RepositoryIssuesTest extends AbstractBaseDocumentTest { |
| 26 | + @Autowired |
| 27 | + User2Repository repository; |
| 28 | + |
| 29 | + @BeforeEach |
| 30 | + void cleanUp() { |
| 31 | + repository.deleteAll(); |
| 32 | + repository.save(User2.of("Doe", "Paris", "12 rue Rivoli")); |
| 33 | + } |
| 34 | + |
| 35 | + // RediSearchQuery wrong preparedQuery #187 |
| 36 | + @Test |
| 37 | + void testIncorrectParameterInjection() { |
| 38 | + Iterable<User2> results = repository.findUser("Doe", "Paris", "12 rue Rivoli"); |
| 39 | + |
| 40 | + assertThat(results).extracting("name").containsExactly("Doe"); |
| 41 | + } |
| 42 | +} |
0 commit comments