What's the purpose of the JUnit 5 @Nested annotation
问题 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. 回答1: 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). 回答2: All my tests need a database server running. Most of my tests also need a Users table in the database, to be