diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2022-07-29 15:44:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-29 15:44:31 +0200 |
commit | 372f6d7371d42ef23b543d4349cfeabf25ac400b (patch) | |
tree | 9af9d03b14f4a3cf4747428071574ec668e3f3f7 /application-preprocessor | |
parent | 5aa9bb607b7d4262c8ea13d20671f7264c3c59c5 (diff) | |
parent | 4b53d0d135fcacc5964b2720678642f182fd15d1 (diff) |
Merge pull request #23555 from vespa-engine/bjorncs/more-junit5v8.26.15
Bjorncs/more junit5
Diffstat (limited to 'application-preprocessor')
-rw-r--r-- | application-preprocessor/pom.xml | 27 | ||||
-rw-r--r-- | application-preprocessor/src/test/java/com/yahoo/application/preprocessor/ApplicationPreprocessorTest.java | 26 |
2 files changed, 33 insertions, 20 deletions
diff --git a/application-preprocessor/pom.xml b/application-preprocessor/pom.xml index 2cc75b885a9..aae9f6bb13a 100644 --- a/application-preprocessor/pom.xml +++ b/application-preprocessor/pom.xml @@ -19,9 +19,9 @@ <version>${project.version}</version> </dependency> <dependency> - <groupId>com.yahoo.vespa</groupId> - <artifactId>config-model-api</artifactId> - <version>${project.version}</version> + <groupId>com.yahoo.vespa</groupId> + <artifactId>config-model-api</artifactId> + <version>${project.version}</version> </dependency> <dependency> <groupId>com.yahoo.vespa</groupId> @@ -33,10 +33,10 @@ <artifactId>config-model</artifactId> <version>${project.version}</version> <exclusions> - <exclusion> - <groupId>org.antlr</groupId> - <artifactId>antlr4-runtime</artifactId> - </exclusion> + <exclusion> + <groupId>org.antlr</groupId> + <artifactId>antlr4-runtime</artifactId> + </exclusion> </exclusions> </dependency> <dependency> @@ -50,14 +50,19 @@ <version>${project.version}</version> </dependency> <dependency> - <groupId>com.google.guava</groupId> - <artifactId>guava</artifactId> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-api</artifactId> + <scope>test</scope> </dependency> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-engine</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + </dependency> </dependencies> <build> <plugins> 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; + } + } |