Monday, July 16, 2018

PowerMockito: java.lang.AssertionError: Illegal subclass: class com.sun.net.ssl.internal.ssl.Provider

Problem

Following exception is encountered while running a JUnit test written using PowerMockito.
java.lang.AssertionError: Illegal subclass: class com.sun.net.ssl.internal.ssl.Provider

at sun.security.ssl.SunJSSE.subclassCheck(SunJSSE.java:235)
at sun.security.ssl.SunJSSE.(SunJSSE.java:108)
at com.sun.net.ssl.internal.ssl.Provider.(Provider.java:41)
.................
.................

Solution

This can be fixed by adding following annotation to the test class.

@PowerMockIgnore({"com.sun.net.ssl.internal.ssl.Provider"})








No comments:

Post a Comment