|
44 | 44 | import org.junit.jupiter.api.Tag;
|
45 | 45 | import org.junit.jupiter.api.Test;
|
46 | 46 | import org.junit.jupiter.api.TestMethodOrder;
|
| 47 | +import org.junit.jupiter.api.extension.ExtendWith; |
47 | 48 | import org.neo4j.cypherdsl.core.Condition;
|
48 | 49 | import org.neo4j.cypherdsl.core.Cypher;
|
49 | 50 | import org.neo4j.cypherdsl.core.Node;
|
|
182 | 183 | import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories;
|
183 | 184 | import org.springframework.data.neo4j.repository.query.QueryFragmentsAndParameters;
|
184 | 185 | import org.springframework.data.neo4j.test.BookmarkCapture;
|
| 186 | +import org.springframework.data.neo4j.test.LogbackCapture; |
| 187 | +import org.springframework.data.neo4j.test.LogbackCapturingExtension; |
185 | 188 | import org.springframework.data.neo4j.test.Neo4jImperativeTestConfiguration;
|
186 | 189 | import org.springframework.data.neo4j.test.Neo4jIntegrationTest;
|
187 | 190 | import org.springframework.transaction.PlatformTransactionManager;
|
188 | 191 | import org.springframework.transaction.annotation.EnableTransactionManagement;
|
189 | 192 | import org.springframework.transaction.annotation.Transactional;
|
190 | 193 |
|
| 194 | +import ch.qos.logback.classic.Level; |
| 195 | + |
191 | 196 | /**
|
192 | 197 | * @author Michael J. Simons
|
193 | 198 | * @soundtrack Sodom - Sodom
|
194 | 199 | */
|
195 | 200 | @Neo4jIntegrationTest
|
196 | 201 | @DisplayNameGeneration(SimpleDisplayNameGeneratorWithTags.class)
|
197 | 202 | @TestMethodOrder(MethodOrderer.DisplayName.class)
|
| 203 | +@ExtendWith(LogbackCapturingExtension.class) |
198 | 204 | class IssuesIT extends TestBase {
|
199 | 205 |
|
200 | 206 | // GH-2210
|
@@ -1316,6 +1322,20 @@ void shouldSupportGeoResultWithSelfRef(@Autowired LocatedNodeWithSelfRefReposito
|
1316 | 1322 | assertSupportedGeoResultBehavior(repository);
|
1317 | 1323 | }
|
1318 | 1324 |
|
| 1325 | + @Test |
| 1326 | + @Tag("GH-2940") |
| 1327 | + void shouldNotGenerateDuplicateOrder(@Autowired LocatedNodeRepository repository, LogbackCapture logbackCapture) { |
| 1328 | + |
| 1329 | + try { |
| 1330 | + logbackCapture.addLogger("org.springframework.data.neo4j.cypher", Level.DEBUG); |
| 1331 | + var nodes = repository.findAllByName("NEO4J_HQ", PageRequest.of(0, 10, Sort.by(Sort.Order.asc("name")))); |
| 1332 | + assertThat(nodes).isNotEmpty(); |
| 1333 | + assertThat(logbackCapture.getFormattedMessages()).noneMatch(l -> l.contains("locatedNode.name, locatedNode.name")); |
| 1334 | + } finally { |
| 1335 | + logbackCapture.resetLogLevel(); |
| 1336 | + } |
| 1337 | + } |
| 1338 | + |
1319 | 1339 | @Configuration
|
1320 | 1340 | @EnableTransactionManagement
|
1321 | 1341 | @EnableNeo4jRepositories(namedQueriesLocation = "more-custom-queries.properties")
|
|
0 commit comments