Call a private method from the test class is impossible
"jUnit" is convenient to test the Java program.
However, the test classes can NOT call any Private,Protected or package-private methods,
because they (test class and orignal implemented class) are the different class.
The test code for test private method
See the sample code below.
Check my custome "code-prettify"!
With in this article, I use the library "code-prettify" to show Java source code.
Please check an article "code-prettifyをリファクタリングした(I refactored code-prettify)"
that I'm introducing the refactored version. Feel free to use the refactored version!
Thank you for reading all this article. I hope that your trouble with Java programming be solved with this article.
I've got an idea when I was checking the Google Search Console to know how the people finding my articles,
"Isn't there any demand about this jUnit solution with in English-speaking programmers?".
So I tried to translate and a bit rewrite to English from original Japanese version.
Please let's me know with following comment form, is this article helpful for you?
This blog site is joined in .
Follow from next button: