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

Meta-annotations

The final part of this section is about the definition of meta-annotations. The JUnit Jupiter annotations can be used in the definition of other annotations (that is, can be used as meta-annotations). That means that we can define our own composed annotation that will automatically inherit the semantics of its meta-annotations. This feature is very convenient to create our custom test taxonomy by reusing the JUnit 5 annotation @Tag.

Let's see an example. Consider the following classification for test cases, in which we classify all tests as functional and non-functional, and then we make another level under the non-functional tests:

Example taxonomy for tests (functional and non-functional)

With that scheme in mind, we are ...

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