~/talk

Mockito Features and Best Practices

Talkat Great International Developer Summit 2024 · 2024-04-23..04-26· [testing]
links:none on file
slides:none on file

Shows concrete how-to and limits: uses an Astro gateway/service example that calls api.open‑notify.org/astros.json, parses records and groups astronauts by craft to illustrate when to isolate with mocks vs run an integration test. Demonstrates creating mocks, stubs and spying on existing classes (logger example), warns do not mock types you don't own, and explains Mockito core + JUnit extension, argument matchers, verify/verifyInOrder, and that mocking static methods now in core (inline mock maker moved into Mockito 5). Code is at kousen/mockito-book.

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 1:15Why use Mockito and its purpose
  3. 6:54Problem illustration with Astro API
  4. 14:17Mocks vs stubs and their differences
  5. 23:25Mockito API and BDD alternatives
  6. 30:28Mockito annotations and injection
  7. 37:05Mockito versions and compatibility
  8. 43:04Argument matchers and custom matchers
  9. 51:10Verification and interaction order
  10. 54:20Testing best practices and limitations
  11. 57:09Summary and closing remarks
~/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.