File tree Expand file tree Collapse file tree
client-v2/src/test/java/com/clickhouse/client Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import com .clickhouse .client .api .Client ;
44import com .clickhouse .client .api .ClientException ;
55import com .clickhouse .client .api .ClientMisconfigurationException ;
6+ import com .clickhouse .client .api .ClickHouseException ;
67import com .clickhouse .client .api .enums .Protocol ;
78import com .clickhouse .client .api .enums .ProxyType ;
89import com .clickhouse .client .api .insert .InsertResponse ;
@@ -199,9 +200,13 @@ public void testProxyWithDisabledCookies() {
199200 try {
200201 client .get ().execute ("select 1" ).get ();
201202 } catch (ExecutionException e ) {
202- Assert .assertTrue (e .getCause () instanceof ClientException );
203- } catch (ClientException e ) {
204- Assert .assertTrue (e .getMessage ().contains ("Server returned '502 Bad gateway'" ));
203+ Assert .assertTrue (e .getCause () instanceof ClickHouseException );
204+ Throwable cause = e .getCause ();
205+ Assert .assertTrue (cause .getMessage ().contains ("Server returned '502 Bad gateway'" ) ||
206+ (cause .getCause () != null && cause .getCause ().getMessage ().contains ("Server returned '502 Bad gateway'" )));
207+ } catch (ClickHouseException e ) {
208+ Assert .assertTrue (e .getMessage ().contains ("Server returned '502 Bad gateway'" ) ||
209+ (e .getCause () != null && e .getCause ().getMessage ().contains ("Server returned '502 Bad gateway'" )));
205210 } catch (Exception e ) {
206211 Assert .fail ("Should have thrown exception." , e );
207212 }
You can’t perform that action at this time.
0 commit comments