-
Notifications
You must be signed in to change notification settings - Fork 164
Migration guides
Andreas Schmid edited this page Nov 11, 2017
·
5 revisions
- Replace test dependency
com.tngtech.java:junit-dataprovider
withcom.tngtech.junit.dataprovider:junit4-dataprovider
- API is kept same but largely forwards calls to new core API
There are three different approaches for using JUnit dataprovider with JUnit5:
- 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
- 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
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.
- Home
- Motivation, Distinction and FAQs
- Getting started
- Version compatibility
- Migration guides
-
Features
- Array syntax
- String syntax
- Iterable syntax
- Custom dataprovider method resolvers
- Change
@DataProvider
location - Varargs support
@BeforeClass
support (JUnit4 only)- Customize test method name
- Access
FrameworkMethod
in@DP
- Utility methods
- Convention over configuration
- Kotlin support
- OSGi compatible
MANIFEST.MF
- Tips and Tricks
- Release Notes
- Eclipse Template