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.
2 Answers
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.

- 421
- 4
- 17
I got a similar issue but with different details with the powermock dependency,
"java.lang.SecurityException: class ""'s signer information does not match signer information of other classes in the same package"
when i searched, almost people said the same things like this link
It means that you have two or more classes in the same package with different signature data. Usually that means the classes come from different JARs, one of which is signed and the other is unsigned.
I tried to change the dependency version but it doesn't work. but when I downgrade the maven version from 3.6.3v to use 3.0.5v. Everything is working fine.

- 338
- 1
- 8