Here Utils.java is my class to be tested and following is the method which is called in UtilsTest class. Even if I am mocking Log.e method as shown below
@B
You can put this into your gradle script:
android { ... testOptions { unitTests.returnDefaultValues = true } }
That will decide whether unmocked methods from android.jar should throw exceptions or return default values.