I have a class which I would like to test with a public method that calls private one. I’d like to assume that private method works correctly. For example, I’d like something like doReturn....when.... I found that there is possible solution using PowerMock, but this solution doesn’t work for me.
How It can be done? Did anybody have this problem?
I have a class which I would like to test with a public method
Share
I don’t see a problem here. With the following code using the Mockito API, I managed to do just that :
And here’s the JUnit test :