Question: what are the main advantages for using spring when writing unit tests?
Answer: Unit Testing. The major advantage of applying dependency injection is that it makes a program code much easier to be tested because the code is much less dependent on the container, as may be the case with other development. The POJOs are individually testable by simple instantiation without adhering to any dependency.