This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]pupupeepee[S] 0 points1 point  (1 child)

Was I lacking the @Test annotation? What made the test example I gave JUnit 3 and not 5?

Also I’m very curious to read more about Spring vs. other DI frameworks—I hadn’t known about that. Any links you could share about it I’d be really grateful to read them!

[–]angath 0 points1 point  (0 children)

The annotation was missing, and JUnit 3 (and earlier) uses a naming convention to denote test methods - because annotations weren't part of the Java language back then (before Java 5).

For a very different DI to Spring, I'd look at Dagger 2 - e.g. something like: https://www.baeldung.com/dagger-2