Skip to content

Open Rewrite Recipes to migrate your Test NG unit tests to JUnit Jupiter

License

Notifications You must be signed in to change notification settings

MBoegers/migrate-testngtojupiter-rewrite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Migrate Test NG to JUnit Jupiter

This project assembles Open Rewrite Recipes to migrate unit tests suites from TestNG to JUnit Jupiter.

Note

For the authors it is very important to state: Using TestNG is perfectly fine! If you decide to migrate for what ever reasons, these recipes are your way to go.

Getting Help

You can get help to writing Open Rewrite Recipes you can join the Open Rewrite Slack .

To get help regarding TestNG or JUnit Jupiter see the project pages.

If you have problems regarding the recipes within this artifact feel free to contact me in the testing channel at the jvm-german Slack or directly via @[email protected] on Mastodon.

Development

For further information see the Open Rewrite docs section Authoring Recipes.

Building from Source

Open Rewrite recipe artifacts are usually build with gradle or maven. This repository uses maven, the build is 100% taken from the moderneinc/rewrite-recipe-starter and depends on Java 17.

Main Ideas

The Recipes in this artifact follow a few main ideas, to kickstart other developer they are shortly describe here.

Annotation Migration

The TestNG annotation @org.testng.annotations.Test is responsible to configure the test. Within JUnit Jupiter all configurations are made thought dedicated annotations. This implies that all configuration have to be migrated before the Test annotations can be exchanged. To respect this the MigrateTestAnnotation recipe only migrates Test annotations without any parametes and the recipes that migrate the configurations ( f.e. MigrateEnabledArgument) have to remove the configuration after migration

Semantic Assumptions

The semantics of TestNG and JUnit Jupiter does not alight 100% straight forward. There is a list maintained by the JUnit Team addressing the migration from TestNG to JUnit Jupiter . In any case these summary should be consulted first.

Contributing

If you find bugs or missing migrations feel free to file an issue or submit a pull request.

About

Open Rewrite Recipes to migrate your Test NG unit tests to JUnit Jupiter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages