记一次单元测试问题com.sun.crypto.provider.HmacSHA1 cannot be cast to javax.crypto.MacSpi

在用单元测试Junit测试部门的SDK时,有个md5鉴权步骤,出现了java.lang.ClassCastException: com.sun.crypto.provider.HmacSHA1 cannot be cast to javax.crypto.MacSpi错误,经排查是Junit编写问题,在@Test下面新增@PowerMockIgnore("javax.crypto.*")即可成功通过测试!

猜你喜欢

转载自www.cnblogs.com/exmyth/p/12535945.html