PowerMock PrepareForTest annotation causing problems with AmazonSQSClient constructor PowerMock PrepareForTest annotation causing problems with AmazonSQSClient constructor jenkins jenkins

PowerMock PrepareForTest annotation causing problems with AmazonSQSClient constructor


Try to add @PowerMockIgnore("org.apache.http.conn.ssl.*") annotation to your class


As @Natalie already mentioned, you can work with the @PowerMockIgnore() annotation. Maybe you need to ignore the packages javax.net.ssl.* and / or javax.crypto.*:

@PowerMockIgnore({"org.apache.http.conn.ssl.*", "javax.net.ssl.*" , "javax.crypto.*"})

You can get here some background information:

https://groups.google.com/forum/#!topic/powermock/v4nreP2AnOQ

This is most likely because SSLContext is loaded by the bootstrap classloader and PowerMock cannot byte-code manipulate these classes. You have to use this approach to mock that method. /Johan Haleby