322-frameworks-spring-boot-testing-integration-tests — скилл
Скилл для написания и разбора интеграционных тестов Spring Boot 4.0.x: Testcontainers, срезы персистентности, HTTP-проверки.
npx skills add jabrena/plinth --skill 322-frameworks-spring-boot-testing-integration-tests -a claude-codeЧто делает 322-frameworks-spring-boot-testing-integration-tests
Скилл задаёт правила для интеграционных тестов Spring Boot 4.0.x. Он разбирает, где проходит граница между интеграционным тестом и дублированием юнит-теста: проверяем связывание бинов и контракты, а не логику по отдельности. Внутри — рекомендации по Testcontainers с @ServiceConnection для связывания без ручной настройки, @DynamicPropertySource как запасной вариант для контейнеров без встроенной поддержки, статические @Container для переиспользования между методами.
Для HTTP есть два пути: MockMvcTester с AssertJ-проверками и TestRestTemplate для полного стека. Срезы @DataJdbcTest и @DataJpaTest поднимают только слой персистентности, поэтому стартуют быстрее. Моки регистрируются через @MockitoBean — в Spring Boot 4.0.x @MockBean удалён, и на старом коде скилл споткнётся. Изоляция данных описана жёстко: каждый тест владеет своим сценарием, общего изменяемого состояния и зависимости от порядка нет.
Перед любыми правками скилл требует собрать проект: ./mvnw compile или mvn compile. Если компиляция падает — стоп, дальше не идём. После изменений прогоняется ./mvnw clean verify или mvn clean verify. Если область запроса размыта, скилл останавливается и задаёт уточняющий вопрос, а не правит наугад.
Какие задачи решает
- написать
@SpringBootTestс Testcontainers и не настраивать подключение вручную - разделить интеграционные тесты и юнит-тесты по назначению
- ускорить прогон за счёт срезов
@DataJdbcTestи@DataJpaTest - убрать зависимость тестов от порядка выполнения и общего состояния
- перевести моки с удалённого
@MockBeanна@MockitoBean
Примеры запросов агенту
- Проверь мои интеграционные тесты Spring Boot и скажи, где я дублирую юнит-тесты
- Перепиши этот тест на Testcontainers с
@ServiceConnection - Настрой изоляцию данных между тестами в этом классе
Как установить 322-frameworks-spring-boot-testing-integration-tests
1Через Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 322-frameworks-spring-boot-testing-integration-tests -a claude-code2Вручную: положить файлы
~/.claude/skills/322-frameworks-spring-boot-testing-integration-tests/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/322-frameworks-spring-boot-testing-integration-tests/
1Через Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 322-frameworks-spring-boot-testing-integration-tests -a codex2Вручную: положить файлы
.agents/skills/322-frameworks-spring-boot-testing-integration-tests/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 322-frameworks-spring-boot-testing-integration-tests -a cursor2Вручную: положить файлы
.cursor/skills/322-frameworks-spring-boot-testing-integration-tests/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install jabrena/plinth 322-frameworks-spring-boot-testing-integration-tests2Вручную: положить файлы
.github/skills/322-frameworks-spring-boot-testing-integration-tests/SKILL.md1Через Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 322-frameworks-spring-boot-testing-integration-tests -a gemini-cli2Командой платформы
gemini skills install https://github.com/jabrena/plinth --path skills/322-frameworks-spring-boot-testing-integration-testsВручную: положить файлы
.devin/skills/322-frameworks-spring-boot-testing-integration-tests/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add jabrena/plinth --skill 322-frameworks-spring-boot-testing-integration-tests -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора36
Похожие
Рядом в теме «Тесты и QA»
Всё по теме «Тесты и QA» →Вопросы о 322-frameworks-spring-boot-testing-integration-tests
Как установить 322-frameworks-spring-boot-testing-integration-tests в Claude?
Выполните npx skills add jabrena/plinth --skill 322-frameworks-spring-boot-testing-integration-tests -a claude-code. Скилл появится в ~/.claude/skills/322-frameworks-spring-boot-testing-integration-tests/SKILL.md.
Что делает этот скилл?
Даёт правила и примеры хорошего и плохого кода для интеграционных тестов Spring Boot 4.0.x: Testcontainers, срезы персистентности, HTTP-проверки, изоляция данных, жизненный цикл контейнеров.
Что нужно перед применением изменений?
Скилл требует сначала собрать проект командой ./mvnw compile или mvn compile. Если компиляция не проходит, он останавливается и правки не вносит.
Исходный текст
SKILL.md · Apache-2.0
--- name: 322-frameworks-spring-boot-testing-integration-tests description: Use when you need to write or improve integration tests — including Testcontainers with @ServiceConnection, @DataJdbcTest persistence slices, TestRestTemplate or MockMvcTester for HTTP, data isolation, and container lifecycle management for Spring Boot 4.0.x. This should trigger for requests such as Review Java code for Spring Boot integration tests; Apply best practices for Spring Boot integration tests in Java code; Write @SpringBootTest integration tests with Testcontainers; Configure dynamic properties for Spring integration tests; Review Spring Boot integration test profiles. Part of Plinth Toolkit license: Apache-2.0 metadata: author: Juan Antonio Breña Moral version: 0.19.0 --- # Spring Boot Integration Testing Apply Spring Boot integration testing guidelines for Spring Boot 4.0.x. **What is covered in this Skill?** - Integration test scope and purpose (verify wiring and contracts, not unit-test duplication) - Testcontainers with @ServiceConnection for zero-config wiring (preferred) - @DynamicPropertySource as fallback for containers without built-in service connection support - Static @Container instances shared across test methods for performance - MockMvcTester for fluent AssertJ-based HTTP assertions (Spring Boot 4.0.x) - TestRestTemplate for full HTTP stack testing - @DataJdbcTest / @DataJpaTest persistence slices (load only persistence layer, start faster) - Data isolation: each test owns its scenario; no shared mutable state or ordering assumptions - @MockitoBean for mock registration (Spring Boot 4.0.x — @MockBean removed) - Resource lifecycle: Testcontainers JUnit integration for teardown; *IT / integration test separation **Scope:** Apply recommendations based on the reference rules and good/bad code examples. ## Constraints Before applying any integration test changes, ensure the project compiles. If compilation fails, stop immediately. After applying improvements, run full verification. - **MANDATORY**: Run `./mvnw compile` or `mvn compile` before applying any change - **SAFETY**: If compilation fails, stop immediately - **VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after applying improvements - **BEFORE APPLYING**: Read the reference for detailed rules and good/bad patterns - **EDGE CASE**: If request scope is ambiguous, stop and ask a clarifying question before applying changes - **EDGE CASE**: If required inputs, files, or tooling are missing, report what is missing and ask whether to proceed with setup guidance ## When to use this skill - Review Java code for Spring Boot integration tests - Apply best practices for Spring Boot integration tests in Java code - Write @SpringBootTest integration tests with Testcontainers - Configure dynamic properties for Spring integration tests - Review Spring Boot integration test profiles ## Workflow 1. **Read reference and assess project context** Read `references/322-frameworks-spring-boot-testing-integration-tests.md` and inspect the current project setup before proposing changes. 2. **Gather scope and decide target improvements** Identify requested outcomes, constraints, and the minimum safe set of changes to apply. 3. **Apply framework-aligned changes** Implement or refactor configuration/code following the reference patterns and project conventions. 4. **Run verification and report results** Execute appropriate build/tests and summarize what changed, what was verified, and any follow-up actions. ## Reference For detailed guidance, examples, and constraints, see [references/322-frameworks-spring-boot-testing-integration-tests.md](references/322-frameworks-spring-boot-testing-integration-tests.md).
© Juan Antonio Breña Moral · Apache-2.0 · jabrena/plinth