Skip to content

Commit

Permalink
Update InsertTests.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Paultagoras committed Jun 24, 2024
1 parent 75d1a9a commit 9873a5d
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ private void createTable(String tableQuery) throws ClickHouseException {
}
}

private void dropTable(String tableName) throws ClickHouseException {
try (ClickHouseClient client = ClickHouseClient.builder().config(new ClickHouseConfig())
.nodeSelector(ClickHouseNodeSelector.of(ClickHouseProtocol.HTTP))
.build()) {
String tableQuery = "DROP TABLE IF EXISTS " + tableName;
client.read(getServer(ClickHouseProtocol.HTTP)).query(tableQuery).executeAndWait().close();
}
}

@Test(groups = { "integration" }, enabled = true)
public void insertSimplePOJOs() throws Exception {
String tableName = "simple_pojo_table";
Expand All @@ -76,5 +85,6 @@ public void insertSimplePOJOs() throws Exception {
assertTrue(metrics.getMetric(ClientMetrics.OP_SERIALIZATION).getLong() > 0);
assertEquals(metrics.getQueryId(), uuid);
assertEquals(response.getQueryId(), uuid);
dropTable(tableName);
}
}

0 comments on commit 9873a5d

Please sign in to comment.