Stack Explorer

Mockito

Testing

Elegant mocking framework for Java unit tests

7M/week → Stable

Features

mockingtestingstubsunit

Pros and Cons

Ventajas

  • + Fluent and expressive API
  • + Behavior verification
  • + Flexible argument matchers
  • + JUnit integration
  • + Annotations for simplicity

Desventajas

  • - Cannot mock final classes without extension
  • - Excessive mocking indicates bad design
  • - Learning curve with matchers

Use Cases

  • Unit testing with dependencies
  • External service mocking
  • Integration testing
  • Call verification
  • Behavior stubbing

Tecnologías Relacionadas

Compatible with

Related