DEV Community

Discussion on: How to test Java Classes using JUnit5 and Reflection API

Collapse
 
nutterzuk profile image
Stephen Nutbrown

This sounds like a bad idea. Your tests should be checking that your unit of code meets it's external facing contracts; it should not need to assess the internal private methods and fields.

Collapse
 
harittweets profile image
Harit Himanshu

That depends on the use case. This is so that a learner can make progress on a certain set of tasks and verify their progress. The audience is developers learning java and creating their first project