Private class unit tests
问题 How to unit test private (means with package visibility) classed in java? I have a package, only one class is public in this package, other classes are private. How to cover other classed with unit tests? I would like to include unit tests in resting jar. 回答1: Create the unit test class in the same package. For example, If com.example.MyPrivateClass located in src/main/java/com/example/MyPrivateClass.java Then the test class will be in same package com.example.MyPrivateClassTestCase and will