Merge branch '3.4.x'
Closes gh-43951
This commit is contained in:
@@ -84,7 +84,7 @@ class PostgresJdbcDockerComposeConnectionDetailsFactoryIntegrationTests {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private <T> T executeQuery(JdbcConnectionDetails connectionDetails, String sql, Class<T> result)
|
||||
private <T> T executeQuery(JdbcConnectionDetails connectionDetails, String sql, Class<T> resultClass)
|
||||
throws ClassNotFoundException {
|
||||
SimpleDriverDataSource dataSource = new SimpleDriverDataSource();
|
||||
dataSource.setUrl(connectionDetails.getJdbcUrl());
|
||||
@@ -92,7 +92,7 @@ class PostgresJdbcDockerComposeConnectionDetailsFactoryIntegrationTests {
|
||||
dataSource.setPassword(connectionDetails.getPassword());
|
||||
dataSource.setDriverClass((Class<? extends Driver>) ClassUtils.forName(connectionDetails.getDriverClassName(),
|
||||
getClass().getClassLoader()));
|
||||
return new JdbcTemplate(dataSource).queryForObject(sql, result);
|
||||
return new JdbcTemplate(dataSource).queryForObject(sql, resultClass);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -88,11 +88,11 @@ class PostgresR2dbcDockerComposeConnectionDetailsFactoryIntegrationTests {
|
||||
.isEqualTo(1);
|
||||
}
|
||||
|
||||
private <T> T executeQuery(R2dbcConnectionDetails connectionDetails, String sql, Class<T> result) {
|
||||
private <T> T executeQuery(R2dbcConnectionDetails connectionDetails, String sql, Class<T> resultClass) {
|
||||
ConnectionFactoryOptions connectionFactoryOptions = connectionDetails.getConnectionFactoryOptions();
|
||||
return DatabaseClient.create(ConnectionFactories.get(connectionFactoryOptions))
|
||||
.sql(sql)
|
||||
.mapValue(result)
|
||||
.mapValue(resultClass)
|
||||
.first()
|
||||
.block(Duration.ofSeconds(30));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user