@@ -277,7 +277,7 @@ class ConnectionPoolTest {
277277
278278 // Add a connection to the pool that won't expire for a while
279279 routePlanner.defaultConnectionIdleAtNanos = expireLater
280- setPolicy(pool, address, ConnectionPool .AddressPolicy (1 ))
280+ setPolicy(pool, address, ConnectionPool .AddressPolicy (minimumConcurrentCalls = 1 ))
281281 assertThat(pool.connectionCount()).isEqualTo(1 )
282282
283283 // All other connections created will expire sooner
@@ -287,31 +287,31 @@ class ConnectionPoolTest {
287287 // which can satisfy a larger policy
288288 val connection = routePlanner.plans.first().connection
289289 val http2Connection = connectHttp2(peer, connection, 5 )
290- setPolicy(pool, address, ConnectionPool .AddressPolicy (5 ))
290+ setPolicy(pool, address, ConnectionPool .AddressPolicy (minimumConcurrentCalls = 5 ))
291291 assertThat(pool.connectionCount()).isEqualTo(1 )
292292
293293 // Decrease the policy max connections, and check that new connections are created
294- setPolicy(pool, address, ConnectionPool .AddressPolicy (5 , 1 ))
294+ setPolicy(pool, address, ConnectionPool .AddressPolicy (minimumConcurrentCalls = 5 , maximumConcurrentCallsPerConnection = 1 ))
295295 // fills up the first connect and then adds single connections
296296 // 5 = 1 + 1 + 1 + 1 + 1 (five unique connections)
297297 assertThat(pool.connectionCount()).isEqualTo(5 )
298298
299299 // increase the policy max connections, and check that new connections are created
300- setPolicy(pool, address, ConnectionPool .AddressPolicy (5 , 2 ))
300+ setPolicy(pool, address, ConnectionPool .AddressPolicy (minimumConcurrentCalls = 5 , maximumConcurrentCallsPerConnection = 2 ))
301301 forceConnectionsToExpire(pool, expireSooner)
302302 // fills up the first connect and then adds single connections
303303 // 5 = 2 + 1 + 1 + 1 (four unique connections)
304304 assertThat(pool.connectionCount()).isEqualTo(4 )
305305
306306 // increase the policy max connections, and check that new connections are created
307- setPolicy(pool, address, ConnectionPool .AddressPolicy (5 , 4 ))
307+ setPolicy(pool, address, ConnectionPool .AddressPolicy (minimumConcurrentCalls = 5 , maximumConcurrentCallsPerConnection = 4 ))
308308 forceConnectionsToExpire(pool, expireSooner)
309309 // fills up the first connect and then adds single connections
310310 // 5 = 4 + 1 (two unique connections)
311311 assertThat(pool.connectionCount()).isEqualTo(2 )
312312
313313 // Decrease the policy max connections, and check that new connections are created
314- setPolicy(pool, address, ConnectionPool .AddressPolicy (5 , 3 ))
314+ setPolicy(pool, address, ConnectionPool .AddressPolicy (minimumConcurrentCalls = 5 , maximumConcurrentCallsPerConnection = 3 ))
315315 // fills up the first connect and then removes an unused after
316316 // 5 = 3 + 1 + 1 (three unique connections)
317317 assertThat(pool.connectionCount()).isEqualTo(3 )
0 commit comments