@@ -223,22 +223,39 @@ public void test_ProxiedDirectConnection(TestDriver testDriver) throws SQLExcept
223
223
conn .close ();
224
224
}
225
225
226
- @ ParameterizedTest
226
+ @ TestTemplate
227
227
@ EnableOnNumOfInstances (min = 2 )
228
228
@ EnableOnDatabaseEngineDeployment ({DatabaseEngineDeployment .AURORA , DatabaseEngineDeployment .RDS_MULTI_AZ_CLUSTER })
229
- @ MethodSource ("testPluginParameters" )
230
- public void testBasicConnectivityTestWithPlugins (String plugin , String url ) throws SQLException {
231
- final Properties props = getDefaultProperties ();
232
- props .setProperty (PropertyDefinition .PLUGINS .name , plugin );
233
- LOGGER .finest ("Connecting to " + url );
229
+ public void testBasicConnectivityTestWithPlugins () throws SQLException {
230
+ final TestInstanceInfo readerInstance = TestEnvironment .getCurrent ()
231
+ .getInfo ()
232
+ .getDatabaseInfo ()
233
+ .getInstances ()
234
+ .get (1 );
234
235
235
- try (Connection conn = DriverManager .getConnection (url , props );
236
- Statement stmt = conn .createStatement ();
237
- ResultSet rs = stmt .executeQuery ("SELECT 1" );
238
- ) {
239
- assertTrue (rs .next ());
240
- assertEquals (1 , rs .getInt (1 ));
236
+ final List <String > urls = Arrays .asList (
237
+ ConnectionStringHelper .getWrapperUrl (),
238
+ ConnectionStringHelper .getWrapperUrl (readerInstance ),
239
+ ConnectionStringHelper .getWrapperClusterEndpointUrl (),
240
+ ConnectionStringHelper .getWrapperReaderClusterUrl ()
241
+ );
242
+
243
+ for (String url : urls ) {
244
+ for (String plugin : PLUGINS ) {
245
+ final Properties props = getDefaultProperties ();
246
+ props .setProperty (PropertyDefinition .PLUGINS .name , plugin );
247
+ LOGGER .finest ("Connecting to " + url );
248
+
249
+ try (Connection conn = DriverManager .getConnection (url , props );
250
+ Statement stmt = conn .createStatement ();
251
+ ResultSet rs = stmt .executeQuery ("SELECT 1" );
252
+ ) {
253
+ assertTrue (rs .next ());
254
+ assertEquals (1 , rs .getInt (1 ));
255
+ }
256
+ }
241
257
}
258
+
242
259
}
243
260
244
261
@ TestTemplate
@@ -474,29 +491,4 @@ private static Stream<Arguments> testPropertiesParameters() {
474
491
}
475
492
return results .stream ();
476
493
}
477
-
478
- private static Stream <Arguments > testPluginParameters () {
479
- final List <Arguments > results = new ArrayList <>();
480
- final TestInstanceInfo readerInstance = TestEnvironment .getCurrent ()
481
- .getInfo ()
482
- .getDatabaseInfo ()
483
- .getInstances ()
484
- .get (1 );
485
- final String writerInstanceUrl = ConnectionStringHelper .getWrapperUrl ();
486
- final String readerInstanceUrl = ConnectionStringHelper .getWrapperUrl (readerInstance );
487
- final String writerClusterUrl = ConnectionStringHelper .getWrapperClusterEndpointUrl ();
488
- final String readerClusterUrl = ConnectionStringHelper .getWrapperReaderClusterUrl ();
489
-
490
- for (String plugin : PLUGINS ) {
491
- // Connect via writer instance endpoint.
492
- results .add (Arguments .of (plugin , writerInstanceUrl ));
493
- // Connect via reader instance endpoint.
494
- results .add (Arguments .of (plugin , readerInstanceUrl ));
495
- // Connect via writer cluster endpoint.
496
- results .add (Arguments .of (plugin , writerClusterUrl ));
497
- // Connect via reader cluster endpoint.
498
- results .add (Arguments .of (plugin , readerClusterUrl ));
499
- }
500
- return results .stream ();
501
- }
502
494
}
0 commit comments