O'Reilly logo

Mastering Software Testing with JUnit 5 by Boni García

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Jupiter tests in JUnit 4

JUnit 5 has been designed to be forward and backward compatible. On the one hand, the Vintage component supports running legacy code on JUnit 3 and 4. On the other hand, JUnit 5 provides a JUnit 4 runner that allows to run JUnit 5 in IDEs and build systems that support JUnit 4, but does not yet support the new JUnit Platform 5 directly.

Let's see one example. Imagine we want to run a Jupiter test in an IDE does not support JUnit 5, for example, an old version of Eclipse. In this case, we need to annotate our Jupiter test with @RunWith(JUnitPlatform.class). The JUnitPlatform runner is a JUnit 4-based runner, which enables to run any test whose programming model is supported on the JUnit Platform in a JUnit 4 environment. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required