Back to Developer Roadmap

Mocking

src/data/roadmaps/java/content/mocking--mockito@mLM1HJf6_pxrUDOmb45ew.md

4.0619 B
Original Source

Mocking

Mocking removes external dependencies from a unit test to create a sense of an entire controlled environment. The traditional method of mocks involves mocking all other classes that interact with the class we want to test. The common targets for mocking are:

  • Database connections
  • Web services
  • Slow Classes
  • Classes with side effects
  • Classes with non-deterministic behavior

Visit the following resources to learn more: