[ 
https://issues.apache.org/jira/browse/SLING-12131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17784016#comment-17784016
 ] 

Julian Sedding edited comment on SLING-12131 at 11/8/23 12:35 PM:
------------------------------------------------------------------

AFAIK the latest maven-surefire-plugin automatically adds the jupiter and 
vintage engines if the jupiter-api and the junit api, respectively, are in the 
dependencies.

I would also like to transition more to junit5/jupiter, and since you can even 
mix and match individual test methods within the same class, I see no reason 
why we shouldn't move forward with it.

I would add the following two dependencies to sling-parent:
- org.junit.jupiter:junit-jupiter-api
- org.junit.jupiter:junit-jupiter-params


bq. Some day down the road, the JUnit 4 dependencies could be removed.  
Projects that have not updated to JUnit5 (vintage or jupiter) by that time are 
likely no longer maintained.

Yes, we could eventually remove JUnit 4 from the parent. But I disagree with 
the rest of the statement. IMHO, it is _very_ unlikely that we find the time 
and resources to migrate all tests to junit5. Also, there is virtually no value 
in doing so, because you can use junit4 and junit5 side-by-side. Therefore, in 
my eyes, concluding whether or not a module is maintained, will be independent 
of whether it uses junit4 or junit5.




was (Author: jsedding):
AFAIK the latest maven-surefire-plugin automatically adds the jupiter and 
vintage engines if the jupiter-api and the junit api, respectively, are in the 
dependencies.

I would also like to transition more to junit5/jupiter, and since you can even 
mix and match individual test methods within the same class, I see no reason 
why we shouldn't move forward with it.

I would add the following two dependencies to sling-parent:
- org.junit.jupiter:junit-jupiter-api
- org.junit.jupiter:junit-jupiter-params

> Update sling-parent pom.xml to include JUnit5 dependencies
> ----------------------------------------------------------
>
>                 Key: SLING-12131
>                 URL: https://issues.apache.org/jira/browse/SLING-12131
>             Project: Sling
>          Issue Type: Task
>            Reporter: Rob McDougall
>            Priority: Major
>
> JUnit4 is in maintenance mode (no updates in the last 2 years and then only 
> security fixes).  I think updating projects to JUnit5 should be encouraged.
> I am thinking this should be a relatively easy change of adding the 
> junit-jupiter and junit-vintage-engine into the Dependency Management section 
> of the sling-parent.
> Once this is done, individual projects could switch to the vintage-engine (at 
> the very least) or move to jupiter by switching the dependency in their 
> project pom.
> Some day down the road, the JUnit 4 dependencies could be removed.  Projects 
> that have not updated to JUnit5 (vintage or jupiter) by that time are likely 
> no longer maintained.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to