Skip to content

Commit 7fdffa3

Browse files
committed
Polishing.
Avoiding var. Referencing issue/pr in tests. Formatting. See #2125 See #1865
1 parent 933edd2 commit 7fdffa3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/query/PartTreeJdbcQueryUnitTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,10 +671,11 @@ public void createsQueryForCountProjection() throws Exception {
671671
.isEqualTo("SELECT COUNT(*) FROM " + TABLE + " WHERE " + TABLE + ".\"FIRST_NAME\" = :first_name");
672672
}
673673

674-
@Test
674+
@Test // GH-2125
675675
public void mappingMapKeyToChildShouldNotResultInDuplicateColumn() throws Exception {
676+
676677
Method method = ParentRepository.class.getMethod("findByName", String.class);
677-
var queryMethod = new JdbcQueryMethod(method, new DefaultRepositoryMetadata(ParentRepository.class),
678+
JdbcQueryMethod queryMethod = new JdbcQueryMethod(method, new DefaultRepositoryMetadata(ParentRepository.class),
678679
new SpelAwareProxyProjectionFactory(), new PropertiesBasedNamedQueries(new Properties()), mappingContext);
679680
PartTreeJdbcQuery jdbcQuery = createQuery(queryMethod);
680681
ParametrizedQuery query = jdbcQuery.createQuery(getAccessor(queryMethod, new Object[] { "John" }), returnedType);
@@ -688,6 +689,7 @@ private PartTreeJdbcQuery createQuery(JdbcQueryMethod queryMethod) {
688689
}
689690

690691
private JdbcQueryMethod getQueryMethod(String methodName, Class<?>... parameterTypes) throws Exception {
692+
691693
Method method = UserRepository.class.getMethod(methodName, parameterTypes);
692694
return new JdbcQueryMethod(method, new DefaultRepositoryMetadata(UserRepository.class),
693695
new SpelAwareProxyProjectionFactory(), new PropertiesBasedNamedQueries(new Properties()), mappingContext);

0 commit comments

Comments
 (0)