roadmap
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
Prepare for JUnit interviews on how Jupiter finds, orders and runs tests, from assertions to extensions. Covers fixtures, parameterized tests, Mockito, tags, parallel runs and moving off JUnit 4.
355 of 355 questions in your plan: 0 known, 0 in progress, 0 due, 0 skipped, 355 new. 0 cut, outside your plan.
JUnit rarely gets a round of its own. It surfaces when a Java or Kotlin coding exercise ends with "now write the tests", in the testing part of a backend or Android conversation, and at length in SDET loops, where the framework itself is the subject. The first questions check that you can read a test class the way Jupiter reads it: that each test method gets a fresh instance of the class by default, which is why a field set in one test is gone in the next and why @BeforeAll must be static unless the lifecycle is switched to per-class.
Later questions are about failure behaviour. Why does assertTimeout let a slow call run to the end while assertTimeoutPreemptively aborts it, and what breaks when the second one moves your code onto another thread? Why does a stub left unused fail a test that otherwise passed once Mockito's strict stubs are on? Why can a module report zero tests and a green build? What separates candidates is whether they can say what the engine does with an annotation, not only what it is for: when an extension registered in a field is created, which callbacks run around a dynamic test and which do not, and what makes a suite safe to run in parallel.
The plan opens with two ideas from testing in general, because the framework encodes them: what a unit test isolates, and how a test is shaped so that it reads as arrange, act, assert and never depends on another test's leftovers. With those in place, the core of Jupiter follows: the annotations that mark and name a test, the assertions and assumptions that decide its outcome, and AssertJ and Hamcrest, which most teams reach for once plain assertions read poorly.
Next comes the class around the test. Lifecycle hooks and instance modes decide what state survives between methods, and nested and dynamic tests change how tests are grouped and created at runtime. Data-driven tests come after that. Partitions and boundaries answer which rows a test should carry, and parameterized tests answer how JUnit feeds and converts them. Tags, conditions and parallelism then turn from writing tests to choosing which ones run, and how many at once.
Mocking arrives once tests are being written in volume: test doubles as a concept first, then Mockito, the library most JUnit suites pair with. The last stretch goes under the framework. JUnit 4's runners and rules come first: a class could take only one runner, and rules were a second, separate hook, which is the split Jupiter's extension model replaced with a single mechanism. The plan closes on the Platform, the engine and launcher layer that build tools and IDEs talk to.
A Java developer who uses JUnit every day but has never looked inside it can move quickly through the opening groups and slow down at lifecycle, parameterized sources and Mockito, which is where everyday usage hides the rules interviewers ask about. If the interview is days away, raise importance to must know and narrow level to your own band; that cut keeps what these loops ask most. Candidates for SDET or test-platform roles should study by topics through the extension model and the Platform. Those questions go into writing an extension, sharing state through its store, and wiring engines into a build. If you are moving a codebase off JUnit 4, read the migration group early, because the Vintage engine that lets both versions run together is deprecated in the current release. The plan stops at the test framework. The language beneath it, from generics to the concurrency your parallel tests exercise, belongs to the [Java roadmap](/roadmaps/java). Testing a Spring application through its context and test slices is covered by the [Spring Boot roadmap](/roadmaps/spring-boot).
A Java developer who uses JUnit every day but has never looked inside it can move quickly through the opening groups and slow down at lifecycle, parameterized sources and Mockito, which is where everyday usage hides the rules interviewers ask about. If the interview is days away, raise importance to must know and narrow level to your own band; that cut keeps what these loops ask most. Candidates for SDET or test-platform roles should study by topics through the extension model and the Platform. Those questions go into writing an extension, sharing state through its store, and wiring engines into a build. If you are moving a codebase off JUnit 4, read the migration group early, because the Vintage engine that lets both versions run together is deprecated in the current release.
The plan stops at the test framework. The language beneath it, from generics to the concurrency your parallel tests exercise, belongs to the Java roadmap. Testing a Spring application through its context and test slices is covered by the Spring Boot roadmap.