Hi devs,

I’ve recently worked on converting our JUnit4 @Rule rules into JUnit5 
equivalent.

There are now equivalent for: 
- MockitoComponentManagerRule, 
- ComponentManagerRule
- AllLogRule
- MockitoOldcoreRule

See http://dev.xwiki.org/xwiki/bin/view/Community/Testing#HJavaUnitTesting for 
examples of how to use them.

Feel free to ask here if you have questions or if you have ideas on how to 
better integrate with JUnit5 (I’m sure we’ll need to perform some tuning and 
there are use cases that I have forgotten that we’ll need to support).

I’m thus proposing that from now on, we start writing new tests as JUnit5 tests 
and that we start converting old JUnit3/4 tests into JUnit5 ones. For example 
if we need to add a method to a JUnit4 test, we convert it to JUnit5 and then 
add the new test method. It’s pretty simple to do the conversion.

WDYT?

Thanks
-Vincent


Reply via email to