Skip to main content

Command Palette

Search for a command to run...

13 - Testing in Java: JUnit and Mockito

Unit testing with JUnit 5: annotations, assertions, parameterized tests. Mockito for mock, stub and verify. TDD.

Published
1 min readView as Markdown
F
Love coding and AI

Unit testing with JUnit 5: annotations, assertions, parameterized tests. Mockito for mock, stub and verify. TDD.

What you'll learn

  • JUnit 5: annotations and assertions
  • Parameterized tests
  • Mockito: mock, stub and verify
  • Test-Driven Development (TDD)
  • Testing best practices

This article is part of the Java series on federicocalo.dev.


Read the full article

The complete article (18 min read) with code examples, diagrams, and practical exercises is available here:

➡️ 13 - Testing in Java: JUnit and Mockito

https://federicocalo.dev/en/blog/java-testing-junit-mockito


By Federico Calò — Software Developer & Technical Writer