What are your thought on a possible migration from JUnit4 to JUnit5?

Hey everyone,

So, as the title implies, i opened this thread because i would like hear your thoughts on a merge request that would migrate all tests from JUnit4 to JUnit5. As you may know (or not), the JUnit5 provides several advantages over its predecessor (information taken from this link):

  • we get more granularity, and can import only what's necessary.
  • JUnit 5 allows multiple runners to work simultaneously.
  • JUnit 5 makes good use of the Java 8 features.

I have managed to pass all the tests so i would say that we’re only a MR away from actually doing it.

How do you feel about this possible migration ?

Regards,
Vincent

Could be useful, I’ve used both and they seem largely equivalent to me, but probably good to keep the tooling up to date.

This sounds dangerous to me since the tests manipulate static variables in the main code.

1 Like

Hi Evan,

My bad on this one, i was copy-pasting what was said in the given link :sweat_smile:.

Indeed, the most important argument is that tests will be up to date. In addition, we’ll be able to make even better tests in terms of readability. I’m going to submit the merge request soon so that everyone can see the changes.

Best,
Vincent

1 Like

I think it’s a good idea to update the Junit version too.

Should it be done for a minor or major release ?

Technically there’s no API change it is just an upgrade of a dependency but I don’t know if it cannot cause problems for users that are using JUnit4 on their own application. I’m not sure…

The scope of the dependency is limited to tests, so once compiled, the library
is independent of JUnit.