JSON Server vs Mockito: open-source test data and mocking tools compared
Metrics as of , from the GitHub or GitLab API of each repository. Refreshed monthly.
Summary
JSON Server: npm package that serves a REST API with filtering, sorting and pagination from a JSON file.
Mockito: Java mocking framework for unit tests covering mock creation, stubbing, verification and spies.
Both are listed under Test data and mocking. The table gives repository metrics from the GitHub API with their fetch date, then the documented facts used for every comparison in this category, each linked to the README or docs page it comes from. A cell reads "not documented" when the fact was not found in the project's documentation (3 of 10 fact cells here); that does not mean the feature is absent.
Side by side
| Fact | JSON Server | Mockito |
|---|---|---|
| Stars | 75,7151 | 15,4571 |
| Forks | 7,2671 | 2,6701 |
| Contributors | 961 | 3491 |
| Last release | 2026-03-231 | 2026-03-111 |
| Last commit | 2026-03-231 | 2026-09-091 |
| Commits in 90 days | 01 | 91 |
| License | MIT1 | MIT1 |
| Primary language | JavaScript1 | Java1 |
| Status | slow1 | active1 |
| Languages for writing tests | not documentednot found in the project's documentation as of | Java source: README |
| Protocols | HTTP (REST API routes for GET, POST, PUT, PATCH, DELETE) source: README | not documentednot found in the project's documentation as of |
| Definition format | JSON or JSON5 data file (db.json or db.json5) source: README | Code (Java API: mock(), when(), verify(); @Mock, @Spy and @InjectMocks annotations) source: Docs: Mockito site |
| Framework integrations | not documentednot found in the project's documentation as of | JUnit 4 (MockitoJUnitRunner, MockitoRule); JUnit 5 extension source: Docs: Mockito Javadoc |
| Install method | npm (npm install json-server) source: README | Maven Central dependency org.mockito:mockito-core (Gradle, Maven) source: Docs: Mockito site |
1 Fetched from the GitHub or GitLab API on . Hover a value for its own date.
When each fits
Written from each project's documented scope, not from preference. Neither tool is ranked.
JSON Server
Fits projects that need a REST API served from a JSON data file; its README describes query parameters for conditions, sorting, pagination and embedded relations. source: README
Mockito
Fits projects that write unit tests in Java with mock objects; its docs describe a mocking framework for unit tests in Java. source: Docs: Mockito site
More on these tools
Sources
- GitHub REST API: repository, read
- GitHub REST API: repository, read
- GitHub REST API: contributors, read
- GitHub REST API: contributors, read
- GitHub REST API: latest release, read
- GitHub REST API: latest release, read
- GitHub REST API: commits, read
- GitHub REST API: commits, read
- README, read
- README, read
- Docs: Mockito site, read
- Docs: Mockito Javadoc, read
Documented facts collected 2026-09-22. See the methodology for how metrics and facts are gathered.