As @Brabster said, you can't mock static methods. If you still want to use mockito, you'll need to find a way to mock what getContext()
returns. This can be done by modifying the system under test to give it a test mode. When it's in that test mode, you can call a setter to set the return value to a mockito mock. Or you can combine these steps by adding a setTestContext(...)
method to the class.
See how this is annoying to write? That's because the code you're trying to test is bad, not because mockito is missing a feature. Mockito is pointing out a code smell.