Search code examples
javapowermockpowermockito

java.lang.SecurityException: signer information does not match signer information of other classes in the same package in PowerMock


When using PowerMockito.mockStatic(Test.class), where Test.class is part of the jar which is signed, I am getting SecurityException. This happens at java.lang.ClassLoader.checkCerts(ClassLoader.java:898) Is there anyway to avoid cert check in tests. I am using powermock-mockito 1.6.4 version. Not able to figure out how to resolve this issue. Any help here.


Solution

  • Powermock lib version 1.6.4 has a bug where it fails when mocking a class which is part of signed jar. Upgrading the powermock lib to 1.6.6 solved this issue.