O'Reilly logo

The Cucumber for Java Book by Seb Rose, Matt Wynne, Aslak Hellesoy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

What We Just Learned

Congratulations, you’re ready to inject dependencies!

In this chapter we’ve seen how Cucumber’s use of dependency injection simplifies the management of the graph of objects needed to run our scenarios. We looked at most of the DI containers that Cucumber is integrated with and saw that PicoContainer is probably the simplest to use, if you aren’t already using one of the others in your project. Most of the other DI containers require some form of annotation and configuration. Once we choose a DI container, no matter which one, it takes over responsibility for creating all our step definition and hook objects.

As we applied DI to our example we pushed more of the responsibilities for creating and initializing our objects ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required