@@ -138,7 +138,8 @@ public void testGetHttpTransportOptionsWithAuthenticatedProxy() {
138138 Map <String , String > proxyProperties =
139139 BigQueryJdbcProxyUtility .parseProxyProperties (connection_uri , null );
140140 HttpTransportOptions result =
141- BigQueryJdbcProxyUtility .getHttpTransportOptions (proxyProperties , null , null , null );
141+ BigQueryJdbcProxyUtility .getHttpTransportOptions (
142+ proxyProperties , null , null , null , null , "TestClass" );
142143 assertNotNull (result );
143144 }
144145
@@ -154,7 +155,8 @@ public void testGetHttpTransportOptionsWithNonAuthenticatedProxy() {
154155 Map <String , String > proxyProperties =
155156 BigQueryJdbcProxyUtility .parseProxyProperties (connection_uri , null );
156157 HttpTransportOptions result =
157- BigQueryJdbcProxyUtility .getHttpTransportOptions (proxyProperties , null , null , null );
158+ BigQueryJdbcProxyUtility .getHttpTransportOptions (
159+ proxyProperties , null , null , null , null , "TestClass" );
158160 assertNotNull (result );
159161 }
160162
@@ -168,7 +170,8 @@ public void testGetHttpTransportOptionsWithNoProxySettingsReturnsNull() {
168170 Map <String , String > proxyProperties =
169171 BigQueryJdbcProxyUtility .parseProxyProperties (connection_uri , null );
170172 HttpTransportOptions result =
171- BigQueryJdbcProxyUtility .getHttpTransportOptions (proxyProperties , null , null , null );
173+ BigQueryJdbcProxyUtility .getHttpTransportOptions (
174+ proxyProperties , null , null , null , null , "TestClass" );
172175 assertNull (result );
173176 }
174177
@@ -185,7 +188,7 @@ public void testGetHttpTransportOptions_withSslTrustStore_noPassword() throws Ex
185188 String trustStorePath = getTestResourcePath ("test_truststore_nopass.jks" );
186189 HttpTransportOptions options =
187190 BigQueryJdbcProxyUtility .getHttpTransportOptions (
188- Collections .<String , String >emptyMap (), trustStorePath , null , "TestClass" );
191+ Collections .<String , String >emptyMap (), trustStorePath , null , null , null , "TestClass" );
189192 assertNotNull (options );
190193 assertNotNull (options .getHttpTransportFactory ());
191194 }
@@ -195,7 +198,12 @@ public void testGetHttpTransportOptions_withSslTrustStore_withCorrectPassword()
195198 String trustStorePath = getTestResourcePath ("test_truststore_withpass.jks" );
196199 HttpTransportOptions options =
197200 BigQueryJdbcProxyUtility .getHttpTransportOptions (
198- Collections .<String , String >emptyMap (), trustStorePath , "testpassword" , "TestClass" );
201+ Collections .<String , String >emptyMap (),
202+ trustStorePath ,
203+ "testpassword" ,
204+ null ,
205+ null ,
206+ "TestClass" );
199207 assertNotNull (options );
200208 assertNotNull (options .getHttpTransportFactory ());
201209 }
@@ -212,6 +220,8 @@ public void testGetHttpTransportOptions_withSslTrustStore_withIncorrectPassword(
212220 Collections .<String , String >emptyMap (),
213221 trustStorePath ,
214222 "wrongpassword" ,
223+ null ,
224+ null ,
215225 "TestClass" ));
216226 assertThat (exception .getCause ()).isInstanceOf (IOException .class );
217227 }
@@ -224,7 +234,12 @@ public void testGetHttpTransportOptions_withInvalidSslTrustStorePath() {
224234 BigQueryJdbcRuntimeException .class ,
225235 () ->
226236 BigQueryJdbcProxyUtility .getHttpTransportOptions (
227- Collections .<String , String >emptyMap (), invalidPath , null , "TestClass" ));
237+ Collections .<String , String >emptyMap (),
238+ invalidPath ,
239+ null ,
240+ null ,
241+ null ,
242+ "TestClass" ));
228243
229244 assertThat (exception .getCause ()).isInstanceOf (FileNotFoundException .class );
230245 }
@@ -238,7 +253,7 @@ public void testGetHttpTransportOptions_withSslAndProxy() throws Exception {
238253
239254 HttpTransportOptions options =
240255 BigQueryJdbcProxyUtility .getHttpTransportOptions (
241- proxyProperties , trustStorePath , null , "TestClass" );
256+ proxyProperties , trustStorePath , null , null , null , "TestClass" );
242257 assertNotNull (options );
243258 assertNotNull (options .getHttpTransportFactory ());
244259 }
@@ -287,7 +302,26 @@ public void testGetTransportChannelProvider_noProxyNoSsl_returnsNull() {
287302 public void testGetHttpTransportOptions_noProxyNoSsl_returnsNull () {
288303 HttpTransportOptions options =
289304 BigQueryJdbcProxyUtility .getHttpTransportOptions (
290- Collections .<String , String >emptyMap (), null , null , "TestClass" );
305+ Collections .<String , String >emptyMap (), null , null , null , null , "TestClass" );
291306 assertNull (options );
292307 }
308+
309+ @ Test
310+ public void testGetHttpTransportOptions_withTimeouts_returnsOptions () {
311+ HttpTransportOptions options =
312+ BigQueryJdbcProxyUtility .getHttpTransportOptions (
313+ Collections .<String , String >emptyMap (), null , null , 10000 , 20000 , "TestClass" );
314+ assertNotNull (options );
315+ assertThat (options .getConnectTimeout ()).isEqualTo (10000 );
316+ assertThat (options .getReadTimeout ()).isEqualTo (20000 );
317+ }
318+
319+ @ Test
320+ public void testGetHttpTransportOptions_withConnectTimeoutOnly_returnsOptions () {
321+ HttpTransportOptions options =
322+ BigQueryJdbcProxyUtility .getHttpTransportOptions (
323+ Collections .<String , String >emptyMap (), null , null , 10000 , null , "TestClass" );
324+ assertNotNull (options );
325+ assertThat (options .getConnectTimeout ()).isEqualTo (10000 );
326+ }
293327}
0 commit comments