Summary
In this chapter, we had the opportunity to learn how Quarkus provides dependency injection through Quarkus DI. We started by reviewing some of the concepts defined by the Contexts and Dependency Injection (CDI) for Java 2.0 specification, the specification that Quarkus DI is derived from. Then, we proceeded to implement these concepts in our hexagonal application. We defined the managed beans and injected them while refactoring use cases, ports, and adapters. Finally, we learned how to integrate Quarkus with Cucumber to get the best of both worlds while testing our hexagonal application.
By implementing Quarkus dependency injection mechanisms into a hexagonal system, we are also turning it into a more robust and modern system.
In the next chapter, we'll turn our attention to adapters. Quarkus provides powerful capabilities for creating reactive REST endpoints and we'll learn how to integrate them with hexagonal system adapters.