~/talk

Making the Jump to JUnit 5

Talkat Conf42 Enterprise Software 2021 · 2021-03-25..05-05· [testing]
slides:none on file

Walks through migrating JUnit 4 to JUnit 5 on Spring Boot (requires Java 8+, Spring Boot 2.4+), showing concrete edits: org.junit.jupiter.api package, extendWith replaces RunWith, converting @Before to @BeforeEach and using assertThrows lambda instead of expected, replacing Mockito runner with MockitoExtension, and adding @DisplayName and @ParameterizedTest with @CsvFileSource. Uses an H2-backed REST app, runs Maven clean test, and shows tests increase from 9 to 11 when parameterized CSV rows are added; the converted code and build run cleanly.

AI-written summary · about

  1. 0:00Introduction
  2. 1:38Upgrade to JUnit 5
  3. 3:01JUnit 5 architecture
  4. 5:25Spring upgrade path
  5. 8:11Live migration
  6. 15:14New JUnit 5 features
  7. 21:53Resources
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.