diff --git a/wrapper/src/test/java/integration/container/tests/TopologyQueryTests.java b/wrapper/src/test/java/integration/container/tests/TopologyQueryTests.java index 96553168c..ef9a4056d 100644 --- a/wrapper/src/test/java/integration/container/tests/TopologyQueryTests.java +++ b/wrapper/src/test/java/integration/container/tests/TopologyQueryTests.java @@ -65,11 +65,12 @@ TestEnvironmentFeatures.RUN_AUTOSCALING_TESTS_ONLY}) public class TopologyQueryTests { private static final Logger LOGGER = Logger.getLogger(TopologyQueryTests.class.getName()); + private AuroraTestUtility util = new AuroraTestUtility(); @TestTemplate @EnableOnDatabaseEngineDeployment(DatabaseEngineDeployment.AURORA) @ExtendWith(TestDriverProvider.class) - public void auroraTestTypes(TestDriver testDriver) throws SQLException { + public void testAuroraTypes(TestDriver testDriver) throws SQLException { LOGGER.info(testDriver.toString()); List expectedTypes; @@ -134,7 +135,7 @@ public void auroraTestTypes(TestDriver testDriver) throws SQLException { @ExtendWith(TestDriverProvider.class) @EnableOnDatabaseEngineDeployment(DatabaseEngineDeployment.AURORA) @EnableOnNumOfInstances(min = 2) - public void auroraTestTimestamp(TestDriver testDriver) throws SQLException, ParseException { + public void testAuroraTimestamp(TestDriver testDriver) throws SQLException, ParseException { LOGGER.info(testDriver.toString()); final Properties props = ConnectionStringHelper.getDefaultPropertiesWithNoPlugins(); @@ -159,6 +160,7 @@ public void auroraTestTimestamp(TestDriver testDriver) throws SQLException, Pars TestEnvironment.getCurrent().getInfo().getDatabaseInfo().getDefaultDbName()); LOGGER.finest("Connecting to " + url); + // Update cluster to get non-null timestamp String dbInstanceIdentifier = TestEnvironment.getCurrent().getInfo() .getDatabaseInfo() .getInstances() @@ -171,7 +173,8 @@ public void auroraTestTimestamp(TestDriver testDriver) throws SQLException, Pars RdsClient client = RdsClient.builder() .region(region) .build(); - AuroraTestUtility.updateInstance(client, dbInstanceIdentifier); + util.updateInstanceCertificateIdentifier( + dbInstanceIdentifier, "rds-ca-rsa4096-g1"); client.close(); String query = null; @@ -192,7 +195,6 @@ public void auroraTestTimestamp(TestDriver testDriver) throws SQLException, Pars ResultSet rs = stmt.getResultSet(); Date date = null; - // Skip the first row, empty timestamp while (rs.next()) { if (rs.getString(5) != null) { date = format.parse(rs.getString(5)); @@ -209,7 +211,7 @@ public void auroraTestTimestamp(TestDriver testDriver) throws SQLException, Pars @EnableOnDatabaseEngineDeployment(DatabaseEngineDeployment.RDS) @Disabled // TODO: Disabled due to RDS integration tests not being supported yet - public void rdsTestTypes(TestDriver testDriver) throws SQLException { + public void testRdsTypes(TestDriver testDriver) throws SQLException { LOGGER.info(testDriver.toString()); final Properties props = ConnectionStringHelper.getDefaultPropertiesWithNoPlugins(); @@ -245,7 +247,7 @@ public void rdsTestTypes(TestDriver testDriver) throws SQLException { } else { query = RdsMultiAzDbClusterMysqlDialect.TOPOLOGY_QUERY; expectedTypes = Arrays.asList( - "INT", + "VARCHAR", "VARCHAR", "INT" ); diff --git a/wrapper/src/test/java/integration/util/AuroraTestUtility.java b/wrapper/src/test/java/integration/util/AuroraTestUtility.java index 6a3720db4..e8d20aef9 100644 --- a/wrapper/src/test/java/integration/util/AuroraTestUtility.java +++ b/wrapper/src/test/java/integration/util/AuroraTestUtility.java @@ -75,7 +75,6 @@ import software.amazon.awssdk.services.rds.model.FailoverDbClusterResponse; import software.amazon.awssdk.services.rds.model.Filter; import software.amazon.awssdk.services.rds.model.ModifyDbInstanceRequest; -import software.amazon.awssdk.services.rds.model.ModifyDbInstanceResponse; import software.amazon.awssdk.services.rds.model.RdsException; import software.amazon.awssdk.services.rds.model.Tag; import software.amazon.awssdk.services.rds.waiters.RdsWaiter; @@ -927,15 +926,15 @@ public void addAuroraAwsIamUser( } } - public static void updateInstance(RdsClient client, String dbInstanceIdentifier) { + public void updateInstanceCertificateIdentifier(String dbInstanceIdentifier, String certificateIdentifier) { try { ModifyDbInstanceRequest modifyDbInstanceRequest = ModifyDbInstanceRequest.builder() .dbInstanceIdentifier(dbInstanceIdentifier) .publiclyAccessible(true) .applyImmediately(true) - .caCertificateIdentifier("rds-ca-rsa4096-g1") + .caCertificateIdentifier(certificateIdentifier) .build(); - client.modifyDBInstance(modifyDbInstanceRequest); + rdsClient.modifyDBInstance(modifyDbInstanceRequest); } catch (RdsException e) { LOGGER.finer(e.getLocalizedMessage()); }