October 2017
Intermediate to advanced
350 pages
7h 29m
English
Parameterized tests are a special kinds of tests in which the data input is injected in the test in order to reuse the same test logic. This concept was already addressed in JUnit 4, as explained in Chapter 1, Retrospective On Software Quality And Java Testing. As we would expect, parameterized tests are also implemented in JUnit 5.
First of all, in order to implement a parameterized test in Jupiter, we need to add the junit-jupiter-params to our project. When using Maven, that means adding the following dependency:
<dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-params</artifactId> <version>${junit.jupiter.version}</version> <scope>test</scope></dependency>Read now
Unlock full access