~/talk

JUnit 5 Testing: Android Unidirectional Data Flow with LiveData

Talkat droidcon SF 2019 · 2019-11-18..11-19· [testing, android]
links:none on file
slides:none on file

Starting from Coinverse's LiveData + UDF Kotlin app, the talk shows a concrete test workflow: modularize viewmodel and repository, mock repository flows with MockK, run synchronous LiveData on test dispatchers, and assert view states/effects with AssertJ under JUnit 5. The codebase yields 96% code coverage for viewmodel lines by 61 focused unit tests, with utilities for mocking paged lists, static/constants, and coroutine test dispatchers so tests run off-device.

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 3:52High-level overview of plan
  3. 6:23Why UDF with LiveData and Kotlin
  4. 13:27Local unit testing strategy
  5. 17:41Test configuration setup
  6. 21:53Parameterized tests and edge cases
  7. 23:18Mocking repository and data
  8. 26:31Firing events and assertions
  9. 28:58Verification and cleanup
  10. 30:22Test coverage and results
  11. 30:44Next steps and recap
  12. 31:47Q&A 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.