4747import software .amazon .jdbc .RoundRobinHostSelector ;
4848import software .amazon .jdbc .hostavailability .HostAvailability ;
4949import software .amazon .jdbc .hostavailability .SimpleHostAvailabilityStrategy ;
50+ import software .amazon .jdbc .util .PropertyUtils ;
5051import software .amazon .jdbc .wrapper .HighestWeightHostSelector ;
5152
5253public class LimitlessRouterServiceImplTest {
@@ -70,6 +71,7 @@ public void init() throws SQLException {
7071 props = new Properties ();
7172 when (mockConnectFuncLambda .call ()).thenReturn (mockConnection );
7273 when (mockPluginService .getHostListProvider ()).thenReturn (mockHostListProvider );
74+ when (mockPluginService .getProperties ()).thenReturn (props );
7375 when (mockHostListProvider .getClusterId ()).thenReturn (CLUSTER_ID );
7476 }
7577
@@ -85,6 +87,7 @@ void testEstablishConnection_GivenGetEmptyRouterListAndWaitForRouterInfo_ThenThr
8587
8688 final LimitlessConnectionContext inputContext = new LimitlessConnectionContext (
8789 hostSpec ,
90+ PropertyUtils .copyProperties (props ),
8891 props ,
8992 null ,
9093 mockConnectFuncLambda ,
@@ -103,6 +106,7 @@ void testEstablishConnection_GivenGetEmptyRouterListAndNoWaitForRouterInfo_ThenC
103106 props .setProperty (LimitlessConnectionPlugin .WAIT_FOR_ROUTER_INFO .name , "false" );
104107 final LimitlessConnectionContext inputContext = new LimitlessConnectionContext (
105108 hostSpec ,
109+ PropertyUtils .copyProperties (props ),
106110 props ,
107111 null ,
108112 mockConnectFuncLambda ,
@@ -132,6 +136,7 @@ void testEstablishConnection_GivenHostSpecInRouterCache_ThenCallConnectFunc() th
132136
133137 final LimitlessConnectionContext inputContext = new LimitlessConnectionContext (
134138 routerList .get (1 ),
139+ PropertyUtils .copyProperties (props ),
135140 props ,
136141 null ,
137142 mockConnectFuncLambda ,
@@ -163,6 +168,7 @@ void testEstablishConnection_GivenFetchRouterListAndHostSpecInRouterList_ThenCal
163168
164169 final LimitlessConnectionContext inputContext = new LimitlessConnectionContext (
165170 routerList .get (1 ),
171+ PropertyUtils .copyProperties (props ),
166172 props ,
167173 null ,
168174 mockConnectFuncLambda ,
@@ -199,6 +205,7 @@ void testEstablishConnection_GivenRouterCache_ThenSelectsHost() throws SQLExcept
199205
200206 final LimitlessConnectionContext inputContext = new LimitlessConnectionContext (
201207 hostSpec ,
208+ PropertyUtils .copyProperties (props ),
202209 props ,
203210 null ,
204211 mockConnectFuncLambda ,
@@ -234,6 +241,7 @@ void testEstablishConnection_GivenFetchRouterList_ThenSelectsHost() throws SQLEx
234241
235242 final LimitlessConnectionContext inputContext = new LimitlessConnectionContext (
236243 hostSpec ,
244+ PropertyUtils .copyProperties (props ),
237245 props ,
238246 null ,
239247 mockConnectFuncLambda ,
@@ -267,6 +275,7 @@ void testEstablishConnection_GivenHostSpecInRouterCacheAndCallConnectFuncThrows_
267275 final HostSpec selectedRouter = routerList .get (2 );
268276 final LimitlessConnectionContext inputContext = new LimitlessConnectionContext (
269277 routerList .get (1 ),
278+ PropertyUtils .copyProperties (props ),
270279 props ,
271280 null ,
272281 mockConnectFuncLambda ,
@@ -311,6 +320,7 @@ void testEstablishConnection_GivenSelectsHostThrows_ThenRetry() throws SQLExcept
311320
312321 final LimitlessConnectionContext inputContext = new LimitlessConnectionContext (
313322 hostSpec ,
323+ PropertyUtils .copyProperties (props ),
314324 props ,
315325 null ,
316326 mockConnectFuncLambda ,
@@ -350,6 +360,7 @@ void testEstablishConnection_GivenSelectsHostNull_ThenRetry() throws SQLExceptio
350360
351361 final LimitlessConnectionContext inputContext = new LimitlessConnectionContext (
352362 hostSpec ,
363+ PropertyUtils .copyProperties (props ),
353364 props ,
354365 null ,
355366 mockConnectFuncLambda ,
@@ -392,6 +403,7 @@ void testEstablishConnection_GivenPluginServiceConnectThrows_ThenRetry() throws
392403
393404 final LimitlessConnectionContext inputContext = new LimitlessConnectionContext (
394405 hostSpec ,
406+ PropertyUtils .copyProperties (props ),
395407 props ,
396408 null ,
397409 mockConnectFuncLambda ,
@@ -429,6 +441,7 @@ void testEstablishConnection_GivenRetryAndMaxRetriesExceeded_thenThrowSqlExcepti
429441
430442 final LimitlessConnectionContext inputContext = new LimitlessConnectionContext (
431443 routerList .get (0 ),
444+ PropertyUtils .copyProperties (props ),
432445 props ,
433446 null ,
434447 mockConnectFuncLambda ,
0 commit comments