Skip to content

Migration guides

Andreas Schmid edited this page Jan 8, 2019 · 5 revisions

Migration from v1 to v2

Migration from v1 to v2 staying with JUnit4

  • Replace test dependency com.tngtech.java:junit-dataprovider with com.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

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.