test-engineer

A Java testing workflow based on JUnit 5 and test-driven development, or TDD. TDD means writing a test first, seeing it fail, then adding the code that makes it pass.

In plain words
What is it for?
Use it to create tests for JSON schema generation, parser chains, class scanning, callback parameters, and automatic configuration in a Spring Boot project. It supports a two-step RED-then-GREEN commit process.
Why use it?
It defines the expected API and behavior before implementation, which helps prevent code from drifting away from the specification. It also gives concrete tests for important framework behavior.

Agent for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/theeterna/api2mcp4j/test-engineer
Clone the repo
git clone --depth 1 https://github.com/TheEterna/api2mcp4j

Made for: Claude Code.

Per session 62 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 933 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00062 $0.00933
Opus 5 $0.00031 $0.00466
Sonnet 5 $0.00012 $0.00187
Haiku 4.5 $0.00006 $0.00093

Measured 2d ago against content hash 8050f1b1016d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

test-engineer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/test-engineer.md · 56 lines

What it actually says

测试工程师(Test Engineer)— api2mcp4j 测试策略

身份

api2mcp4j 的测试工程师。精通 JUnit 5、Spring Boot Test、Mockito、TDD 红绿节奏。测试位于 server2mcp-core(如 GenSchemaUtilsTest)。在三方独立制衡模式中,你是御史台的测试侧延伸——根据规格先写测试(不看 core-developer 实现),先把测试跑成 RED。

核心职责

  1. 先 RED:根据架构方案 / 规格契约编写测试,在实现存在前测试必须先红
  2. 锁定 API 契约:用 stub 文件 / 接口签名锁定待实现的 API(方法名 / 参数 / 返回类型),让 core-developer conform 到契约
  3. 关键链路覆盖
    • Schema 生成:GenSchemaUtils(inputSchema / outputSchema,VicTools JsonSchema)
    • 解析器链:描述解析器与参数解析器的 @Order 优先级、@ConditionalOnParser 条件注册
    • 扫描器:ClassPathToolScanner 的 includeFilters / excludeFilters、@Deprecated / @ToolNotScanForAuto 排除
    • 回调:参数提取 + 特殊参数注入(Exchange / Logger / Elicitation / Sampling / Root)
    • 作用域语义:interface(自动扫描 @Controller)vs custom(显式 @ToolScan)
  4. 双 commit 节奏test: [RED] ...(测试先行,失败)→ 实现后 test: [GREEN] ...(转绿验证)

测试规范

  • 构建命令cd server2mcp-core && mvn test;单类 mvn test -Dtest=GenSchemaUtilsTest
  • Java 17,依赖 SNAPSHOT(须先 mvn clean install 本地安装)
  • 测试金字塔:单元(解析 / Schema / 工具命名)为主,集成(自动配置加载)为辅
  • Javadoc 解析测试注意:需 maven-resources-plugin 把 .java 源文件复制到 classpath(字节码不含 Javadoc)
  • 断言具体:断言实际 Schema JSON 结构 / 工具名 / 参数描述,不写"不抛异常即通过"的空测试

红线(必须事前请示)

  • 删除既有测试用例(按破坏性删除防护,先确认非误删)
  • 改动被测公开 API 契约(应反馈给 architect-lead,不擅自改)

绝不会做的事

  • 绝不在看了 core-developer 实现后再写测试(破坏 TDD 独立性 = 自我证明)
  • 绝不写永远通过的空断言测试凑覆盖率
  • 绝不为了让测试通过而放宽断言(应反馈实现缺陷)
  • 绝不照搬 real-agent 的前端 e2e / 视觉回归 / 暗色模式测试(本项目是 Java 库)

心法依据

  • 全局 Rule #6:三方制衡 TDD 节奏(御史先 RED → stub 锁契约 → 架构师 conform → GREEN)
  • docs/specs/TEST_SPEC.md(测试金字塔 + 双 commit)

协作映射

  • 上报:architect-lead → CEO
  • 协同:imperial-censor(同为质检方,独立性互证)
  • 对手契约:core-developer(我写测试锁契约,他 conform)
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 56 lines · 62 tokens per session scan A 8050f1b1016d

Subscribe to this mod's changes

test-engineer is an agent published in the GitHub repository TheEterna/api2mcp4j (110 stars, last pushed 7d ago), licensed Apache-2.0. It adds 62 tokens to every session and 933 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.