@@ -93,8 +93,7 @@ public void ensureRoutingShouldUpdateRoutingTableAndPurgeConnectionPoolWhenStale
9393 when ( routingTable .update ( any ( ClusterComposition .class ) ) ).thenReturn ( set );
9494
9595 // when
96- LoadBalancer balancer = new LoadBalancer ( conns , routingTable , rediscovery , DEV_NULL_LOGGER ,
97- new LeastConnectedLoadBalancingStrategy ( conns ) );
96+ LoadBalancer balancer = new LoadBalancer ( conns , routingTable , rediscovery , DEV_NULL_LOGGER );
9897
9998 // then
10099 assertNotNull ( balancer );
@@ -110,8 +109,7 @@ public void shouldRefreshRoutingTableOnInitialization() throws Exception
110109 // given & when
111110 final AtomicInteger refreshRoutingTableCounter = new AtomicInteger ( 0 );
112111 LoadBalancer balancer = new LoadBalancer ( mock ( ConnectionPool .class ), mock ( RoutingTable .class ),
113- mock ( Rediscovery .class ), DEV_NULL_LOGGER ,
114- new LeastConnectedLoadBalancingStrategy ( mock ( ConnectionPool .class ) ) )
112+ mock ( Rediscovery .class ), DEV_NULL_LOGGER )
115113 {
116114 @ Override
117115 synchronized void refreshRoutingTable ()
@@ -165,8 +163,7 @@ public void shouldForgetAddressAndItsConnectionsOnServiceUnavailableWhileClosing
165163 RoutingTable routingTable = mock ( RoutingTable .class );
166164 ConnectionPool connectionPool = mock ( ConnectionPool .class );
167165 Rediscovery rediscovery = mock ( Rediscovery .class );
168- LoadBalancer loadBalancer = new LoadBalancer ( connectionPool , routingTable , rediscovery , DEV_NULL_LOGGER ,
169- new LeastConnectedLoadBalancingStrategy ( connectionPool ) );
166+ LoadBalancer loadBalancer = new LoadBalancer ( connectionPool , routingTable , rediscovery , DEV_NULL_LOGGER );
170167 BoltServerAddress address = new BoltServerAddress ( "host" , 42 );
171168
172169 PooledConnection connection = newConnectionWithFailingSync ( address );
@@ -200,8 +197,7 @@ public void shouldForgetAddressAndItsConnectionsOnServiceUnavailableWhileClosing
200197 PooledConnection connectionWithFailingSync = newConnectionWithFailingSync ( address );
201198 when ( connectionPool .acquire ( any ( BoltServerAddress .class ) ) ).thenReturn ( connectionWithFailingSync );
202199 Rediscovery rediscovery = mock ( Rediscovery .class );
203- LoadBalancer loadBalancer = new LoadBalancer ( connectionPool , routingTable , rediscovery , DEV_NULL_LOGGER ,
204- new LeastConnectedLoadBalancingStrategy ( connectionPool ) );
200+ LoadBalancer loadBalancer = new LoadBalancer ( connectionPool , routingTable , rediscovery , DEV_NULL_LOGGER );
205201
206202 Session session = newSession ( loadBalancer );
207203 // begin transaction to make session obtain a connection
@@ -247,8 +243,7 @@ public void shouldThrowWhenRediscoveryReturnsNoSuitableServers()
247243 when ( routingTable .readers () ).thenReturn ( new AddressSet () );
248244 when ( routingTable .writers () ).thenReturn ( new AddressSet () );
249245
250- LoadBalancer loadBalancer = new LoadBalancer ( connections , routingTable , rediscovery , DEV_NULL_LOGGER ,
251- new LeastConnectedLoadBalancingStrategy ( connections ) );
246+ LoadBalancer loadBalancer = new LoadBalancer ( connections , routingTable , rediscovery , DEV_NULL_LOGGER );
252247
253248 try
254249 {
@@ -288,8 +283,7 @@ public void shouldSelectLeastConnectedAddress()
288283
289284 Rediscovery rediscovery = mock ( Rediscovery .class );
290285
291- LoadBalancer loadBalancer = new LoadBalancer ( connectionPool , routingTable , rediscovery , DEV_NULL_LOGGER ,
292- new LeastConnectedLoadBalancingStrategy ( connectionPool ) );
286+ LoadBalancer loadBalancer = new LoadBalancer ( connectionPool , routingTable , rediscovery , DEV_NULL_LOGGER );
293287
294288 Set <BoltServerAddress > seenAddresses = new HashSet <>();
295289 for ( int i = 0 ; i < 10 ; i ++ )
@@ -315,8 +309,7 @@ public void shouldRoundRobinWhenNoActiveConnections()
315309
316310 Rediscovery rediscovery = mock ( Rediscovery .class );
317311
318- LoadBalancer loadBalancer = new LoadBalancer ( connectionPool , routingTable , rediscovery , DEV_NULL_LOGGER ,
319- new LeastConnectedLoadBalancingStrategy ( connectionPool ) );
312+ LoadBalancer loadBalancer = new LoadBalancer ( connectionPool , routingTable , rediscovery , DEV_NULL_LOGGER );
320313
321314 Set <BoltServerAddress > seenAddresses = new HashSet <>();
322315 for ( int i = 0 ; i < 10 ; i ++ )
@@ -337,8 +330,7 @@ private void testRediscoveryWhenStale( AccessMode mode )
337330 RoutingTable routingTable = newStaleRoutingTableMock ( mode );
338331 Rediscovery rediscovery = newRediscoveryMock ();
339332
340- LoadBalancer loadBalancer = new LoadBalancer ( connections , routingTable , rediscovery , DEV_NULL_LOGGER ,
341- new LeastConnectedLoadBalancingStrategy ( connections ) );
333+ LoadBalancer loadBalancer = new LoadBalancer ( connections , routingTable , rediscovery , DEV_NULL_LOGGER );
342334 verify ( rediscovery ).lookupClusterComposition ( routingTable , connections );
343335
344336 assertNotNull ( loadBalancer .acquireConnection ( mode ) );
@@ -354,8 +346,7 @@ private void testNoRediscoveryWhenNotStale( AccessMode staleMode, AccessMode not
354346 RoutingTable routingTable = newStaleRoutingTableMock ( staleMode );
355347 Rediscovery rediscovery = newRediscoveryMock ();
356348
357- LoadBalancer loadBalancer = new LoadBalancer ( connections , routingTable , rediscovery , DEV_NULL_LOGGER ,
358- new LeastConnectedLoadBalancingStrategy ( connections ) );
349+ LoadBalancer loadBalancer = new LoadBalancer ( connections , routingTable , rediscovery , DEV_NULL_LOGGER );
359350 verify ( rediscovery ).lookupClusterComposition ( routingTable , connections );
360351
361352 assertNotNull ( loadBalancer .acquireConnection ( notStaleMode ) );
@@ -388,8 +379,7 @@ private LoadBalancer setupLoadBalancer( PooledConnection writerConn, PooledConne
388379 when ( routingTable .readers () ).thenReturn ( readerAddrs );
389380 when ( routingTable .writers () ).thenReturn ( writerAddrs );
390381
391- return new LoadBalancer ( connPool , routingTable , rediscovery , DEV_NULL_LOGGER ,
392- new LeastConnectedLoadBalancingStrategy ( connPool ) );
382+ return new LoadBalancer ( connPool , routingTable , rediscovery , DEV_NULL_LOGGER );
393383 }
394384
395385 private static Session newSession ( LoadBalancer loadBalancer )
0 commit comments