Junit 5 basics Maven configuration

pom.xml

   <!-- Changing java version    -->
      <maven.compiler.source>11</maven.compiler.source>
      <maven.compiler.target>${maven.compiler.source}</maven.compiler.target>    
      <junit-jupiter.version>5.6.2</junit-jupiter.version>
    </properties>

  <!-- Adding dependency -->
  <dependencies>
      <!-- junit 5     -->
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>${junit-jupiter.version}</version>
        <scope>test</scope>
    </dependency>        
  </dependencies>

Basics Things needed for junit-5

  • junit-jupiter-engine
  • junit-jupiter-api
  • junit-platform-engine

junit.PNG