4 ms·
If you're firm on constructor injection, you can typically test the object in complete isolation without necessarily using mocks, without Spring having to be in
by jacques_chester 10y ago
If you're firm on constructor injection, you can typically test the object in complete isolation without necessarily using mocks, without Spring having to be involved.
Or you can use mocks and Spring Boot's test annotations.
But with field/setter injection, that choice isn't as easy.