[
https://issues.apache.org/jira/browse/NETBEANS-5428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17297635#comment-17297635
]
Qingtian Wang commented on NETBEANS-5428:
-----------------------------------------
It appears manually adding maven surefire plugin inside the build element of
the POM helps. If that is what's causing the issue, NetBeans should add the
surefile build plugin in the POM, automatically.
> JUnit annotations not working in Maven projects
> -----------------------------------------------
>
> Key: NETBEANS-5428
> URL: https://issues.apache.org/jira/browse/NETBEANS-5428
> Project: NetBeans
> Issue Type: Bug
> Components: java - JUnit
> Affects Versions: 12.2
> Environment: Windows 10 64-bit
> JDK 15
> NetBeans 12.2
> Reporter: Qingtian Wang
> Priority: Major
> Attachments: Screenshot 2021-03-08 114834.png
>
>
> For example, the @BeforeEach and @AfterEach mothed are not run. Steps to
> reproduce:
> # Add new Java Maven project by clicking on the + button on the upper left
> screen
> # Create a new Java class, and write some public method to test.
> # Create corresponding JUnit test class by clicking key short ctrl-alt-t.
> Keep all defaults for the test class generation.
> # Uncomment the @Test method generated.
> # Add some debug sout message in the @BeforeEach method generated.
> # Run the test case.
> Expected result: The debug message in @BeforeEach method should print.
> Real result: No debug message printed, indicating the @BeforeEach annotation
> is not recognized, and the setup method not run.
>
> The problem is not limited to @BeforeEach only. Other JUnit 5 annotations
> have similar problem.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists