Migration guides
Andreas Schmid edited this page Jan 8, 2019
·
5 revisions
Pages 10
-
- Migration from v1 to v2
- Migration from v1 to v2 staying with JUnit4
- Migration from v1 to v2 and from JUnit4 to JUnit Jupiter
- Migration from v1 to v2 and from JUnit4 to JUnit Jupiter Parameterized Tests
- Migration to JUnit5
- Migration to JUnit Jupiter
- Migration to JUnit Jupiter Parameterized Tests
- JUnit5 Dataprovider Extension (external library)
Table of contents
- Home
- Motivation, Distinction and FAQs
- Getting started
- Version compatibility
- Migration guides
-
Features
- Array syntax
- String syntax
- Iterable syntax
- Custom dataprovider method resolvers
- Change
@DataProviderlocation - Varargs support
@BeforeClasssupport (JUnit4 only)- Customize test method name
- Access
FrameworkMethodin@DP - Utility methods
- Convention over configuration
- Kotlin support
- OSGi compatible
MANIFEST.MF
- Tips and Tricks
- Release Notes
- Eclipse Template
Clone this wiki locally
Migration from v1 to v2
Migration from v1 to v2 staying with JUnit4
- Replace test dependency
com.tngtech.java:junit-dataproviderwithcom.tngtech.junit.dataprovider:junit4-dataprovider - API is kept same but largely forwards calls to new core API
Migration from v1 to v2 and from JUnit4 to JUnit Jupiter
Migration from v1 to v2 and from JUnit4 to JUnit Jupiter Parameterized Tests
Migration to JUnit5
There are three different approaches for using JUnit dataprovider with JUnit5:
Migration to JUnit Jupiter
- Requires JUnit dataprovider v2.0
- Based on JUnit Jupiters
@TestTemplate - Full JUnit4 dataprovider replacement containing all features based on JUnit Jupiters engine
- Moderate migration path
- Supporting meta-annotations very well to provide custom, composed annotations
- For more details, see below)
- See detailed migration information
Migration to JUnit Jupiter Parameterized Tests
- Requires JUnit dataprovider v2.0
- Based on JUnit Jupiters
@ParameterizedTest - JUnit4 dataprovider replacement based on JUnit Jupiter Parameterized Tests (= JUnit Jupiters "dataprovider" approach)
- Moderate migration effort
- JUnit Jupiter Parameterized Tests already contains the basic features of JUnit dataprovider natively (even if they are implemented differently)
- For more details, see below)
- See detailed migration information
JUnit5 Dataprovider Extension (external library)
Another possibility to use JUnit5 is using the external library JUnit5 Dataprovider Extension. It is a lightweight approach with minimalistic migration effort introduced by aburmeis, see junit5-dataprovider-extension. But it still requires JUnit4 on the classpath.

