Skip to content

Commit

Permalink
Simplify cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Mar 23, 2021
1 parent 741ff8f commit 8caa1d6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
Expand Up @@ -43,11 +43,7 @@ public class TestPostgreSqlCaseInsensitiveMapping
protected QueryRunner createQueryRunner()
throws Exception
{
postgreSqlServer = new TestingPostgreSqlServer();
closeAfterClass(() -> {
postgreSqlServer.close();
postgreSqlServer = null;
});
postgreSqlServer = closeAfterClass(new TestingPostgreSqlServer());
return PostgreSqlQueryRunner.createPostgreSqlQueryRunner(
postgreSqlServer,
ImmutableMap.of(),
Expand Down
Expand Up @@ -62,11 +62,7 @@ public class TestPostgreSqlConnectorTest
protected QueryRunner createQueryRunner()
throws Exception
{
postgreSqlServer = new TestingPostgreSqlServer();
closeAfterClass(() -> {
postgreSqlServer.close();
postgreSqlServer = null;
});
postgreSqlServer = closeAfterClass(new TestingPostgreSqlServer());
return createPostgreSqlQueryRunner(postgreSqlServer, Map.of(), Map.of(), REQUIRED_TPCH_TABLES);
}

Expand Down
Expand Up @@ -151,11 +151,7 @@ public class TestPostgreSqlTypeMapping
protected QueryRunner createQueryRunner()
throws Exception
{
postgreSqlServer = new TestingPostgreSqlServer();
closeAfterClass(() -> {
postgreSqlServer.close();
postgreSqlServer = null;
});
postgreSqlServer = closeAfterClass(new TestingPostgreSqlServer());
return createPostgreSqlQueryRunner(
postgreSqlServer,
ImmutableMap.of(),
Expand Down

0 comments on commit 8caa1d6

Please sign in to comment.