How to pass constructor arguments using Mockito

I want to make fun of a class using a Mockito structure that contains a couple of constructor arguments.

How can I pass these constructor arguments without creating setters for private member variables?

thank

+5
source share
1 answer

You said you want to mock some, but not all methods. I'm not sure why you want to do this - if your class is a co-author, then it would be wise to ridicule the whole class. Or, if it's a SUT, you probably don't want to mock it at all.

, , . , , , , .

, , , , , .

+4

All Articles