IMHO. It is best to make private and final fields where possible. However, for unit tests, it can be a pragmatic choice to make them private or accessible through them through reflection. (Which is the same thing)
You can also use the black box approach, which means that if you cannot determine what happened using the public method, you should not test it. (Or your tests should be more far-fetched)
Peter Lawrey
source share