Join GitHub today
ClassCastException in javax.crypto caused by powermock #294
From Mark.Lehmacher@gmail.com on August 25, 2010 14:14:22
What steps will reproduce the problem? The following TestNG test will:
public final void testBla() throws Exception
When running the test I get the following exception:
java.lang.ClassCastException: com.sun.crypto.provider.AESCipher cannot be cast to javax.crypto.CipherSpi
When I leave out getObjectFactory() everything works.
As as sidenote, when getObjectFactory() is there and the test class itself is final (in my case MyTest), another exception ensues:
Again, without getObjectFactory() everything works. This issue contains a stripped down version of my real test, so leaving out the object factory is not really an option.
I am using:
The problem arises within Eclipse (using TestNG plugin) as well as from executing tests from command line (vanilla TestNG).
Original issue: http://code.google.com/p/powermock/issues/detail?id=274
From Mark.Lehmacher@gmail.com on August 25, 2010 05:19:34
Oops, I just noticed that the first (and main part of this issue) is a duplicate of
From sjcevika...@gmail.com on August 25, 2014 22:06:07
I am doing Unit testing using Testng,mockito and powermockito