132-java-testing-integration-testing — скилл для Claude Code
Скилл для ИИ-агента, который наводит порядок в интеграционных тестах Java-сервисов: поднимает WireMock, изолирует заглушки и убирает моки HTTP-клиентов.
npx skills add jabrena/plinth --skill 132-java-testing-integration-testing -a claude-codeЧто делает 132-java-testing-integration-testing
Скилл разбирает интеграционные тесты Java-сервисов, которые ходят во внешние HTTP-зависимости. Агент сканирует импорты и находит инфраструктуру клиента: HttpClient, feign.*, retrofit2.*, RestTemplate. Дальше он собирает абстрактный базовый класс BaseIntegrationTest, подключает WireMockExtension через @RegisterExtension и выделяет динамический порт через dynamicPort().
Координаты сервиса прокидываются в тесты через System.setProperty() в @BeforeAll, а файлы заглушек лежат в wiremock/files/ и подключаются по bodyFileName. Заглушки регистрируются внутри каждого тестового метода, поэтому один тест не ломает другой. Проверка вызовов идёт через WIREMOCK.verify, для сбоев есть инъекция 503 и задержка withFixedDelay. В зависимости добавляется wiremock-standalone в test scope.
Перед любыми правками скилл требует прогнать ./mvnw compile или mvn compile и останавливается, если сборка падает. Это блокирующее условие, и обойти его нельзя. После изменений — ./mvnw clean verify. Отдельно вычищаются анти-паттерны: глобальные заглушки в @BeforeAll, HTTP-клиенты под Mockito, захардкоженные порты и URL. Если в проекте уже так заведено, скилл будет спорить с текущим кодом, и это повод проверить, кто прав.
Какие задачи решает
- собрать базовый класс интеграционного теста с WireMock
- найти HTTP-клиент по импортам и подставить заглушку
- прокинуть адрес сервиса в тест через системные свойства
- вынести тела ответов в JSON-маппинги с
bodyFileName - убрать мок HTTP-клиента и глобальные заглушки из тестов
Примеры запросов агенту
- Настрой интеграционные тесты для этого Java-сервиса с WireMock
- Проверь интеграционные тесты и убери мок HTTP-клиента
- Добавь изоляцию заглушек по тестовым методам и проверку вызовов
Как установить 132-java-testing-integration-testing
1Через Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 132-java-testing-integration-testing -a claude-code2Вручную: положить файлы
~/.claude/skills/132-java-testing-integration-testing/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/132-java-testing-integration-testing/
1Через Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 132-java-testing-integration-testing -a codex2Вручную: положить файлы
.agents/skills/132-java-testing-integration-testing/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 132-java-testing-integration-testing -a cursor2Вручную: положить файлы
.cursor/skills/132-java-testing-integration-testing/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install jabrena/plinth 132-java-testing-integration-testing2Вручную: положить файлы
.github/skills/132-java-testing-integration-testing/SKILL.md1Через Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 132-java-testing-integration-testing -a gemini-cli2Командой платформы
gemini skills install https://github.com/jabrena/plinth --path skills/132-java-testing-integration-testingВручную: положить файлы
.devin/skills/132-java-testing-integration-testing/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 132-java-testing-integration-testing -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о 132-java-testing-integration-testing
Как установить 132-java-testing-integration-testing в Claude?
Выполните npx skills add jabrena/plinth --skill 132-java-testing-integration-testing -a claude-code. Скилл появится в ~/.claude/skills/132-java-testing-integration-testing/SKILL.md.
Что делает этот скилл?
Помогает агенту настроить, проверить или переписать интеграционные тесты Java: базовый класс BaseIntegrationTest, заглушки WireMock, изоляцию по методам и проверку HTTP-вызовов.
Что нужно сделать до правок тестов?
Сначала прогнать ./mvnw compile или mvn compile. Если компиляция падает, скилл останавливается и не применяет изменения, пока ошибка не устранена.
Исходный текст
SKILL.md · Apache-2.0
--- name: 132-java-testing-integration-testing description: Use when you need to set up, review, or improve Java integration tests — including generating a BaseIntegrationTest.java with WireMock for HTTP stubs, detecting HTTP client infrastructure from import signals, injecting service coordinates dynamically via System.setProperty(), creating WireMock JSON mapping files with bodyFileName, isolating stubs per test method, verifying HTTP interactions, or eliminating anti-patterns such as Mockito-mocked HTTP clients or globally registered WireMock stubs. This should trigger for requests such as Review Java code for integration tests; Apply best practices for integration tests in Java code; Write Java integration tests with real infrastructure boundaries; Improve Testcontainers integration tests for Java code; Review integration test setup and teardown in Java projects. Part of Plinth Toolkit license: Apache-2.0 metadata: author: Juan Antonio Breña Moral version: 0.19.0 --- # Java Integration testing guidelines Set up robust integration-test infrastructure for Java services using WireMock to stub outbound HTTP dependencies. **What is covered in this Skill?** - Infrastructure topology detection: scanning imports for `HttpClient`, `feign.*`, `retrofit2.*`, `RestTemplate` - Abstract `BaseIntegrationTest` base class - `WireMockExtension` with `@RegisterExtension`, dynamic port allocation (`dynamicPort()`) - `usingFilesUnderClasspath(wiremock)`, `@BeforeAll` + `System.setProperty()` for coordinate propagation - WireMock JSON mapping files (`bodyFileName` referencing `wiremock/files/`) - Programmatic stub registration via WireMock DSL - Per-test stub isolation: register stubs inside each test method - Fault injection: 503 service unavailable, network latency with `withFixedDelay` - Request verification via `WIREMOCK.verify` - `wiremock-standalone` Maven dependency (test scope) - Anti-patterns: global `@BeforeAll` stubs, Mockito-mocked HTTP clients, hardcoded ports or URLs **Scope:** The reference is organized by examples (good/bad code patterns) for each core area. Apply recommendations based on applicable examples. ## Constraints Before applying any integration test changes, ensure the project compiles. If compilation fails, stop immediately — do not proceed until resolved. After applying improvements, run full verification. - **MANDATORY**: Run `./mvnw compile` or `mvn compile` before applying any change - **SAFETY**: If compilation fails, stop immediately and do not proceed — compilation failure is a blocking condition - **VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after applying improvements - **BEFORE APPLYING**: Read the reference for detailed examples, good/bad patterns, and constraints ## When to use this skill - Review Java code for integration tests - Apply best practices for integration tests in Java code - Write Java integration tests with real infrastructure boundaries - Improve Testcontainers integration tests for Java code - Review integration test setup and teardown in Java projects ## Workflow 1. **Compile project before integration-test changes** Run `./mvnw compile` or `mvn compile` and stop immediately if compilation fails. 2. **Read integration-testing reference and detect topology** Read `references/132-java-testing-integration-testing.md` and detect HTTP client and external dependency integration points. 3. **Set up resilient integration-test infrastructure** Implement BaseIntegrationTest, WireMock mappings/stubs, per-test isolation, and verification patterns. 4. **Verify with full build** Run `./mvnw clean verify` or `mvn clean verify` after applying improvements. ## Reference For detailed guidance, examples, and constraints, see [references/132-java-testing-integration-testing.md](references/132-java-testing-integration-testing.md).
© Juan Antonio Breña Moral · Apache-2.0 · jabrena/plinth