You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Erica Kane (Jira)" <ji...@apache.org> on 2023/03/13 12:48:00 UTC

[jira] [Commented] (WW-5177) Support testing with JUnit 5

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

Erica Kane commented on WW-5177:
--------------------------------

As someone with a similar issue, I can get classes that extend `StrutsSpringJUnit4TestCase` to work on JUnit 5 by calling the JUnit 4 `Before` method on it within the JUnit 5 `BeforeEach` method. It's certainly not ideal.

> Support testing with JUnit 5
> ----------------------------
>
>                 Key: WW-5177
>                 URL: https://issues.apache.org/jira/browse/WW-5177
>             Project: Struts 2
>          Issue Type: New Feature
>          Components: Plugin - JUnit
>            Reporter: Ganapati
>            Priority: Major
>              Labels: features
>             Fix For: 7.0.0
>
>
> Hi Team,
>  
> Currently, struts2-junit-plugin supports testing of Spring based struts actions with on JUnit 4 and 3 using {{StrutsSpringTestCase}} and {{StrutsSpringJUnit4TestCase}}. The request is to add support for JUnit 5 with something similar to {{StrutsSpringJUnit5TestCase}}. I understand that we can run JUnit 4 tests using {{junit-vintage-engine}} but in our case we need to combine with other JUnit 5 based extensions - some custom and some already available - Spring, Testcontainers, etc.
>  
> There is no issue in the current issues list to support this. Can I know if there is any plan to support the same? I am happy to make contribution if some one can guide me.
> -----------------------------------
> For POC purposes, I created parallels to {{XWorkJUnit4TestCase}}, {{StrutsJUnit4TestCase}}, and {{StrutsSpringJUnit4TestCase}} with much of the code remaining same. I was able to run tests using Spring's {{ExtendWith}} with a workaround and the workaround needs to be fixed properly.
>  
> Thanks.



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