From 2e6a0a3170724e87896c68030ac35aaff022464f Mon Sep 17 00:00:00 2001 From: Max Lepikhin Date: Wed, 11 Dec 2024 19:00:07 -0700 Subject: [PATCH] clean up test Signed-off-by: Max Lepikhin --- .../org/opensearch/ml/engine/utils/FileUtilsTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ml-algorithms/src/test/java/org/opensearch/ml/engine/utils/FileUtilsTest.java b/ml-algorithms/src/test/java/org/opensearch/ml/engine/utils/FileUtilsTest.java index 16138fea8b..390286aadd 100644 --- a/ml-algorithms/src/test/java/org/opensearch/ml/engine/utils/FileUtilsTest.java +++ b/ml-algorithms/src/test/java/org/opensearch/ml/engine/utils/FileUtilsTest.java @@ -22,16 +22,19 @@ import org.junit.rules.TemporaryFolder; public class FileUtilsTest { - private final TemporaryFolder tempDir = new TemporaryFolder(); + private TemporaryFolder tempDir; @Before public void setUp() throws Exception { + tempDir = new TemporaryFolder(); tempDir.create(); } @After - public void tearUp() { - tempDir.delete(); + public void tearDown() { + if (tempDir != null) { + tempDir.delete(); + } } @Test