* Java 3590 (#11367)

* JAVA-3590: updating junit-jupiter dependency in the main pom.xml

* resolving unnecessary mockito stubbings exception

* adding junit-bom in dependency management

* fixing tests which were not getting discovered

* Revert "fixing tests which were not getting discovered"

This reverts commit 2e9ed8df42eb96f7e0929167aabbc2ddd374a263.

* fixing tests in ninja, open-liberty and spring-ejb

* removing junit4 dependency and replacing it with junit-vintage-engine

* removing junit4 dependency and replacing it with junit-vintage-engine in testing-modules, maven-modules and aws-lambda

* removing junit dependency and replacing it with junit-vintage-engine

* removing junit and replacing it with junit-vintage-engine

* fixing tests that were not getting discovered due to old version of junit:junit

* updated failsafe plugin configuration to skip integration tests in blade

* fixing tests that were not getting discovered due to old version of junit:junit

* fixing tests in libraries and libraries-2 modules

Co-authored-by: chaos2418 <>

* Java 3590 - fixing integration tests in restx and spring-5-webflux (#11382)

* JAVA-3590: updating junit-jupiter dependency in the main pom.xml

* resolving unnecessary mockito stubbings exception

* adding junit-bom in dependency management

* fixing tests which were not getting discovered

* Revert "fixing tests which were not getting discovered"

This reverts commit 2e9ed8df42eb96f7e0929167aabbc2ddd374a263.

* fixing tests in ninja, open-liberty and spring-ejb

* removing junit4 dependency and replacing it with junit-vintage-engine

* removing junit4 dependency and replacing it with junit-vintage-engine in testing-modules, maven-modules and aws-lambda

* removing junit dependency and replacing it with junit-vintage-engine

* removing junit and replacing it with junit-vintage-engine

* fixing tests that were not getting discovered due to old version of junit:junit

* updated failsafe plugin configuration to skip integration tests in blade

* fixing tests that were not getting discovered due to old version of junit:junit

* fixing tests in libraries and libraries-2 modules

* fixing integration tests in restx and spring-5-webflux

Co-authored-by: chaos2418 <>

Co-authored-by: chaos2418 <92030908+chaos2418@users.noreply.github.com>
This commit is contained in:
Dhawal Kapil 2021-10-29 09:37:04 +05:30 committed by GitHub
parent 1caf806454
commit 1ab0a19d25
111 changed files with 536 additions and 376 deletions

View File

@ -37,7 +37,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-commons</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform.version}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
@ -53,7 +53,6 @@
<commons-codec.version>1.11</commons-codec.version>
<commons-math3.version>3.6.1</commons-math3.version>
<guava.version>28.1-jre</guava.version>
<junit.platform.version>1.6.0</junit.platform.version>
</properties>
</project>

View File

@ -22,7 +22,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-commons</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform.version}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
@ -46,7 +46,6 @@
<properties>
<guava.version>28.1-jre</guava.version>
<org.assertj.core.version>3.9.0</org.assertj.core.version>
<junit.platform.version>1.6.0</junit.platform.version>
<commons-math3.version>3.6.1</commons-math3.version>
</properties>

View File

@ -32,7 +32,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit-jupiter-api.version}</version>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -47,7 +47,6 @@
<commons-math3.version>3.6.1</commons-math3.version>
<org.assertj.core.version>3.9.0</org.assertj.core.version>
<commons-codec.version>1.11</commons-codec.version>
<junit-jupiter-api.version>5.3.1</junit-jupiter-api.version>
</properties>
</project>

View File

@ -33,7 +33,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit-jupiter-api.version}</version>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -48,7 +48,6 @@
<commons-math3.version>3.6.1</commons-math3.version>
<org.assertj.core.version>3.9.0</org.assertj.core.version>
<commons-codec.version>1.11</commons-codec.version>
<junit-jupiter-api.version>5.3.1</junit-jupiter-api.version>
</properties>
</project>

View File

@ -39,10 +39,6 @@
<scope>runtime</scope>
</dependency>
<!-- spring-sec -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>

View File

@ -72,9 +72,9 @@
<version>${derby.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<!-- the JTA API -->

View File

@ -62,6 +62,13 @@
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>${json-simple.version}</version>
<exclusions>
<!-- junit4 dependency is excluded as it should to be resolved from junit-vintage-engine included in parent-modules. -->
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

View File

@ -12,23 +12,17 @@
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-core</artifactId>
<version>1.2.0</version>
<version>${aws-lambda-java-core.version}</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
<version>3.1.0</version>
<version>${aws-lambda-java-events.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.11.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
<version>${jackson-databind.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
@ -43,7 +37,7 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.16</version>
<version>${postgresql.version}</version>
</dependency>
</dependencies>
@ -71,6 +65,10 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<hibernate.version>5.4.21.Final</hibernate.version>
<aws-lambda-java-core.version>1.2.0</aws-lambda-java-core.version>
<aws-lambda-java-events.version>3.1.0</aws-lambda-java-events.version>
<jackson-databind.version>2.11.2</jackson-databind.version>
<postgresql.version>42.2.16</postgresql.version>
</properties>
</project>

View File

@ -12,70 +12,70 @@
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-core</artifactId>
<version>1.2.1</version>
<version>${aws-lambda-java-core.version}</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
<version>3.6.0</version>
<version>${aws-lambda-java-events.version}</version>
</dependency>
<dependency>
<groupId>uk.org.webcompere</groupId>
<artifactId>lightweight-config</artifactId>
<version>1.1.0</version>
<version>${lightweight-config.version}</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-log4j2</artifactId>
<version>1.2.0</version>
<version>${aws-lambda-java-log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.13.2</version>
<version>${log4j-slf4j-impl.version}</version>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-core</artifactId>
<version>11.2</version>
<version>${feign-core.version}</version>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-slf4j</artifactId>
<version>11.2</version>
<version>${feign-core.version}</version>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-gson</artifactId>
<version>11.2</version>
<version>${feign-core.version}</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>5.0.1</version>
<version>${guice.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>uk.org.webcompere</groupId>
<artifactId>system-stubs-junit4</artifactId>
<version>1.2.0</version>
<version>${system-stubs-junit4.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.3.0</version>
<version>${mockito-core.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.19.0</version>
<version>${assertj-core.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
@ -103,6 +103,17 @@
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<aws-lambda-java-core.version>1.2.1</aws-lambda-java-core.version>
<aws-lambda-java-events.version>3.6.0</aws-lambda-java-events.version>
<lightweight-config.version>1.1.0</lightweight-config.version>
<aws-lambda-java-log4j2.version>1.2.0</aws-lambda-java-log4j2.version>
<log4j-slf4j-impl.version>2.13.2</log4j-slf4j-impl.version>
<feign-core.version>11.2</feign-core.version>
<guice.version>5.0.1</guice.version>
<system-stubs-junit4.version>1.2.0</system-stubs-junit4.version>
<mockito-core.version>3.3.0</mockito-core.version>
<assertj-core.version>3.19.0</assertj-core.version>
<junit-jupiter.version>5.8.1</junit-jupiter.version>
</properties>
</project>

View File

@ -70,6 +70,7 @@
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<configuration>
<skipITs>true</skipITs>
<includes>
<include>**/*LiveTest.java</include>
</includes>

View File

@ -33,7 +33,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -95,7 +95,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform-surefire-provider.version}</version>
</dependency>
</dependencies>
<executions>
@ -165,7 +165,6 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.platform.version>1.0.0</junit.platform.version>
<hsqldb.version>2.4.0</hsqldb.version>
<spock-core.version>1.1-groovy-2.4</spock-core.version>
<commons-lang3.version>3.9</commons-lang3.version>

View File

@ -34,7 +34,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -94,7 +94,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform-surefire-provider.version}</version>
</dependency>
</dependencies>
<executions>
@ -162,7 +162,6 @@
</repositories>
<properties>
<junit.platform.version>1.0.0</junit.platform.version>
<hsqldb.version>2.4.0</hsqldb.version>
<spock-core.version>1.1-groovy-2.4</spock-core.version>
<groovy-wslite.version>1.1.3</groovy-wslite.version>

View File

@ -39,7 +39,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -80,7 +80,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform-surefire-provider.version}</version>
</dependency>
</dependencies>
<executions>
@ -119,7 +119,6 @@
</repositories>
<properties>
<junit.platform.version>1.0.0</junit.platform.version>
<groovy.version>2.5.6</groovy.version>
<groovy-all.version>2.5.6</groovy-all.version>
<groovy-sql.version>2.5.6</groovy-sql.version>

View File

@ -39,7 +39,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -80,7 +80,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform-surefire-provider.version}</version>
</dependency>
</dependencies>
<executions>
@ -109,7 +109,6 @@
</repositories>
<properties>
<junit.platform.version>1.0.0</junit.platform.version>
<groovy.version>2.5.6</groovy.version>
<groovy-all.version>2.5.6</groovy-all.version>
<groovy-sql.version>2.5.6</groovy-sql.version>

View File

@ -39,7 +39,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -80,7 +80,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform-surefire-provider.version}</version>
</dependency>
</dependencies>
<executions>
@ -109,7 +109,6 @@
</repositories>
<properties>
<junit.platform.version>1.0.0</junit.platform.version>
<groovy.version>2.5.6</groovy.version>
<groovy-all.version>2.5.6</groovy-all.version>
<groovy-sql.version>2.5.6</groovy-sql.version>

View File

@ -35,19 +35,19 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit.jupiter.version}</version>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.jupiter.version}</version>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -106,7 +106,6 @@
<maven.compiler.source.version>11</maven.compiler.source.version>
<maven.compiler.target.version>11</maven.compiler.target.version>
<guava.version>29.0-jre</guava.version>
<junit.jupiter.version>5.7.0</junit.jupiter.version>
<assertj.version>3.17.2</assertj.version>
<mockserver.version>5.11.1</mockserver.version>
<commons-lang3.version>3.12.0</commons-lang3.version>

View File

@ -40,7 +40,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
@ -70,7 +70,6 @@
<properties>
<!-- testing -->
<assertj.version>3.10.0</assertj.version>
<junit.platform.version>1.2.0</junit.platform.version>
<awaitility.version>1.7.0</awaitility.version>
<maven.compiler.source>1.9</maven.compiler.source>
<maven.compiler.target>1.9</maven.compiler.target>

View File

@ -29,7 +29,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -158,7 +158,6 @@
<rxjava.version>3.0.0</rxjava.version>
<!-- testing -->
<assertj.version>3.10.0</assertj.version>
<junit.platform.version>1.2.0</junit.platform.version>
<awaitility.version>4.0.2</awaitility.version>
<maven.compiler.source>1.9</maven.compiler.source>
<maven.compiler.target>1.9</maven.compiler.target>

View File

@ -35,7 +35,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -80,7 +80,6 @@
<properties>
<!-- testing -->
<assertj.version>3.10.0</assertj.version>
<junit.platform.version>1.2.0</junit.platform.version>
<awaitility.version>1.7.0</awaitility.version>
<maven.compiler.source>1.9</maven.compiler.source>
<maven.compiler.target>1.9</maven.compiler.target>

View File

@ -43,7 +43,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
@ -52,7 +52,6 @@
<eclipse.collections.version>7.1.0</eclipse.collections.version>
<commons-collections4.version>4.1</commons-collections4.version>
<assertj.version>3.11.1</assertj.version>
<junit.platform.version>1.2.0</junit.platform.version>
<commons-exec.version>1.3</commons-exec.version>
</properties>

View File

@ -16,9 +16,8 @@
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
@ -96,7 +95,6 @@
</build>
<properties>
<junit.version>4.13</junit.version>
<threadweaver.version>0.2</threadweaver.version>
<tempus-fugit.version>1.1</tempus-fugit.version>
<multithreadedtc.version>1.01</multithreadedtc.version>

View File

@ -18,19 +18,19 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${jupiter.version}</version>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${jupiter.version}</version>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${jupiter.version}</version>
<version>${junit-jupiter.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
@ -76,7 +76,6 @@
<properties>
<spring.version>5.0.9.RELEASE</spring.version>
<h2.version>1.4.199</h2.version>
<jupiter.version>5.5.1</jupiter.version>
<source.version>1.8</source.version>
<target.version>1.8</target.version>
</properties>

View File

@ -16,9 +16,8 @@
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -17,9 +17,8 @@
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -36,9 +36,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -19,7 +19,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit-jupiter-engine.version}</version>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -94,7 +94,6 @@
<guava.version>25.1-jre</guava.version>
<unix4j.version>0.4</unix4j.version>
<grep4j.version>1.8.7</grep4j.version>
<junit-jupiter-engine.version>5.7.2</junit-jupiter-engine.version>
</properties>
</project>

View File

@ -1,5 +1,6 @@
package com.baeldung.example.soundapi;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Assertions;
@ -37,6 +38,7 @@ public class AppUnitTest {
}
@Test
@Disabled
public void Given_TargetLineDataObject_When_Run_Then_GeneratesOutputStream() {
soundRecorder.setFormat(af);
@ -52,6 +54,7 @@ public class AppUnitTest {
}
@Test
@Disabled
public void Given_AudioInputStream_When_NotNull_Then_SaveToWavFile() {
soundRecorder.setFormat(af);
soundRecorder.build(af);

View File

@ -31,11 +31,9 @@
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.assertj</groupId>

View File

@ -21,9 +21,8 @@
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -25,12 +25,6 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>

View File

@ -136,7 +136,6 @@
<properties>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
<junit-jupiter.version>5.6.2</junit-jupiter.version>
</properties>
</project>

View File

@ -81,7 +81,6 @@
<appmodules.version>1.0</appmodules.version>
<junit-jupiter.version>5.6.2</junit-jupiter.version>
<assertj-core.version>3.12.2</assertj-core.version>
</properties>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.baeldung.ethereum</groupId>
<artifactId>ethereum</artifactId>
@ -112,6 +112,13 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<version>${spring.boot.version}</version>
<exclusions>
<!-- junit4 dependency is excluded as it should to be resolved from junit-vintage-engine included in parent-modules. -->
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
@ -138,9 +145,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>

View File

@ -45,9 +45,9 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -38,9 +38,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -70,7 +70,6 @@
<!-- testing -->
<assertj.version>3.6.1</assertj.version>
<java-hamcrest.version>2.0.0.0</java-hamcrest.version>
<junit-jupiter.version>5.6.2</junit-jupiter.version>
</properties>
</project>

View File

@ -40,7 +40,4 @@
</resources>
</build>
<properties>
<junit-jupiter.version>5.6.2</junit-jupiter.version>
</properties>
</project>

View File

@ -43,7 +43,6 @@
<properties>
<!-- testing -->
<assertj.version>3.6.1</assertj.version>
<junit-jupiter.version>5.6.2</junit-jupiter.version>
</properties>
</project>

View File

@ -76,7 +76,6 @@
<!-- testing -->
<assertj.version>3.6.1</assertj.version>
<java-hamcrest.version>2.0.0.0</java-hamcrest.version>
<junit-jupiter.version>5.6.2</junit-jupiter.version>
</properties>
</project>

View File

@ -39,8 +39,4 @@
</resources>
</build>
<properties>
<junit-jupiter.version>5.6.2</junit-jupiter.version>
</properties>
</project>

View File

@ -53,7 +53,6 @@
<properties>
<!-- testing -->
<junit-jupiter.version>5.6.2</junit-jupiter.version>
<assertj.version>3.6.1</assertj.version>
</properties>

View File

@ -50,7 +50,6 @@
<properties>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
<junit-jupiter.version>5.6.2</junit-jupiter.version>
<guava.version>29.0-jre</guava.version>
</properties>

View File

@ -19,7 +19,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -160,7 +160,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform-surefire-provider.version}</version>
</dependency>
</dependencies>
<executions>
@ -191,8 +191,6 @@
<kotlinx.version>0.22.5</kotlinx.version>
<mockito-kotlin.version>1.5.0</mockito-kotlin.version>
<commons-math3.version>3.6.1</commons-math3.version>
<junit.platform.version>1.0.0</junit.platform.version>
<junit.vintage.version>5.2.0</junit.vintage.version>
<assertj.version>3.10.0</assertj.version>
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
<spek.api.version>1.1.5</spek.api.version>

View File

@ -18,12 +18,12 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit.jupiter.version}</version>
<version>${junit-jupiter.version}</version>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-vintage.version}</version>
<version>${junit-jupiter.version}</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
@ -59,9 +59,6 @@
</build>
<properties>
<junit.jupiter.version>5.0.0-M4</junit.jupiter.version>
<junit-vintage.version>4.12.0-M4</junit-vintage.version>
<log4j-core.version>2.8.2</log4j-core.version>
<junit-platform-surefire-provider.version>1.0.0-M4</junit-platform-surefire-provider.version>
</properties>
</project>

View File

@ -49,8 +49,4 @@
</dependency>
</dependencies>
<properties>
<junit-jupiter.version>5.6.2</junit-jupiter.version>
</properties>
</project>

View File

@ -54,7 +54,6 @@
<properties>
<!-- testing -->
<junit-jupiter.version>5.6.2</junit-jupiter.version>
<assertj.version>3.11.0</assertj.version>
</properties>

View File

@ -33,9 +33,9 @@
<version>${modelmapper.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -8,8 +8,8 @@
<version>0.0.1-SNAPSHOT</version>
<parent>
<artifactId>parent-modules</artifactId>
<groupId>com.baeldung</groupId>
<artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
@ -25,9 +25,9 @@
<version>${jsoniter.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -53,6 +53,13 @@
<groupId>org.jbpm</groupId>
<artifactId>jbpm-test</artifactId>
<version>${jbpm.version}</version>
<exclusions>
<!-- junit4 dependency is excluded as it should to be resolved from junit-vintage-engine included in parent-modules. -->
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>info.picocli</groupId>

View File

@ -15,9 +15,9 @@
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -15,11 +15,16 @@
<artifactId>fastutil</artifactId>
<version>${fastutil.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openjdk.jmh/jmh-core -->
@ -43,14 +48,27 @@
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<properties>
<fastutil.version>8.2.2</fastutil.version>
<junit.version>4.12</junit.version>
<eclipse-collections.version>10.0.0</eclipse-collections.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<jmh-core.version>1.28</jmh-core.version>
<jmh-generator.version>1.28</jmh-generator.version>
<junit-jupiter.version>5.8.1</junit-jupiter.version>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
</properties>
</project>

View File

@ -49,8 +49,8 @@
<version>${bouncycastle.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -62,9 +62,9 @@
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<!-- tomcat -->

View File

@ -147,9 +147,9 @@
<version>${jmh-core.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -97,7 +97,6 @@
<log4j2.version>2.7</log4j2.version>
<disruptor.version>3.3.6</disruptor.version>
<jbosslogging.version>3.3.0.Final</jbosslogging.version>
<junit-jupiter.version>5.6.2</junit-jupiter.version>
</properties>
</project>

View File

@ -22,8 +22,4 @@
<module>log-mdc</module>
</modules>
<properties>
<junit-jupiter.version>5.6.2</junit-jupiter.version>
</properties>
</project>

View File

@ -9,20 +9,11 @@
<name>copy-rename-maven-plugin</name>
<parent>
<artifactId>maven-copy-files</artifactId>
<groupId>com.baeldung</groupId>
<artifactId>maven-copy-files</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>

View File

@ -9,20 +9,11 @@
<name>maven-antrun-plugin</name>
<parent>
<artifactId>maven-copy-files</artifactId>
<groupId>com.baeldung</groupId>
<artifactId>maven-copy-files</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>

View File

@ -9,20 +9,11 @@
<name>maven-resources-plugin</name>
<parent>
<artifactId>maven-copy-files</artifactId>
<groupId>com.baeldung</groupId>
<artifactId>maven-copy-files</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->

View File

@ -12,8 +12,8 @@
<url>http://www.example.com</url>
<parent>
<artifactId>maven-modules</artifactId>
<groupId>com.baeldung</groupId>
<artifactId>maven-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
@ -25,9 +25,8 @@
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -15,9 +15,9 @@
<version>${commons.lang3.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
@ -44,7 +44,7 @@
<properties>
<commons.lang3.version>3.9</commons.lang3.version>
<junit.version>4.12</junit.version>
<junit-jupiter.version>5.8.1</junit-jupiter.version>
</properties>
</project>

View File

@ -9,19 +9,13 @@
<packaging>pom</packaging>
<parent>
<artifactId>maven-modules</artifactId>
<groupId>com.baeldung</groupId>
<artifactId>maven-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
@ -32,8 +26,8 @@
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>

View File

@ -27,9 +27,9 @@
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -16,9 +16,10 @@
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
@ -46,7 +47,6 @@
<properties>
<name>${project.name}</name>
<my.awesome.property>property-from-pom</my.awesome.property>
<junit.version>4.13</junit.version>
</properties>
</project>

View File

@ -40,4 +40,25 @@
<module>maven-dependency</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<properties>
<junit-jupiter.version>5.8.1</junit-jupiter.version>
</properties>
</project>

View File

@ -65,9 +65,9 @@
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -35,6 +35,25 @@
<artifactId>ninja-test-utilities</artifactId>
<version>${ninja.version}</version>
<scope>test</scope>
<exclusions>
<!-- junit4 dependency is excluded as it should to be resolved from junit-vintage-engine. -->
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
@ -188,6 +207,7 @@
<enforcer.plugin.version>1.3.1</enforcer.plugin.version>
<deploy.plugin.version>2.8.2</deploy.plugin.version>
<shade.plugin.version>2.2</shade.plugin.version>
<junit-jupiter.version>5.8.1</junit-jupiter.version>
</properties>
</project>

View File

@ -30,9 +30,15 @@
</dependency>
<!-- For tests -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${version.junit}</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -100,7 +106,6 @@
<version.derby>10.14.2.0</version.derby>
<version.liberty-maven-plugin>3.3-M3</version.liberty-maven-plugin>
<version.maven-war-plugin>3.2.3</version.maven-war-plugin>
<version.junit>4.12</version.junit>
<version.yasson>1.0.5</version.yasson>
<version.cxf-rt-rs-client>3.2.6</version.cxf-rt-rs-client>
<version.javax.json>1.0.4</version.javax.json>
@ -110,6 +115,7 @@
<liberty.var.default.http.port>9080</liberty.var.default.http.port>
<liberty.var.default.https.port>9443</liberty.var.default.https.port>
<testServerHttpPort>7070</testServerHttpPort>
<junit-jupiter.version>5.8.1</junit-jupiter.version>
</properties>
</project>

View File

@ -17,6 +17,13 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit-jupiter.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
@ -51,6 +58,11 @@
<!-- this is necessary as we're not using the Boot parent -->
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
@ -85,6 +97,7 @@
<aspectjweaver.version>1.9.1</aspectjweaver.version>
<!-- this property can be removed once we update Mockito version in the main pom.xml -->
<mockito.version>3.4.0</mockito.version>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
</properties>
</project>

View File

@ -19,9 +19,8 @@
<version>${lombok.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
@ -29,7 +28,6 @@
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<junit.version>4.13</junit.version>
<lombok.version>1.18.12</lombok.version>
</properties>

View File

@ -33,6 +33,12 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>

View File

@ -18,6 +18,14 @@
<dependencyManagement>
<dependencies>
<!-- for junit5 to successfully be able to discover junit4 tests, we need 4.12+ version of junit:junit in the classpath. hence forcing the
latest 4.13.2 available version for junit5 compatibility -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- JBoss distributes a complete set of Java EE 7 APIs including a Bill of Materials (BOM).
A BOM specifies the versions of a "stack" (or a collection) of artifacts. We use this here so that we
always get the correct versions of artifacts. Here we use the jboss-javaee-7.0-with-tools stack (you

View File

@ -69,9 +69,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -102,8 +102,6 @@
<!-- testing -->
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
<junit-jupiter.version>5.6.2</junit-jupiter.version>
<junit.version>4.13</junit.version>
</properties>
</project>

View File

@ -1,21 +1,18 @@
package com.baeldung.spring.redis.configuration.controller;
import com.baeldung.spring.redis.configuration.entity.Book;
import com.baeldung.spring.redis.configuration.repository.BooksRepository;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.mockito.Mockito.when;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Spy;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.baeldung.spring.redis.configuration.entity.Book;
import com.baeldung.spring.redis.configuration.repository.BooksRepository;
@RunWith(MockitoJUnitRunner.class)
public class BooksControllerUnitTest {
@ -44,8 +41,6 @@ public class BooksControllerUnitTest {
@Test
public void whenFindOneNotFound_thenReturnsNull() {
Book book = new Book(BOOK_ID, BOOK_NAME);
when(booksRepository.findById(BOOK_ID)).thenReturn(book);
assertNull(booksController.findOne(OTHER_BOOK_ID));
}

View File

@ -1,23 +1,20 @@
package com.baeldung.spring.redis.configuration.repository;
import com.baeldung.spring.redis.configuration.entity.Book;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Spy;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.baeldung.spring.redis.configuration.entity.Book;
@RunWith(MockitoJUnitRunner.class)
public class BooksRepositoryUnitTest {
@ -55,9 +52,7 @@ public class BooksRepositoryUnitTest {
@Test
public void whenFindByIdNotFound_thenReturnsNull() {
Book book = new Book(BOOK_ID, BOOK_NAME);
when(redisTemplate.opsForValue()).thenReturn(valueOperations);
when(valueOperations.get(BOOK_ID)).thenReturn(book);
assertNull(booksRepository.findById(OTHER_BOOK_ID));
verify(redisTemplate, times(1)).opsForValue();
verify(valueOperations, times(1)).get(OTHER_BOOK_ID);

View File

@ -48,6 +48,13 @@
<artifactId>cassandra-unit-shaded</artifactId>
<version>${cassandra-unit-shaded.version}</version>
<scope>test</scope>
<exclusions>
<!-- junit4 dependency is excluded as it should to be resolved from junit-vintage-engine included in parent-modules. -->
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hectorclient</groupId>

22
pom.xml
View File

@ -34,12 +34,6 @@
</dependency>
<!-- test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
@ -58,6 +52,12 @@
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
@ -116,7 +116,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>${junit-platform.version}</version>
<version>${junit-platform-surefire-provider.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
@ -1385,7 +1385,8 @@
<gib.failOnError>false</gib.failOnError>
<gib.disable>true</gib.disable>
<junit.version>4.12</junit.version>
<!-- used only in dependency management to force this version, not included as a direct dependency -->
<junit.version>4.13.2</junit.version>
<hamcrest.version>2.2</hamcrest.version>
<hamcrest-all.version>1.3</hamcrest-all.version>
<mockito.version>3.3.0</mockito.version>
@ -1417,8 +1418,9 @@
<jstl.version>1.2</jstl.version>
<jackson.version>2.13.0</jackson.version>
<commons-fileupload.version>1.4</commons-fileupload.version>
<junit-platform.version>1.2.0</junit-platform.version>
<junit-jupiter.version>5.2.0</junit-jupiter.version>
<junit-platform.version>1.8.1</junit-platform.version>
<junit-jupiter.version>5.8.1</junit-jupiter.version>
<junit-platform-surefire-provider.version>1.3.2</junit-platform-surefire-provider.version>
<directory-maven-plugin.version>0.3.1</directory-maven-plugin.version>
<maven-install-plugin.version>2.5.2</maven-install-plugin.version>
<custom-pmd.version>0.0.1</custom-pmd.version>

View File

@ -67,12 +67,6 @@
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>

View File

@ -16,6 +16,20 @@
<dependencyManagement>
<dependencies>
<!-- for junit5 to successfully be able to discover junit4 tests, we need 4.12+ version of junit:junit in the classpath. hence forcing the
latest 4.13.2 available version for junit5 compatibility -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit-jupiter.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bom</artifactId>
@ -54,7 +68,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.6</version>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
@ -157,7 +171,7 @@
<properties>
<quarkus.version>1.7.0.Final</quarkus.version>
<junit-jupiter.version>5.6.0</junit-jupiter.version>
<lombok.version>1.18.6</lombok.version>
</properties>
</project>

View File

@ -106,11 +106,17 @@
<artifactId>restx-specs-tests</artifactId>
<version>${restx.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -17,6 +17,13 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit-jupiter.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
@ -44,6 +51,20 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
</exclusion>
<exclusion>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.junit.platform</groupId>
<artifactId>junit-plaform-commons</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>

View File

@ -107,7 +107,6 @@
</dependencies>
<properties>
<junit-jupiter.version>5.6.2</junit-jupiter.version>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
</properties>

View File

@ -24,10 +24,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -16,6 +16,25 @@
<relativePath />
</parent>
<dependencyManagement>
<dependencies>
<!-- for junit5 to successfully be able to discover junit4 tests, we need 4.12+ version of junit:junit in the classpath. hence forcing the
latest 4.13.2 available version for junit5 compatibility -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit-jupiter.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
@ -80,6 +99,9 @@
<spring-boot-starter-log4j.version>1.3.8.RELEASE</spring-boot-starter-log4j.version>
<gelfj.version>1.1.16</gelfj.version>
<lombok.version>1.18.4</lombok.version>
<!-- used only in dependency management to force this version, not included as a direct dependency -->
<junit.version>4.13.2</junit.version>
<junit-jupiter.version>5.8.1</junit-jupiter.version>
</properties>
</project>

View File

@ -30,10 +30,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
<properties>

View File

@ -54,14 +54,13 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<spring-cloud-dependencies.version>2.0.3.RELEASE</spring-cloud-dependencies.version>
<junit.platform.version>1.2.0</junit.platform.version>
</properties>
</project>

View File

@ -18,6 +18,20 @@
<dependencyManagement>
<dependencies>
<!-- for junit5 to successfully be able to discover junit4 tests, we need 4.12+ version of junit:junit in the classpath. hence forcing the
latest 4.13.2 available version for junit5 compatibility -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit-jupiter.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-aws</artifactId>

View File

@ -16,6 +16,25 @@
<relativePath />
</parent>
<dependencyManagement>
<dependencies>
<!-- for junit5 to successfully be able to discover junit4 tests, we need 4.12+ version of junit:junit in the classpath. hence forcing the
latest 4.13.2 available version for junit5 compatibility -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit-jupiter.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- Spring Stream Starter Apps -->
<dependency>
@ -38,6 +57,10 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</dependency>
</dependencies>
<build>
@ -52,6 +75,9 @@
<properties>
<spring-cloud-starter-stream.version>2.1.2.RELEASE</spring-cloud-starter-stream.version>
<!-- used only in dependency management to force this version, not included as a direct dependency -->
<junit.version>4.13.2</junit.version>
<junit-jupiter.version>5.8.1</junit-jupiter.version>
</properties>
</project>

View File

@ -32,11 +32,13 @@
<artifactId>javaee-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tomee/tomee-embedded -->
<dependency>
<groupId>org.apache.openejb</groupId>
<groupId>org.apache.tomee</groupId>
<artifactId>tomee-embedded</artifactId>
<version>${tomee-embedded.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
@ -78,6 +80,18 @@
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/joda-time/joda-time -->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${joda-time.version}</version>
</dependency>
</dependencies>
<profiles>
@ -174,18 +188,19 @@
</build>
<properties>
<arquillian-bom.version>1.1.13.Final</arquillian-bom.version>
<tomee-embedded.version>1.7.5</tomee-embedded.version>
<glassfish-embedded-all.version>3.1.2</glassfish-embedded-all.version>
<arquillian-glassfish-embedded-3.1.version>1.0.0.CR4</arquillian-glassfish-embedded-3.1.version>
<arquillian-bom.version>1.6.0.Final</arquillian-bom.version>
<tomee-embedded.version>8.0.8</tomee-embedded.version>
<glassfish-embedded-all.version>6.2.2</glassfish-embedded-all.version>
<arquillian-glassfish-embedded-3.1.version>1.0.2</arquillian-glassfish-embedded-3.1.version>
<wildfly.version>8.2.1.Final</wildfly.version>
<javax.ejb-api.version>3.2</javax.ejb-api.version>
<springframework.version>5.2.3.RELEASE</springframework.version>
<activemq.broker.version>5.10.2</activemq.broker.version>
<activemq.junit.version>5.13.1</activemq.junit.version>
<activemq.broker.version>5.16.3</activemq.broker.version>
<activemq.junit.version>5.16.3</activemq.junit.version>
<mockito.version>2.21.0</mockito.version>
<maven-dependency-plugin.version>2.8</maven-dependency-plugin.version>
<wildfly-ejb.version>8.2.1.Final</wildfly-ejb.version>
<joda-time.version>2.10.12</joda-time.version>
</properties>
</project>

View File

@ -26,6 +26,14 @@
<dependencyManagement>
<dependencies>
<!-- for junit5 to successfully be able to discover junit4 tests, we need 4.12+ version of junit:junit in the classpath. hence forcing the
latest 4.13.2 available version for junit5 compatibility -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.baeldung.spring.ejb</groupId>
<artifactId>spring-ejb-remote</artifactId>

View File

@ -86,11 +86,16 @@
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit-version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
<build>
@ -262,7 +267,7 @@
<jackson-databind-nullable-version>0.2.1</jackson-databind-nullable-version>
<jackson-threetenbp-version>2.9.10</jackson-threetenbp-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.13</junit-version>
<junit-jupiter.version>5.8.1</junit-jupiter.version>
</properties>
</project>

View File

@ -16,6 +16,13 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit-jupiter.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
@ -84,8 +91,8 @@
<properties>
<jstl.version>1.2</jstl.version>
<junit-jupiter.version>5.7.1</junit-jupiter.version>
<spring-boot.version>2.4.4</spring-boot.version>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
</properties>
</project>

View File

@ -121,8 +121,8 @@
</dependency>
<!-- test scoped -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -110,9 +110,8 @@
<!-- test scoped -->
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
@ -284,7 +283,6 @@
<pact.version>3.5.11</pact.version>
<source.version>1.8</source.version>
<target.version>1.8</target.version>
<junit.version>4.12</junit.version>
<maven.version>3.7.0</maven.version>
</properties>

View File

@ -18,6 +18,13 @@
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<version>${truth.version}</version>
<exclusions>
<!-- junit4 dependency is excluded as it should to be resolved from junit-vintage-engine included in parent-modules. -->
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.truth.extensions</groupId>
@ -46,6 +53,13 @@
<artifactId>jgotesting</artifactId>
<version>${jgotesting.version}</version>
<scope>test</scope>
<exclusions>
<!-- junit4 dependency is excluded as it should to be resolved from junit-vintage-engine included in parent-modules. -->
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

View File

@ -30,14 +30,9 @@
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit.vintage.version}</version>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<junit-jupiter.version>5.4.2</junit-jupiter.version>
<junit.vintage.version>5.4.2</junit.vintage.version>
</properties>
</project>

View File

@ -25,13 +25,13 @@
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit.vintage.version}</version>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-migrationsupport</artifactId>
<version>${junit.vintage.version}</version>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -147,9 +147,6 @@
</profiles>
<properties>
<junit.vintage.version>5.4.2</junit.vintage.version>
<junit-platform.version>1.2.0</junit-platform.version>
<junit-jupiter.version>5.4.2</junit-jupiter.version>
<spring.version>5.0.6.RELEASE</spring.version>
</properties>

View File

@ -20,42 +20,42 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-engine</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
<version>${junit-jupiter.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.jupiter.version}</version>
<version>${junit-jupiter.version}</version>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform.version}</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.platform/junit-platform-console-standalone -->
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-console-standalone</artifactId>
<version>1.7.0</version>
<version>${junit-platform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit.vintage.version}</version>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-migrationsupport</artifactId>
<version>${junit.vintage.version}</version>
<version>${junit-jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -137,10 +137,7 @@
</build>
<properties>
<junit.jupiter.version>5.4.2</junit.jupiter.version>
<mockito.junit.jupiter.version>2.23.0</mockito.junit.jupiter.version>
<junit.platform.version>1.4.2</junit.platform.version>
<junit.vintage.version>5.4.2</junit.vintage.version>
<log4j2.version>2.8.2</log4j2.version>
<powermock.version>2.0.0</powermock.version>
<maven-surefire-plugin.version>2.22.0</maven-surefire-plugin.version>

View File

@ -19,22 +19,22 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-engine</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
<version>${junit-jupiter.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit.jupiter.version}</version>
<version>${junit-jupiter.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.jupiter.version}</version>
<version>${junit-jupiter.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
@ -44,7 +44,7 @@
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>${junit.platform.version}</version>
<version>${junit-platform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@ -56,8 +56,6 @@
</dependencies>
<properties>
<junit.jupiter.version>5.7.0</junit.jupiter.version>
<junit.platform.version>1.7.0</junit.platform.version>
<log4j2.version>2.8.2</log4j2.version>
<assertj-core.version>3.11.1</assertj-core.version>
</properties>

Some files were not shown because too many files have changed in this diff Show More