-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrating to Junit 5 #847
Comments
@anudeepikamunnangi Thanks for opening the issue. Is there some compelling reason to upgrade to Junit 5 at this time? |
@stleary, Thanks for reviewing the PR and the issue. Before i go with advantages, i would like to confirm that, i did not change any test case logic. All i did is to make it work in JUNIT 5 way of writing the same test cases. Recently, in our automation team, we migrated our legacy applications from JUNIT 4 to JUNIT 5. We observed that there are below advantages. JUnit 5 AdvantagesLet’s start with the previous version, JUnit 4 , which has some clear limitations:
References |
Thanks for the response. No objection to using Junit 5, but small steps are preferred over mass changes. Recommend just upgrading the version for now, but keeping the existing tests. I think Junit 5 has a library to support that. |
I'm happy if JUnit 5 is adopted I really like the new version. Keep in mind that JUnit 5 has a few differences from JUnit 4, which means lots of syntax changes on the test package.
ExampleJUnit 4
JUnit 5
|
@rikkarth "Thanks for highlighting the differences. I've ensured code adheres to JUnit5 standards, including the changes you mentioned." |
In relation to the closed PR #848 I want to clarify that it is not possible to upgrade to JUnit 5 without lots of syntax changes, therefor this will inevitably be a big effort. Parameterized dependency and test are not mandatory if you want to keep the upgrade and PR smaller and easier to review in a first stage. Alternatively we can use JUnit vintage (provided by JUnit team) which is an engine which provides backwards compatibility with Junit 3 and 4, JUnit vintage is used specially for cases like this, migrations. This would mean, that if we perform the upgrade like I'm suggesting we are able to produce small, focused PRs that are easier to digest, review and test without breaking anything and maintaining existing functionality. I've used it professionally in the past to upgrade JUnit from 4 to 5. I recommend a new branch from master and a new PR. https://junit.org/junit5/docs/current/user-guide/#migrating-from-junit4 (official) cc @stleary |
I tried to upgraded the code base to Junit 5 to get new features for unit testing. Below are the steps, I followed :
Steps:
The text was updated successfully, but these errors were encountered: