Skip to content

Commit

Permalink
Merge pull request #302 from hazendaz/develop
Browse files Browse the repository at this point in the history
[cleanup] Use try with resources in tests
  • Loading branch information
hazendaz committed May 7, 2023
2 parents 280bc7e + 63b0476 commit 11163ea
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ void testCopyResourceWithVariables() throws Exception {
@Test
void testExternalFile() throws Exception {
File src = File.createTempFile("ExternalTemplate", ".sql");
PrintWriter writer = new PrintWriter(src);
writer.println("// ${var}");
writer.close();
try (PrintWriter writer = new PrintWriter(src)) {
writer.println("// ${var}");
}

File dest = File.createTempFile("Out", ".sql");
try {
Expand All @@ -127,9 +127,9 @@ void testExternalFile() throws Exception {
@Test
void testExternalFileWithVariables() throws Exception {
File src = File.createTempFile("ExternalTemplate", ".sql");
PrintWriter writer = new PrintWriter(src);
writer.println("// ${var}");
writer.close();
try (PrintWriter writer = new PrintWriter(src)) {
writer.println("// ${var}");
}

File dest = File.createTempFile("Out", ".sql");
Properties variables = new Properties();
Expand Down

0 comments on commit 11163ea

Please sign in to comment.