Why were JUnit Jupiter and JUnit Vintage separated When I Running TestCase in IntelliJ?
JUnit 5 is more than just a new API (called JUnit Jupiter). It also contains an abstraction layer for tools to run JUnit tests (called JUnit Platform). The platform has no knowledge of either JUnit 4 or Jupiter or anything else really. All it knows are test engines, which will execute the tests they were written for.
(You can read more about this in the user guide or a post I wrote about JUnit 5's architecture.)
- Why were JUnit Jupiter and JUnit Vintage seperated When I Running TestCase in IntelliJ?
What you see is the launcher executing two engines, the one for the new API (Jupiter) and the one for JUnit 4 (Vintage). Each engine represents the tests it ran in its own data structure, which IntelliJ shows as the trees you see.
- Can i Merge JUnit 4 and 5 TestResults?
This would have to be an IDE feature, that - as far as I know - is not implemented.
In case, if you use an annotation @RunWith(SpringRunner.class)
atop of the class, you can remove it and this will work well. This is what I have before the annotation - it shows that the Junit Vintage failed.
This is after I removed the annotation: