aboutsummaryrefslogtreecommitdiffstats
path: root/application-preprocessor/src/test/java/com/yahoo/application/preprocessor/ApplicationPreprocessorTest.java
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2022-07-29 15:44:31 +0200
committerGitHub <noreply@github.com>2022-07-29 15:44:31 +0200
commit372f6d7371d42ef23b543d4349cfeabf25ac400b (patch)
tree9af9d03b14f4a3cf4747428071574ec668e3f3f7 /application-preprocessor/src/test/java/com/yahoo/application/preprocessor/ApplicationPreprocessorTest.java
parent5aa9bb607b7d4262c8ea13d20671f7264c3c59c5 (diff)
parent4b53d0d135fcacc5964b2720678642f182fd15d1 (diff)
Merge pull request #23555 from vespa-engine/bjorncs/more-junit5v8.26.15
Bjorncs/more junit5
Diffstat (limited to 'application-preprocessor/src/test/java/com/yahoo/application/preprocessor/ApplicationPreprocessorTest.java')
-rw-r--r--application-preprocessor/src/test/java/com/yahoo/application/preprocessor/ApplicationPreprocessorTest.java26
1 files changed, 17 insertions, 9 deletions
diff --git a/application-preprocessor/src/test/java/com/yahoo/application/preprocessor/ApplicationPreprocessorTest.java b/application-preprocessor/src/test/java/com/yahoo/application/preprocessor/ApplicationPreprocessorTest.java
index 5039b05b393..0e5d8fb2784 100644
--- a/application-preprocessor/src/test/java/com/yahoo/application/preprocessor/ApplicationPreprocessorTest.java
+++ b/application-preprocessor/src/test/java/com/yahoo/application/preprocessor/ApplicationPreprocessorTest.java
@@ -1,9 +1,8 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.application.preprocessor;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException;
@@ -14,17 +13,26 @@ import java.util.Optional;
public class ApplicationPreprocessorTest {
- @Rule
- public TemporaryFolder outputDir = new TemporaryFolder();
+ @TempDir
+ public File outputDir;
// Basic test just to check that instantiation and run() works. Unit testing is in config-application-package
@Test
- public void basic() throws ParserConfigurationException, TransformerException, SAXException, IOException {
+ void basic() throws ParserConfigurationException, TransformerException, SAXException, IOException {
ApplicationPreprocessor preprocessor = new ApplicationPreprocessor(new File("src/test/resources/simple"),
- Optional.of(outputDir.newFolder()),
- Optional.empty(),
- Optional.empty());
+ Optional.of(newFolder(outputDir, "basic")),
+ Optional.empty(),
+ Optional.empty());
preprocessor.run();
}
+ private static File newFolder(File root, String... subDirs) throws IOException {
+ String subFolder = String.join("/", subDirs);
+ File result = new File(root, subFolder);
+ if (!result.mkdirs()) {
+ throw new IOException("Couldn't create folders " + root);
+ }
+ return result;
+ }
+
}