|
47 | 47 | import org.junit.jupiter.api.Tag;
|
48 | 48 | import org.junit.jupiter.api.Test;
|
49 | 49 | import org.junit.jupiter.api.TestMethodOrder;
|
| 50 | +import org.junit.jupiter.api.extension.ExtendWith; |
50 | 51 | import org.neo4j.cypherdsl.core.Condition;
|
51 | 52 | import org.neo4j.cypherdsl.core.Cypher;
|
52 | 53 | import org.neo4j.cypherdsl.core.LabelExpression;
|
|
200 | 201 | import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories;
|
201 | 202 | import org.springframework.data.neo4j.repository.query.QueryFragmentsAndParameters;
|
202 | 203 | import org.springframework.data.neo4j.test.BookmarkCapture;
|
| 204 | +import org.springframework.data.neo4j.test.LogbackCapture; |
| 205 | +import org.springframework.data.neo4j.test.LogbackCapturingExtension; |
203 | 206 | import org.springframework.data.neo4j.test.Neo4jImperativeTestConfiguration;
|
204 | 207 | import org.springframework.data.neo4j.test.Neo4jIntegrationTest;
|
205 | 208 | import org.springframework.transaction.PlatformTransactionManager;
|
206 | 209 | import org.springframework.transaction.annotation.EnableTransactionManagement;
|
207 | 210 | import org.springframework.transaction.annotation.Transactional;
|
208 | 211 |
|
| 212 | +import ch.qos.logback.classic.Level; |
| 213 | + |
209 | 214 | /**
|
210 | 215 | * @author Michael J. Simons
|
211 | 216 | * @soundtrack Sodom - Sodom
|
212 | 217 | */
|
213 | 218 | @Neo4jIntegrationTest
|
214 | 219 | @DisplayNameGeneration(SimpleDisplayNameGeneratorWithTags.class)
|
215 | 220 | @TestMethodOrder(MethodOrderer.DisplayName.class)
|
| 221 | +@ExtendWith(LogbackCapturingExtension.class) |
216 | 222 | class IssuesIT extends TestBase {
|
217 | 223 |
|
218 | 224 | // GH-2210
|
@@ -1657,6 +1663,20 @@ void shouldSupportGeoResultWithSelfRef(@Autowired LocatedNodeWithSelfRefReposito
|
1657 | 1663 | assertSupportedGeoResultBehavior(repository);
|
1658 | 1664 | }
|
1659 | 1665 |
|
| 1666 | + @Test |
| 1667 | + @Tag("GH-2940") |
| 1668 | + void shouldNotGenerateDuplicateOrder(@Autowired LocatedNodeRepository repository, LogbackCapture logbackCapture) { |
| 1669 | + |
| 1670 | + try { |
| 1671 | + logbackCapture.addLogger("org.springframework.data.neo4j.cypher", Level.DEBUG); |
| 1672 | + var nodes = repository.findAllByName("NEO4J_HQ", PageRequest.of(0, 10, Sort.by(Sort.Order.asc("name")))); |
| 1673 | + assertThat(nodes).isNotEmpty(); |
| 1674 | + assertThat(logbackCapture.getFormattedMessages()).noneMatch(l -> l.contains("locatedNode.name, locatedNode.name")); |
| 1675 | + } finally { |
| 1676 | + logbackCapture.resetLogLevel(); |
| 1677 | + } |
| 1678 | + } |
| 1679 | + |
1660 | 1680 | @Configuration
|
1661 | 1681 | @EnableTransactionManagement
|
1662 | 1682 | @EnableNeo4jRepositories(namedQueriesLocation = "more-custom-queries.properties")
|
|
0 commit comments