EvoSuite / evosuite

EvoSuite - automated generation of JUnit test suites for Java classes
http://www.evosuite.org
GNU Lesser General Public License v3.0
823 stars 341 forks source link

Dependency injection problem in tests for Spring application #475

Open Gabriel-Darbord opened 4 months ago

Gabriel-Darbord commented 4 months ago

Context

Generating tests for a Spring application that uses @Autowired beans.

Current Result

Tests were generated successfully, but dependencies were not injected, resulting in useless tests (always expecting a NullPointerException).

Expected result

EvoSuite should be able to handle dependency injection as explained in this paper.

Additional info

I've read from the v1.1.0 release that JEE support has been removed. It is unclear to me if this is still the case since v1.2.0. I tried using v1.0.6 without success, but that is a different issue.

Can the latest release of EvoSuite generate tests handling dependency injection?