0

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.

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

So this is perfect for me but turns out if I include this I have to enable mulitdexing which sounds like a waste. Is there any other way to do this? Thanks either way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.