@Nested Tests

This lesson demonstrates how to use @Nested annotation to configure the test hierarchy.

We'll cover the following

@Nested Tests

@Nested annotation provides tests creator more functionality to show the relationship among several groups of tests.

This relationship is achieved by providing nested classes to the main test class. But, by default nested classes don’t participate in test execution. In order to provide testing capabilities to nested classes @Nested annotation is used.

Let’s take a look at a demo.

Get hands-on with 1200+ tech skills courses.