In JUnit 5, there is a new annotation: @Nested
.
I understand how it work, I understand why we use nested class, I just don't understand why we need to have nested test class in our test.
The @Nested
annotation allows you to have an inner class that's essentially a test class, allowing you to group several test classes under the same parent (with the same initialization).