Skip to content

Commit 2516d01

Browse files
committed
Fix tests a bit
1 parent 55ac61a commit 2516d01

1 file changed

Lines changed: 5 additions & 13 deletions

File tree

clickhouse-client/src/test/java/com/clickhouse/client/config/ClickHouseDefaultSslContextProviderTest.java

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
11
package com.clickhouse.client.config;
22

3-
import java.io.ByteArrayOutputStream;
3+
import com.clickhouse.data.ClickHouseUtils;
4+
import org.testng.Assert;
5+
import org.testng.annotations.Test;
6+
47
import java.io.FileNotFoundException;
58
import java.io.InputStream;
69
import java.nio.charset.StandardCharsets;
710
import java.security.KeyStore;
811
import java.security.PrivateKey;
912

10-
import com.clickhouse.data.ClickHouseUtils;
11-
12-
import org.testng.Assert;
13-
import org.testng.annotations.Test;
14-
1513
public class ClickHouseDefaultSslContextProviderTest {
1614
static String readTestResource(String name) throws Exception {
17-
ByteArrayOutputStream out = new ByteArrayOutputStream();
1815
try (InputStream in = ClickHouseUtils.getFileInputStream(name)) {
19-
byte[] buffer = new byte[2048];
20-
int read;
21-
while ((read = in.read(buffer)) != -1) {
22-
out.write(buffer, 0, read);
23-
}
16+
return new String(in.readAllBytes(), StandardCharsets.US_ASCII);
2417
}
25-
return new String(out.toByteArray(), StandardCharsets.US_ASCII);
2618
}
2719

2820
@Test(groups = { "unit" })

0 commit comments

Comments
 (0)