Naveen Dissanayake
Naveen Dissanayake

Reputation: 672

How to run unit tests with test specific class

I have a class that I need to replace with a dummy class when I'm running tests. Is there a way to achieve this? I know product flavors offer something like this so I imagine this should be possible too.

Upvotes: 0

Views: 47

Answers (1)

joseca
joseca

Reputation: 306

You can use PowerMock. It allows you to mock static methods and contructors to return mocked objects (and more).

Upvotes: 1

Related Questions