Individual skill

testcontainers-integration-testing

提供基于 Testcontainers 的 Java 集成测试工作流,用于数据库、中间件和外部依赖的接近真实行为验证。 当任务涉及持久化、消息、缓存、对象存储或多依赖编排时使用。

plugins/Colin4k1024/tsp/skills/testcontainers-integration-testing/SKILL.md

Read pinned source

Source commit d780783eba4ecc7c8b9429f95c9362df95f07c61

What was checked

Matches the observed repository HEAD
Yes
Scanner rules are current
Yes
Repository scan complete
No
Skill scan complete
No
Observed behavior
Network or broad shell
Last checked
Nov 4, 2026

These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.

Install this skill

Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.

An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.

Repository context

Repository stars (not skill ratings)
1,533
Repository last updated
Nov 6, 2026
License
Apache-2.0

Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.

Files and excerpt

File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.

Browse files
Read excerpt

# Testcontainers Integration Testing

## 用途

- 把“依赖共享测试环境”收敛成“本地或 CI 可重复启动的临时依赖环境”。
- 适合数据库、Redis、MQ、对象存储、搜索引擎或浏览器依赖的集成验证。

## 默认做法

1. 先明确要验证的真实依赖和关键行为,不要把所有外部系统都塞进同一个大而慢的集成测试。
2. 优先为高风险链路建立容器化验证,例如 repository 查询语义、事务回滚、消息收发、缓存一致性、数据库迁移和真实协议交互。
3. 容器镜像、端口、等待条件和初始化数据都要显式写进测试,不依赖共享环境中的隐式前置状态。
4. 让测试自己启动依赖、执行验证、清理资源;不要要求执行者手工先起一套本地服务再跑测试。
5. 只把 Testcontainers 用在“接近真实行为才有价值”的场景;纯逻辑和普通 service 分支仍优先走单元测试。