# testing-strategies

Gives your coding agent ready test patterns for a Micronaut and Kotlin backend: integration tests, repository tests, test data builders.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · ★ 109
- Author: c0x12c
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/c0x12c/ai-toolkit/tree/HEAD/toolkit/skills/testing-strategies/SKILL.md
- Updated: 2026-06-18
- HTML: https://affpapa.org/en/nevibecode/skills/testing-strategies

## What it does

This skill spells out how tests should look in a Micronaut and Kotlin project. Every endpoint gets an integration test that extends `AbstractControllerTest`, calls Retrofit clients from `module-client`, and wipes the database with `truncateAllTables()` inside `@AfterEach`. Raw `HttpRequest` is off the table. Tokens come from `accessToken()`, managers stay unmocked, and the whole HTTP stack runs end to end.

Repositories follow their own template. Tests extend `AbstractRepositoryTest` and cover at least insert, lookup by id, a missing row, a soft-deleted row, and a partial update. The MockK section is blunt about coroutines: use `coEvery` and `coVerify` for suspend functions, never `every` and `verify`, and reach for `runTest` from `kotlinx.coroutines.test` instead of `runBlocking`. Plain `every` on a suspend function fails with a confusing error, so this rule saves debugging time.

Parallel runs get a note too: when tests die with a connection-acquisition error, raise `maxPoolSize` to 20. Configuration for `@MicronautTest` and the clients lives in `integration-test-setup.md`; full code samples with MockK and AssertJ are in `examples.md`. Tests run through Gradle — the whole suite, a single class, or one module.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add c0x12c/ai-toolkit --skill testing-strategies -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/testing-strategies/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/testing-strategies/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add c0x12c/ai-toolkit --skill testing-strategies -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/testing-strategies/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add c0x12c/ai-toolkit --skill testing-strategies -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/testing-strategies/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install c0x12c/ai-toolkit testing-strategies
```

2. **Manually: put the files in place**
- File: `.github/skills/testing-strategies/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add c0x12c/ai-toolkit --skill testing-strategies -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/c0x12c/ai-toolkit --path toolkit/skills/testing-strategies
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/testing-strategies/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add c0x12c/ai-toolkit --skill testing-strategies -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/c0x12c/ai-toolkit/tree/HEAD/toolkit/skills/testing-strategies/SKILL.md

## When to use it
- write an integration test for a new endpoint
- cover a repository with the baseline set of checks
- figure out why MockK misses a suspend function
- fix parallel tests failing on connection pool exhaustion
- build test fixtures with data builders

## Example prompts
- Write an integration test for the get-employee-by-id endpoint
- Add repository tests for `DefaultEmployeeRepository`, including soft delete
- Check that suspend functions in the tests use `coEvery` and `coVerify`

## Similar
- [kotlin-testing](https://affpapa.org/en/nevibecode/skills/kotlin-testing.md) — skill · 4700 installs
- [rc-testing](https://affpapa.org/en/nevibecode/skills/rc-testing.md) — skill · 627 installs
- [langchain4j-testing-strategies](https://affpapa.org/en/nevibecode/skills/langchain4j-testing-strategies.md) — skill · 3700 installs
- [golang-testing-strategies](https://affpapa.org/en/nevibecode/skills/golang-testing-strategies.md) — skill · 443 installs
- [130-java-testing-strategies](https://affpapa.org/en/nevibecode/skills/130-java-testing-strategies.md) — skill · 377 installs
- [android-kotlin](https://affpapa.org/en/nevibecode/skills/android-kotlin.md) — skill · 3300 installs

## Other versions with the same name
- [testing-strategies · akillness](https://affpapa.org/en/nevibecode/skills/akillness-testing-strategies.md) — 368 installs

From the same set: [c0x12c/ai-toolkit](https://affpapa.org/en/nevibecode/by/c0x12c/ai-toolkit.md) — 11 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
