File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
client-v2/src/test/java/com/clickhouse/client/insert Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,15 @@ private void createTable(String tableQuery) throws ClickHouseException {
5353 }
5454 }
5555
56+ private void dropTable (String tableName ) throws ClickHouseException {
57+ try (ClickHouseClient client = ClickHouseClient .builder ().config (new ClickHouseConfig ())
58+ .nodeSelector (ClickHouseNodeSelector .of (ClickHouseProtocol .HTTP ))
59+ .build ()) {
60+ String tableQuery = "DROP TABLE IF EXISTS " + tableName ;
61+ client .read (getServer (ClickHouseProtocol .HTTP )).query (tableQuery ).executeAndWait ().close ();
62+ }
63+ }
64+
5665 @ Test (groups = { "integration" }, enabled = true )
5766 public void insertSimplePOJOs () throws Exception {
5867 String tableName = "simple_pojo_table" ;
@@ -76,5 +85,6 @@ public void insertSimplePOJOs() throws Exception {
7685 assertTrue (metrics .getMetric (ClientMetrics .OP_SERIALIZATION ).getLong () > 0 );
7786 assertEquals (metrics .getQueryId (), uuid );
7887 assertEquals (response .getQueryId (), uuid );
88+ dropTable (tableName );
7989 }
8090}
You can’t perform that action at this time.
0 commit comments