O'Reilly logo

Mastering Software Testing with JUnit 5 by Boni García

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Jupiter tests with Maven

In order to run Jupiter tests within a Maven project, we need to configure the pom.xml file properly. First of all, we need to include the junit-jupiter-api module as a dependency. This is needed to write our test, and typically with test scope:

<dependencies>   <dependency>      <groupId>org.junit.jupiter</groupId>      <artifactId>junit-jupiter-api</artifactId>      <version>${junit.jupiter.version}</version>      <scope>test</scope>   </dependency></dependencies>
In general, it is recommended to use the latest version of the dependencies. In order to check what it that version, we can check it on Maven Central (http://search.maven.org/)

Then, the maven-surefire-plugin has to be declared. Internally, this plugin needs two dependencies: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required