Skip to content

Commit bb4c012

Browse files
committed
Fix tests after dependency upgrades.
See #1541
1 parent 86b2ccf commit bb4c012

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ void convertsEnumCollectionParameterIntoStringCollectionParameter() {
193193
query.execute(new Object[] { asList(Direction.LEFT, Direction.RIGHT) });
194194

195195
ArgumentCaptor<SqlParameterSource> captor = ArgumentCaptor.forClass(SqlParameterSource.class);
196-
verify(operations).query(anyString(), captor.capture(), any(ResultSetExtractor.class));
196+
verify(operations).queryForObject(anyString(), captor.capture(), any(RowMapper.class));
197197

198198
SqlParameterSource sqlParameterSource = captor.getValue();
199199
assertThat(sqlParameterSource.getValue("directions")).asList().containsExactlyInAnyOrder("LEFT", "RIGHT");
@@ -209,7 +209,7 @@ void convertsEnumCollectionParameterUsingCustomConverterWhenRegisteredForType()
209209
query.execute(new Object[] { asList(Direction.LEFT, Direction.RIGHT) });
210210

211211
ArgumentCaptor<SqlParameterSource> captor = ArgumentCaptor.forClass(SqlParameterSource.class);
212-
verify(operations).query(anyString(), captor.capture(), any(ResultSetExtractor.class));
212+
verify(operations).queryForObject(anyString(), captor.capture(), any(RowMapper.class));
213213

214214
SqlParameterSource sqlParameterSource = captor.getValue();
215215
assertThat(sqlParameterSource.getValue("directions")).asList().containsExactlyInAnyOrder(-1, 1);
@@ -225,7 +225,7 @@ void doesNotConvertNonCollectionParameter() {
225225
query.execute(new Object[] { 1 });
226226

227227
ArgumentCaptor<SqlParameterSource> captor = ArgumentCaptor.forClass(SqlParameterSource.class);
228-
verify(operations).query(anyString(), captor.capture(), any(ResultSetExtractor.class));
228+
verify(operations).queryForObject(anyString(), captor.capture(), any(RowMapper.class));
229229

230230
SqlParameterSource sqlParameterSource = captor.getValue();
231231
assertThat(sqlParameterSource.getValue("value")).isEqualTo(1);
@@ -308,7 +308,7 @@ public Object extractData(ResultSet rs) throws DataAccessException {
308308
private enum Direction {
309309
LEFT, CENTER, RIGHT
310310
}
311-
311+
312312
@WritingConverter
313313
enum DirectionToIntegerConverter implements Converter<Direction, JdbcValue> {
314314

spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/support/JdbcQueryLookupStrategyUnitTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
import org.junit.jupiter.api.BeforeEach;
2727
import org.junit.jupiter.api.Test;
28-
2928
import org.junit.jupiter.params.ParameterizedTest;
3029
import org.junit.jupiter.params.provider.Arguments;
3130
import org.junit.jupiter.params.provider.MethodSource;
@@ -78,6 +77,7 @@ void setup() {
7877

7978
doReturn(NumberFormat.class).when(metadata).getReturnedDomainClass(any(Method.class));
8079
doReturn(ClassTypeInformation.from(NumberFormat.class)).when(metadata).getReturnType(any(Method.class));
80+
doReturn(ClassTypeInformation.from(NumberFormat.class)).when(metadata).getDomainTypeInformation();
8181
}
8282

8383
@Test // DATAJDBC-166

0 commit comments

Comments
 (0)