BDD with JUnit 5 and Cucumber
summary
Demonstrates BDD for a Java flight-management app using JUnit 5 nested tests then migrating to Cucumber feature files with Gherkin and IntelliJ plugins; policies enforce economy vs business rules and VIP-only business-seat rules. Cucumber reduces test code from about 207 to 157 lines and turns parameterized bonus logic into 10 scenarios (2 outlines × 5 examples) / 30 steps. Steps auto-generate Java stubs, run in IDE, and the feature tests execute green against the implemented business logic.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 3:02Limitations of Test-Driven Development
- 5:31Behavior-Driven Development explained
- 10:29JUnit nested tests
- 16:43Given-When-Then in JUnit
- 17:03Introducing Cucumber
- 22:03Cucumber structure
- 26:53Cucumber in IntelliJ
- 30:09Step definitions
- 33:40Parameterized Cucumber tests
- 43:03Summary








