© Shekhar Gulati, Rahul Sharma 2017

Shekhar Gulati and Rahul Sharma, Java Unit Testing with JUnit 5, https://doi.org/10.1007/978-1-4842-3015-2_4

4. Dependency Injection, Mocking, Testing Traits, and Grouping Tests

Shekhar Gulati and Rahul Sharma2

(1)Gurgaon, Haryana, India

(2)Delhi, Delhi, India

In the last chapter, we started building the bookstoread application. We added a few features to the application following TDD (test-driven development) practice and conforming to the Red-Green-Refactor cycle. In the process of writing the application, you learned about JUnit 5 core concepts and how you can start building your JUnit 5 test suite. This chapter will build upon the knowledge gained in the first three chapters and cover more advanced concepts ...

Get Java Unit Testing with JUnit 5: Test Driven Development with JUnit 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.