I was learning about TDD, I have few questions about it.
Should I test private method in Springmvc Service? In other related questions, there are two main point about testing private method, one is negative because it may break the packaging; one is postive that some private method maybe really important. My question is, private method in Spring service sometimes are independent parts that make up a complete function, they have their own function, in my opinion, these private methods in spring Service are different from those in normal Object Classes, and I tend to test them。
Should I use protected or package-protected level for private methods in Spring Service? When I use Mockito, the document says
It is very easy to work around - just change the visibility of method from private to package-protected (or protected). I can't understand it because it is really rare to see protected/package-protected mthods in service.