When mocking static classes with Junit4, Mockito and PowerMock, you may see the following log messages after annotating your test class if the code that you are testing is making HTTP connections:
message=class configured for SSLContext: sun.security.ssl.SSLContextImpl$TLSContext not a SSLContext
Your annotations for the class (or method) typically include the following:
@RunWith(PowerMockRunner.class)
@PrepareForTest({ SomeClassYouWantToMock.class })
This may cause some confusion, especially if whatever other code that you may have ONLY uses HTTP. Add the following to your annotations to tell → Continue reading “message=class configured for SSLContext: sun.security.ssl.SSLContextImpl$TLSContext not a SSLContext When Mocking Static Methods in Class”