This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 119778803fa Fix sonar issue on ClickHouseTest (#31812)
119778803fa is described below
commit 119778803fa63bfba581e9285fcc959952b72086
Author: Liang Zhang <[email protected]>
AuthorDate: Fri Jun 21 20:53:42 2024 +0800
Fix sonar issue on ClickHouseTest (#31812)
---
.../shardingsphere/test/natived/jdbc/databases/ClickHouseTest.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/ClickHouseTest.java
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/ClickHouseTest.java
index 6b2d46e673b..6b57356d87e 100644
---
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/ClickHouseTest.java
+++
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/databases/ClickHouseTest.java
@@ -26,6 +26,8 @@ import org.junit.jupiter.api.condition.EnabledInNativeImage;
import javax.sql.DataSource;
import java.sql.SQLException;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+
class ClickHouseTest {
private TestShardingService testShardingService;
@@ -34,17 +36,16 @@ class ClickHouseTest {
* TODO Need to fix `shardingsphere-parser-sql-clickhouse` module to use
{@link TestShardingService#cleanEnvironment()}
* after {@link TestShardingService#processSuccessInClickHouse()}.
*
- * @throws SQLException An exception that provides information on a
database access error or other errors.
*/
@EnabledInNativeImage
@Test
- void assertShardingInLocalTransactions() throws SQLException {
+ void assertShardingInLocalTransactions() {
HikariConfig config = new HikariConfig();
config.setDriverClassName("org.apache.shardingsphere.driver.ShardingSphereDriver");
config.setJdbcUrl("jdbc:shardingsphere:classpath:test-native/yaml/databases/clickhouse.yaml");
DataSource dataSource = new HikariDataSource(config);
testShardingService = new TestShardingService(dataSource);
- testShardingService.processSuccessInClickHouse();
+ assertDoesNotThrow(() ->
testShardingService.processSuccessInClickHouse());
}
/**