# EasyMock

> Mock objects for Java unit tests, generated on the fly

Source: https://talira.ai/catalog/easymock-69109hcq
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / testing / mocking](https://talira.ai/categories/developer-tools/testing/mocking), [languages / java](https://talira.ai/categories/languages/java)
- Licence: Apache-2.0[^1][^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [EasyMock](https://talira.ai/orgs/easymock-project.md)

EasyMock is a Java library that creates mock objects for interfaces and classes at runtime, so a unit test can stand in for the collaborators of the code under test and check they were called as expected. It was the first dynamic mock object generator for Java, building mocks with Java proxies instead of hand-written classes. It works with JUnit and TestNG, and is an alternative to [Mockito](https://talira.ai/catalog/mockito-19c1938g.md).

## Links

- Website: https://easymock.org/
- GitHub: https://github.com/easymock/easymock
- Docs: https://easymock.org/user-guide.html

## Problems it solves

- replace a dependency with a fake object in a Java unit test
- check my Java code calls a collaborator the way I expect
- unit test a Java class in isolation without its real database or service

## Features

- mocks for interfaces and classes created at runtime
- verifies the calls a test expects
- JUnit and TestNG support

## Trust

Overall: 0.48 out of 1.
Signals: maintenance 0.67, adoption 0.58, momentum 0.24, community 0.59, backing 0.30, extensibility 0.00.

- last commit 11 days ago
- 10 commits in the last 90 days
- latest release easymock-5.7.0 3 months ago
- 830 GitHub stars
- 29 contributors
- has a company behind it

## Alternatives

- [Mockito](https://talira.ai/catalog/mockito-19c1938g.md): Tasty mocking framework for unit tests in Java

## Sources

[^1]: https://easymock.org/license.html (checked 28 Nov 2026)
[^2]: https://github.com/easymock/easymock/blob/master/core/src/main/java/org/easymock/EasyMock.java (checked 28 Nov 2026)
