Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add skydoves/android-testing-skills --skill mocking-with-mockitogit clone --depth 1 https://github.com/skydoves/android-testing-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/skydoves/android-testing-skills/mocking-with-mockito)<a href="https://agentmods.dev/skills/skydoves/android-testing-skills/mocking-with-mockito"><img src="https://agentmods.dev/badge/skills/skydoves/android-testing-skills/mocking-with-mockito.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00205 | $0.04490 |
| Opus 5 | $0.00102 | $0.02245 |
| Sonnet 5 | $0.00041 | $0.00898 |
| Haiku 4.5 | $0.00020 | $0.00449 |
Grade A, and why
mocking-with-mockito scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 311 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Mocking with Mockito — The androidx-Native Mocking Stack
Mockito is the mocking framework androidx itself uses — 400+ test files import org.mockito across the AOSP checkout, while io.mockk returns zero hits. New Android code that wants to "match what Google does" picks Mockito + the mockito-kotlin Kotlin DSL. This skill documents the exact dependency matrix, the three setup styles, the Kotlin DSL surface, and the inline-mock-maker plumbing required for Kotlin final classes.
When to use this skill
- The user is starting a new test suite in a Kotlin Android module and asks "what mocking library should I use".
- The user reports
Cannot mock/spy class … final classfrom Mockito 4.x and needs themock-maker-inlineconfiguration. - The user reports
InvalidUseOfMatchersExceptionfrom mixing raw values withany()/eq(). - The user is wrestling with the
whenkeyword clash in Kotlin (`when`(mock.foo())) and wants thewheneverDSL. - The user wants
argumentCaptor<T>()withfirstValue/lastValue/allValuesinstead ofArgumentCaptor.forClass(...). - The user is migrating from
MockitoAnnotations.initMocks(this)toopenMocks(this)or theMockitoJUnit.rule()approach. - The user is mocking a
finalclass on an instrumented test on API < 28.
When NOT to use this skill
- The user wants
coEvery/coVerifyfor suspend functions, deep singleton mocking viamockkObject, or static mocking viamockkStatic— use../mocking-with-mockk/SKILL.md. - The user is choosing between fakes and mocks at the design level — use
../../../fundamentals/doubles/picking-test-doubles/SKILL.md. Per /test-doubles, fakes are preferred over mocks for behaviour-heavy collaborators. - The runner / Gradle matrix isn't set up yet — start with
../../runner/configuring-junit4-on-android/SKILL.md. - The user wants
runTest-aware testing for coroutines — see../../coroutines/testing-coroutines-with-runtest/SKILL.md.
Prerequisites
- The base test wiring from
../../runner/configuring-junit4-on-android/SKILL.mdis already in place (@RunWith(AndroidJUnit4::class),androidx.test.ext:junit:1.3.0, JUnit 4.13.2). - A Kotlin module on JDK 11+ (Mockito 5.x raised the JDK floor to Java 11).
- A
MainDispatcherRuleis installed if any code-under-test touchesDispatchers.Main— see the runner skill.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 311 lines · 205 tokens per session scan A 963529bd7f3f
mocking-with-mockito is a skill published in the GitHub repository skydoves/android-testing-skills (318 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 205 tokens to every session and 4,490 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
swift-protocol-di-testing
Protocol-based dependency injection for testable Swift code — mock file system, network, and external APIs using focused protocols and Swift Testing.
android-unit-test
Guide for writing and converting Chromium Android unit tests across host Robolectric (chromejunittests) and on-device (chromepublicunittestapk) suites.
react-native-testing
Write tests using React Native Testing Library (RNTL) v13 and v14 (@testing-library/react-native). Use when writing, reviewing, or fixing React Native component tests. Covers: render, screen, queries (getBy/getAllBy/queryBy/findBy), Jest matchers, userEvent, fireEvent, waitFor, and async patterns. Supports v13 (React…
flutter-add-widget-test
Implement a component-level test using WidgetTester to verify UI rendering and user interactions (tapping, scrolling, entering text). Use when validating that a specific widget displays correct data and responds to events as expected.
mobiai-android-testing
Use when writing or running tests in an Android project — unit tests, UI tests, choosing the right framework and patterns.
mobiai-ios-testing
Use when writing or running tests in an iOS project — unit tests, UI tests, snapshot tests, choosing the right framework.