-
Notifications
You must be signed in to change notification settings - Fork 408
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
Migration from Junit 4 to Junit 5 #1381
Comments
@jvermillard, @JaroslawLegierski, @Warmek if you have any opinions about this, do not hesitate to share ? 🙏 |
Different between Junit4 and 5 are explained here. I started a branch to experiment how this impacts Leshan tests code base. Most painful tasks for us : 1. change in assert methodsImport should be changed, that's OK.
Hopefully our tests code are not so clean and don't use so much failure message 😅 2. Testing exceptions
assertThrowsExactly(IllegalArgumentException.class, () -> {
// code to tests
}); We use it a lot but this no brain and repetitive task. 3. Parameterized Tests
If should be replace by We use it often and this is clearly the less "no brain" task as you need to rewrite a lot about how you pass arguments. |
I will try |
One remaining question about Hamcrest ? Junit4 depends on Hamcrest. So, I added manually the Hamcrest dependency because we are using it a little in
I asking myself if we should keep Hamcrest and maybe trying to use it more? |
PR #1391 is integrated in About Hamcrest question, let's talk about at #1390 (comment). |
I was working on rewriting some tests to be able to test more easily the new transport abstraction layer (#1025).
I was reading some stuff on Junit 4 and I asked my self what is news in Junit 5 ?
After reading the documentation, It seems that a lot changes ...
So before to involve time in test refactoring based on Junit4, we should maybe migrate to Junit5 first ? 🤔
Here some article which gives some reason to migrate to Junit 5 :
The text was updated successfully, but these errors were encountered: