nastra commented on code in PR #11522:
URL: https://github.com/apache/iceberg/pull/11522#discussion_r1872744326


##########
core/src/test/java/org/apache/iceberg/rest/TestHTTPClient.java:
##########
@@ -249,6 +251,39 @@ public void testSocketAndConnectionTimeoutSet() {
     
assertThat(connectionConfig.getSocketTimeout().getDuration()).isEqualTo(socketTimeoutMs);
   }
 
+  @Test
+  public void testMaxConnectionSet() {
+    int maxConnections = 10;
+    int maxConnectionPerRoute = 5;
+    Map<String, String> properties =
+        ImmutableMap.of(
+            HTTPClient.REST_MAX_CONNECTIONS, String.valueOf(maxConnections),
+            HTTPClient.REST_MAX_CONNECTIONS_PER_ROUTE, 
String.valueOf(maxConnectionPerRoute));
+
+    HttpClientConnectionManager connectionManager =
+        HTTPClient.configureConnectionManager(properties);
+    
assertThat(connectionManager).isInstanceOf(PoolingHttpClientConnectionManager.class);
+    PoolingHttpClientConnectionManager poolingHttpClientConnectionManager =
+        (PoolingHttpClientConnectionManager) connectionManager;
+    
assertThat(poolingHttpClientConnectionManager.getMaxTotal()).isEqualTo(maxConnections);
+    assertThat(poolingHttpClientConnectionManager.getDefaultMaxPerRoute())
+        .isEqualTo(maxConnectionPerRoute);
+  }
+
+  @Test
+  public void testMaxConnectionUnSet() {

Review Comment:
   ```suggestion
     public void testMaxConnectionSettingsFromDefaults() {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to