|
3 | 3 | import java.sql.*; |
4 | 4 | import java.util.Properties; |
5 | 5 |
|
| 6 | +import com.clickhouse.client.api.ClientConfigProperties; |
| 7 | +import com.clickhouse.jdbc.internal.ClientInfoProperties; |
6 | 8 | import org.testng.Assert; |
7 | 9 | import org.testng.annotations.Test; |
8 | 10 |
|
@@ -108,7 +110,7 @@ public void isReadOnlyTest() throws SQLException { |
108 | 110 | public void setCatalogTest() throws SQLException { |
109 | 111 | Connection localConnection = this.getJdbcConnection(); |
110 | 112 | localConnection.setCatalog("catalog-name"); |
111 | | - Assert.assertEquals(localConnection.getCatalog(), "catalog-name"); |
| 113 | + Assert.assertNull(localConnection.getCatalog()); |
112 | 114 | } |
113 | 115 |
|
114 | 116 | @Test(groups = { "integration" }) |
@@ -212,10 +214,10 @@ public void isValidTest() throws SQLException { |
212 | 214 | @Test(groups = { "integration" }) |
213 | 215 | public void setAndGetClientInfoTest() throws SQLException { |
214 | 216 | Connection localConnection = this.getJdbcConnection(); |
215 | | - Assert.assertThrows(SQLFeatureNotSupportedException.class, () -> localConnection.getClientInfo("name")); |
216 | | - Assert.assertThrows(SQLFeatureNotSupportedException.class, localConnection::getClientInfo); |
217 | | - Assert.assertThrows(SQLClientInfoException.class, () -> localConnection.setClientInfo("name", "value")); |
218 | | - Assert.assertThrows(SQLClientInfoException.class, () -> localConnection.setClientInfo(new Properties())); |
| 217 | + localConnection.setClientInfo("custom-property", "client-name"); |
| 218 | + Assert.assertNull(localConnection.getClientInfo("custom-property")); |
| 219 | + localConnection.setClientInfo(ClientInfoProperties.APPLICATION_NAME.getKey(), "client-name"); |
| 220 | + Assert.assertEquals(localConnection.getClientInfo(ClientInfoProperties.APPLICATION_NAME.getKey()), "client-name"); |
219 | 221 | } |
220 | 222 |
|
221 | 223 |
|
|
0 commit comments