Prev Next

Testing / Junit Interview questions III

Junit: How do I test a protected method?

In Java, a protected method can only be accessed within the same package where the class is defined. So, define your Junit test class in the same package as the target class.

More Related questions...

Show more question and Answers...


Comments & Discussions