Skip to content

Commit

Permalink
fix: closes result set in test
Browse files Browse the repository at this point in the history
Addresses PR comment.
  • Loading branch information
thiagotnunes committed Oct 1, 2020
1 parent e6abbab commit 0528b8c
Showing 1 changed file with 8 additions and 7 deletions.
Expand Up @@ -120,21 +120,22 @@ public void returnsTheVersionRetentionPeriodSetThroughGetDatabaseDdl() {

@Test
public void returnsTheVersionRetentionPeriodSetThroughInformationSchema() {
final ResultSet rs =
try (final ResultSet rs =
dbClient
.singleUse()
.executeQuery(
Statement.of(
"SELECT OPTION_VALUE AS version_retention_period "
+ "FROM INFORMATION_SCHEMA.DATABASE_OPTIONS "
+ "WHERE SCHEMA_NAME = '' AND OPTION_NAME = 'version_retention_period'"));
+ "WHERE SCHEMA_NAME = '' AND OPTION_NAME = 'version_retention_period'"))) {

String versionRetentionPeriod = null;
while (rs.next()) {
versionRetentionPeriod = rs.getString("version_retention_period");
}
String versionRetentionPeriod = null;
while (rs.next()) {
versionRetentionPeriod = rs.getString("version_retention_period");
}

assertThat(versionRetentionPeriod).isEqualTo(VERSION_RETENTION_PERIOD);
assertThat(versionRetentionPeriod).isEqualTo(VERSION_RETENTION_PERIOD);
}
}

@Test
Expand Down

0 comments on commit 0528b8c

Please sign in to comment.