523-frameworks-micronaut-testing-acceptance-tests
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMicronaut acceptance tests from Gherkin
基于Gherkin的Micronaut验收测试
Implement happy-path acceptance tests from Gherkin for Micronaut using real HTTP and infrastructure.
What is covered in this Skill?
- Preconditions: .feature file in context; Micronaut project confirmed
- Parsing scenarios tagged @acceptance / @acceptance-tests
- BaseAcceptanceTest: @MicronautTest, random port, @Client("/") HttpClient, TestPropertyProvider merging DB + WireMock URLs
- wireMock.resetAll() in @BeforeEach when sharing context
- Concrete *AT classes: Given/When/Then → setup, HttpClient exchange, AssertJ assertions
- Maven three-tier split: *Test → Surefire, *IT + *AT → Failsafe
- Happy-path scope by default
Scope: Apply recommendations based on the reference rules and step workflow.
使用真实HTTP和基础设施,为Micronaut实现基于Gherkin的正常流程验收测试。
本Skill涵盖哪些内容?
- 前置条件:上下文环境中存在.feature文件;已确认是Micronaut项目
- 解析标记为@acceptance / @acceptance-tests的场景
- BaseAcceptanceTest:@MicronautTest、随机端口、@Client("/") HttpClient、合并数据库与WireMock URL的TestPropertyProvider
- 共享上下文时在@BeforeEach中执行wireMock.resetAll()
- 具体的*AT类:Given/When/Then → 初始化、HttpClient请求交互、AssertJ断言
- Maven三层拆分:*Test → Surefire执行,*IT + *AT → Failsafe执行
- 默认覆盖正常流程范围
适用范围: 根据参考规则和步骤工作流应用建议。
Constraints
约束条件
Do not generate without a .feature file; compile before and verify after.
- PRECONDITION: Gherkin file must be in context — stop and ask if not provided
.feature - PRECONDITION: The project must use Micronaut — direct the user to @133, @323, or @423 otherwise
- MANDATORY: Run or
./mvnw compilebefore applying any changemvn compile - VERIFY: Run or
./mvnw clean verifyafter applying improvementsmvn clean verify - BEFORE APPLYING: Read the reference for detailed steps and safeguards
若无.feature文件则不生成代码;执行变更前先编译,变更后再验证。
- 前置条件:上下文环境中必须存在Gherkin 文件——若未提供则停止操作并询问用户
.feature - 前置条件:项目必须使用Micronaut——否则引导用户查看@133、@323或@423
- 强制要求:执行任何变更前先运行或
./mvnw compilemvn compile - 验证步骤:完成优化后运行或
./mvnw clean verifymvn clean verify - 执行前注意:阅读参考文档了解详细步骤和防护措施
When to use this skill
何时使用本Skill
- Implement Micronaut acceptance tests from a Gherkin feature file
- Set up BaseAcceptanceTest with Testcontainers and WireMock for Micronaut
- 从Gherkin feature文件实现Micronaut验收测试时
- 为Micronaut配置集成Testcontainers和WireMock的BaseAcceptanceTest时
Reference
参考文档
For detailed guidance, examples, and constraints, see references/523-frameworks-micronaut-testing-acceptance-tests.md.
如需详细指南、示例和约束条件,请查看references/523-frameworks-micronaut-testing-acceptance-tests.md。