I am using powermock 1.2.5 to perform a class that saves data into Oracle database. When I run my test my unit test fails with the following exception:
NoSuchAlgorithmException : DES Algorithm can be found.
After debugging the code I found out that this exception is thrown when my application is trying to set the password to establish a database connection.
Some of my observations are:
- If I run my unit test without power mock , then the exception does not occur.
- I manage to run the unit test if I manually include the sun-jce.jar file into the unit test bootstrap in eclipse.sun-jce.jar is one of the jar file within jre library folder. I am using SUN java jre version 1.5.0_10
So I am guessing that somehow power mock unloads this particular jar file during unit test runtime. Does any one encounter similiar problem when using powermock ?
A work around that I am thinking at the moment is to load the jar file programmatically under the setup() of my unit test.