aboutsummaryrefslogtreecommitdiffstats
path: root/hosted-tenant-base
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2020-09-02 14:19:33 +0200
committerBjørn Christian Seime <bjorncs@verizonmedia.com>2020-09-02 14:19:33 +0200
commitab978a1dab9fc61e215796ffa1707f28338f1565 (patch)
tree156c23db5a21d02c5164ce240166c46aa3ad99b1 /hosted-tenant-base
parentf7551282dae23a3d079c406bd15b23025bbe0f68 (diff)
Allow application projects to run unit tests using junit4
Diffstat (limited to 'hosted-tenant-base')
-rw-r--r--hosted-tenant-base/pom.xml35
1 files changed, 25 insertions, 10 deletions
diff --git a/hosted-tenant-base/pom.xml b/hosted-tenant-base/pom.xml
index 7afafb96280..86b28368db7 100644
--- a/hosted-tenant-base/pom.xml
+++ b/hosted-tenant-base/pom.xml
@@ -37,6 +37,7 @@
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.22.0</maven-surefire-plugin.version>
<junit.version>5.6.2</junit.version> <!-- NOTE: this must be in sync with junit version specified in 'tenant-cd-api' -->
+ <junit4.version>4.13</junit4.version> <!-- NOTE: must be compatible with junit5 vintage engine -->
<test.categories>!integration</test.categories>
<!-- To allow specialized base pom to include additional "test provided" dependencies -->
@@ -68,16 +69,10 @@
</dependency>
<dependency>
- <groupId>org.junit.vintage</groupId>
- <artifactId>junit-vintage-engine</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter-engine</artifactId>
- <version>${junit.version}</version>
+ <!-- Note: applications must manually add junit4 in pom.xml -->
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>{junit4.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -108,7 +103,26 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <!-- Allow applications to use Junit4 in unit tests (assuming junit4 is added to application's pom.xml) -->
+ <groupId>org.junit.vintage</groupId>
+ <artifactId>junit-vintage-engine</artifactId>
+ <version>${junit.version}</version>
<scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-core</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
</dependencies>
@@ -195,6 +209,7 @@
com.yahoo.vespa:container-test:runtime,
org.junit.jupiter:junit-jupiter-api:provided,
org.junit.jupiter:junit-jupiter-engine:test,
+ org.junit.jupiter:junit-vintage-engine:test,
com.yahoo.vespa:tenant-cd-api:provided
</testBundleScopeOverrides>
</configuration>