Tuesday, 13 August 2013

Need to use dependency injection in unit tests - should I use junit or testng?

Need to use dependency injection in unit tests - should I use junit or
testng?

We are looking at how to use dependency injection into unit tests (using
JSR-330 syntax but without explicitly specifying the engine in the basic
tests if that matters), and we have used junit 4 so far and been very
pleased with it, but it appears that it is not designed for dependency
injection in the tests.
Question is, whether junit is well suited for tests to be run in a
dependency injection context, or if I should just switch to TestNG?
I would appreciate if opinions were backed up with fact, thanks.

No comments:

Post a Comment