alibaba/testable-mock
换种思路写Mock,让单元测试更简单 observed · 2026-08-28
Health v2 · maintenance only
32/100
- Activity 0
- Release rhythm 35
- Longevity 100
Flags: no_releases
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 2122
- days_rel: n/a
- days_push: 1204
- n_releases_24m: 0
Adoption not part of the score
1836 stars · 306 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
TestableMock is a lightweight mocking library for JVM unit tests that replaces methods (including private, static, and constructors) via a simple @MockInvoke annotation without initialization or framework constraints. It works with Java, Kotlin, Android, and Spock, using a Java agent and Maven plugin for injection.
Use cases
- mock private methods in unit tests
- mock static methods without PowerMock
- simplify mocking in Java unit tests
- mock objects regardless of how they are created
- use mocks in Kotlin or Spock tests
- mock dependencies in Android unit tests
When to choose
- you need to mock private, static, or constructor methods with minimal setup
- you want annotation-based mock definitions without framework lock-in
- you test Java, Kotlin, Android, or Spock projects on the JVM
When to avoid
- you need a mocking library under active feature development
- you are not on the JVM platform
- you prefer mainstream tools like Mockito or PowerMock with large community support
Facets
library · maturity maintenance
testing mocking testing developer-tools jvm unit-testing java-agent mock-framework kotlin spock android
2 sources
- readme: https://github.com/alibaba/testable-mock · fetched 2026-08-28 · 02a98e312c09
- homepage: https://alibaba.github.io/testable-mock/ · fetched 2026-08-29 · e711e439b45e
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| alibaba/testable-mock | main | 32 |
For agents
markdown · JSON · MCP: product_card(name="alibaba/testable-mock")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem