Mocking method calls using power mockito - org.powermock.api.mockito.ClassNotPreparedException
I have an image loader class and i need to test some static methods in it. Since Mockito does not support static methods i switched to Power Mockito. But the static method i am testing has a method call Base64.encodeToString(byteArray, Base64.DEFAULT); To mock this i am using mockStatic method as below with @PrepareForTest annotation. PowerMockito.mockStatic(Base64.class); But Android studio is returning me still returning me an error as below. org.powermock.api.mockito.ClassNotPreparedException: The class android.util.Base64 not prepared for test. To prepare this class, add class to the '