diff --git a/presto-hive/src/test/java/io/prestosql/plugin/hive/util/TestFSDataInputStreamTail.java b/presto-hive/src/test/java/io/prestosql/plugin/hive/util/TestFSDataInputStreamTail.java index 6bc4c0c0d7742..bbf811ab1f17d 100644 --- a/presto-hive/src/test/java/io/prestosql/plugin/hive/util/TestFSDataInputStreamTail.java +++ b/presto-hive/src/test/java/io/prestosql/plugin/hive/util/TestFSDataInputStreamTail.java @@ -33,6 +33,7 @@ import java.nio.file.Files; import java.util.Arrays; +import static io.airlift.testing.Closeables.closeAll; import static io.prestosql.plugin.hive.HiveErrorCode.HIVE_FILESYSTEM_ERROR; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertSame; @@ -68,17 +69,9 @@ public void truncateTempFile() public void tearDown() throws Exception { - try { - fs.delete(tempFile, true); - } - catch (IOException ignored) { - } - try { - fs.delete(new Path(tempRoot.toURI()), true); - } - finally { - fs.close(); - } + closeAll( + () -> fs.delete(new Path(tempRoot.toURI()), true), + fs); } @Test