Apress / pivotal-certified-pro-spring-dev-exam-02

Source Code for 'Pivotal Certified Professional Core Spring 5 Developer Exam' by Iuliana Cosmina
Other
168 stars 239 forks source link

Update Junit 4 annotations to Junit 5. #6

Closed ideruga closed 4 years ago

ideruga commented 4 years ago

When run alone in IntelliJ, FullConfigTest.java from chapter02 module fails with the following message: "No tests found for given includes". This is due to the fact that this test uses Junit 4 annotations. If changed to the Junit 5 Jupiter annotations, the test works as expected.

To reproduce: open the project in IntelliJ, Ctrl+N to find FullCOnfigTest class, Ctrl+Shift+F10 to run it. Result: The test fails. Expected: The test succeeds.

iuliana commented 4 years ago

Hello Ideruga,

Considering that the class is part of chapter 2, JUnit 5 was not introduced yet. So it's not a problem that JUnit 4 is used. Even the Gradle configuration uses Junit 4. The problem is more related to the fact that IntelliJ IDEA uses JUnit 5 by default and ignores the Gradle configuration. I won't accept this change, but I will rather investigate why JUnit 4 is all of a sudden a "library-non-grata" for IntelliJ IDEA.

Thank you for your contribution. ;)

iuliana commented 4 years ago

Hello Ideruga, After a small investigation I decided that consistency is the best approach, and I using only JUnit 5 in this module is the most wise approach. Your pull request is approved. Thank you for your contribution! Cheers!