News for hackers. Stuff that matters.
Re:Spring vs. Java EE by EdwardDiego on Sunday April 09, 2017 @08:04PM (#14075033)
> If you get in the habit of using the Spring test support, where classes under test get injected, then all kinds of injection are equally friendly, and the tests don't give you feedback on the weight of the dependencies because Spring does the heavy lifting.

How do you handle the Spring context start-up time? In Spring projects I've worked on, across hundreds of unit tests it's non-trivial. But I don't make any claim to know if we were doing Spring right or not.

Re:Spring vs. Java EE by twic on Monday April 10, 2017 @04:53PM (#14082446)
The context can be reused between tests. If you're not storing data in beans (which you normally shouldn't), this works well. There is a bit of subtlety in that the framework might have to create multiple context for different configurations, but each of them is reusable.

Running a single test is a bit of pain, but running the whole suite is not a lot slower than if it didn't use Spring.

Re:Spring vs. Java EE by jacques_chester on Sunday April 09, 2017 @08:52PM (#14075221)
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.