Why the numerous examples using Spring? If you want to use DI, why not standard Java EE? IMHO it is never good to make one framework rely on another - and I guess you are aware of the fact people follow examples given in books.
This was chosen after discussion within the Cucumber team, because:
- Java EE has a bad reputation for being complex
- Spring has a lot of mindshare
Granted - Spring has gotten worse and worse every year & Java EE has gotten slightly better.
We were considering Java EE, but decided on Spring because we still think it has a larger community.
I understand (that does not mean I agree). But if I should choose Cucumber to test my Java code, why do you want me to also use another framework?
(So please, please, please offer some examples - real examples without Spring!!!)
It’s not until we get to the DI chapter (Chapter 11) that we introduce Spring - along with other DI containers that Cucumber supports.
We continue to use Spring in Chapter 12, but armed with the information from Chapter 11 it should be relatively painless to use one of the other DI containers described.