Hey, hey,

couple of comments:

1) if you use mock annotation then you should use mockito rule or extension (depends junit4 or junit5)

2) You don't need reseting mock and view model creation in before (unless there is strong dependency with main dispatcher test provisioning) - test class with all fields is recreated for every test by default in junit4 and junit5

3) Instead using before and after - you can use rule or extension to make it less verbose

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

🇺🇦 Eugen Martynov
🇺🇦 Eugen Martynov

Written by 🇺🇦 Eugen Martynov

Stand with Ukraine! The loving XP husband and freelance Android/Kotlin engineer.

Responses (1)

Write a response