File tree Expand file tree Collapse file tree
clickhouse-client/src/test/java/com/clickhouse/client/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package 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+
47import java .io .FileNotFoundException ;
58import java .io .InputStream ;
69import java .nio .charset .StandardCharsets ;
710import java .security .KeyStore ;
811import java .security .PrivateKey ;
912
10- import com .clickhouse .data .ClickHouseUtils ;
11-
12- import org .testng .Assert ;
13- import org .testng .annotations .Test ;
14-
1513public 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" })
You can’t perform that action at this time.
0 commit comments