Junit 5 = Platform + Jupiter + Vintage 
  1. Platform = Engine + Runner + Launcher
  2. All the Class files needed for Coding Test Cases
  3. Provides Support for Junit3 and 4

Adding Dependency in pom.xml for Junit 5

JUnit 5 Platform
includes junit-jupiter-api + junit-platform-engine

<dependencies>
    [...]
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>5.4.0</version>
        <scope>test</scope>
    </dependency>
    [...]
</dependencies>

If you want to write and execute JUnit 3 or 4 tests via the JUnit Platform add the Vintage Engine to the dependencies

<dependencies>
    [...]
    <dependency>
        <groupId>org.junit.vintage</groupId>
        <artifactId>junit-vintage-engine</artifactId>
        <version>5.4.0</version>
        <scope>test</scope>
    </dependency>
    [...]
</dependencies>

Comments are closed.