can somebody help me in creating a mocking object for sql
connection...
Caused by: java.lang.NullPointerException
at com.nielsen.outbound.common.Utils.loadFile(Utils.java:116)
at com.nielsen.outbound.common.Utils.<clinit>(Utils.java:77)
--
You received this message because you are subscribed to the Google Groups "mockito" group.
To post to this group, send email to moc...@googlegroups.com.
To unsubscribe from this group, send email to mockito+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mockito?hl=en.
if you want to test a DAO, test it with a real Database and do not mock
the database behaviour. Notice, that this is not a Unit test anymore (it
is not tested in isolation!), this is an integration test.
If you are using a non-local Database (like mysql, postgres, oracle
etc), then you could consider using an in-memory database (like hsql or h2).
I hope this information does help you :)
Dominik
But consider refactoring the code, because using Powermock is a
indicator for strong code smell ;)
Dominik