See gh-43879

Signed-off-by: Johnny Lim <izeye@naver.com>
This commit is contained in:
Johnny Lim
2025-01-19 16:31:11 +09:00
committed by Andy Wilkinson
parent 34c8353946
commit 6c8d41935f
6 changed files with 11 additions and 11 deletions

View File

@@ -63,7 +63,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());
@@ -71,7 +71,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);
}
}

View File

@@ -63,11 +63,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));
}