java-unit-test SKILL.md skill A
java-unit-test from hashgraph-online/awesome-codex-plugins is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
Install it, pinned
mdr add hashgraph-online/awesome-codex-plugins/java-unit-test@git:20260512.6523792Copy
Pins git:20260512.6523792 in mdr.lock. Pin the fingerprint instead .
Audit grade A, 17 of 17 checks passed Kind SKILL.md skill Repository hashgraph-online/awesome-codex-plugins Path plugins/Colin4k1024/tsp/skills/java-unit-test/SKILL.mdVersions recorded 1 Latest version git:20260512.6523792, committed May 12, 2026 Size 7,649 bytes Repository stars 1,537 License Apache-2.0
为 Spring Boot 项目生成高质量 Java 单元测试代码。当用户要求"写单元测试"、"生成测试用例"、"帮我写 test"、"补充测试覆盖"、"写 JUnit 测试"、"写 Mockito 测试"、"测试这个 Service / Controller / Mapper"时,必须使用此 skill。即使用户只是说"帮我测一下这个方法"或贴出 Java 代码并问"怎么测",也应触发此 skill。.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says # Java 单元测试代码生成专家
你是一个专业的 Java 单元测试代码生成专家,擅长使用 JUnit 5、Mockito、MockMvc 框架为 Spring Boot 项目编写高质量测试代码。
## 技术栈
| 框架 | 用途 |
|------|------|
| JUnit 5 (Jupiter) | 测试框架 |
| Mockito | Mock 与 Stub |
| AssertJ | 断言(优先 `assertThat`) |
| MockMvc | Web 层测试 |
遵循 **AAA 模式**(Arrange-Act-Assert)。
## 代码规范
- 测试类放在 `src/test/java`,包路径与被测类一致
- 测试类命名:被测类名 + `Test`
- 测试方法命名:`test` + 方法名 + 场景描述(驼峰)
- 每个测试方法只测试一个场景
- 使用 `@DisplayName` 提供可读的中文描述
---
## 根据被测层选择测试模式
### 1. 业务逻辑层(ServiceImpl / Step 等)
依赖项全部 Mock,不启动 Spring 容器。
```java
@ExtendWith(MockitoExtension.class)
@DisplayName("申请单服务 - 提交申请")
class ApplicationServiceImplTest {
@Mock
ApplicationMapper applicationMapper;
@InjectMocks
ApplicationServiceImpl applicationService;
@Test
@DisplayName("正常提交:保存成功返回申请单ID")
void testSubmit_success() {
// Arrange
SubmitRequest req = new SubmitRequest("张三", "001");
when(applicationMapper.insert(any())).thenReturn(1);
// Act
Long result = applicationService.submit(req);
// Assert
assertThat(result).isNotNull();
verify(applicationMapper).insert(any());
}
@Test
… Read the whole file at its exact version.
How to install
The exact contents, by fingerprint
mdr add hashgraph-online/awesome-codex-plugins/java-unit-test@sha256:7e59f30ebb0be7b1Copy
The line at the top of this page pins the label git:20260512.6523792, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
Badge
[](https://markdownregistry.com/a/art_nar4y2qqkodtqwuh) Copy 6 badge image fetches in 30 days. What the badge shows .
Versions The registry has recorded 1 version of this file, committed on May 12, 2026.
version committed commit size audit git:20260512.6523792 latest 2026-05-12
6523792
7,649 B A
view
Audit of the latest version A 17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
pass: Frontmatter block present pass: Frontmatter declares a name pass: Frontmatter declares a description pass: Size between 200 bytes and 200 KB (7649 bytes) pass: No zero-width or bidi control characters pass: No instruction hidden inside an HTML comment pass: No link to an exfiltration or paste host pass: No credential-shaped string pass: No instruction to send local credentials anywhere pass: No text hidden with inline styles pass: No prompt-injection phrasing pass: No curl or wget piped into a shell pass: No recursive delete of root, home or parent pass: No instruction to read or print local credentials pass: No base64 blob over 200 characters pass: No link to a raw IP address pass: No script tag
Source
API GET https://markdownregistry.com/api/v1/artifacts/art_nar4y2qqkodtqwuh
GET https://markdownregistry.com/api/v1/resolve?ref=hashgraph-online/awesome-codex-plugins/java-unit-test
GET https://markdownregistry.com/api/v1/blob/7e59f30ebb0be7b1a98cb2564611842ef6a4dd7021f15bf5a190ec323d111fe8Copy
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what .
More from hashgraph-online/awesome-codex-plugins list-my-plugin SKILL.md skill
hashgraph-online/awesome-codex-plugins · .agents/skills/list-my-plugin/SKILL.md · Add a Codex plugin to the awesome-codex-plugins README as one correctly placed line, check it locally, and finish with…
git:20261105.cfef970 · audit A · 1,537 stars
AGENTS.md AGENTS.md file
hashgraph-online/awesome-codex-plugins · AGENTS.md
git:20261105.dcc7950 · audit A · 1,537 stars
ontoly-software-graph SKILL.md skill
hashgraph-online/awesome-codex-plugins · plugins/0xsarwagya/ontoly-codex-plugin/skills/ontoly-software-graph/SKILL.md · Use Ontoly Software Graph evidence, CLI reports, MCP, and official Ontoly Agent Skills before searching source files…
git:20260714.2040a1b · audit A · 1,537 stars
agent-debug-fixer SKILL.md skill
hashgraph-online/awesome-codex-plugins · plugins/1139030773-cmd/agent-workflow-system/skills/agent-debug-fixer/SKILL.md · 中文调试修复技能。用于报错、测试失败、页面异常、功能不符合预期、需要定位根因并做最小修复时。触发语包括"进入调试模式""帮我修问题""报错了""测试失败""页面坏了""找根因"。
git:20260615.9a28338 · audit A · 1,537 stars
agent-drift-auditor SKILL.md skill
hashgraph-online/awesome-codex-plugins · plugins/1139030773-cmd/agent-workflow-system/skills/agent-drift-auditor/SKILL.md · 中文漂移审计技能。用于项目或学习过程变乱、上下文漂移、任务分叉、多个方案冲突、命名不一致、Codex 可能顺手改多了时。触发语包括"漂移检查""感觉跑偏了""项目变乱了""检查是否失控""分叉太多""上下文漂移"。
git:20260615.9a28338 · audit A · 1,537 stars
agent-learning-coach SKILL.md skill
hashgraph-online/awesome-codex-plugins · plugins/1139030773-cmd/agent-workflow-system/skills/agent-learning-coach/SKILL.md · 中文学习教练技能。用于学习编程、英语、设计、产品、AI、数学或任何技能时,先诊断水平,再用讲解、练习、反馈、复习的循环推进。触发语包括"进入学习模式""我想学""带我练""帮我制定学习计划""像教练一样教我"。
git:20260615.9a28338 · audit A · 1,537 stars
agent-newbie-guide SKILL.md skill
hashgraph-online/awesome-codex-plugins · plugins/1139030773-cmd/agent-workflow-system/skills/agent-newbie-guide/SKILL.md · 中文新手引导技能。用于用户有模糊目标、不会拆任务、不知道如何开始使用 Codex、希望像游戏新手教程一样被一步步引导时。触发语包括"启动新手引导""我有个模糊目标""我不知道怎么开始""帮我把想法变成任务""像小白一样带我做"。
git:20260615.9a28338 · audit A · 1,537 stars
agent-phase-closeout SKILL.md skill
hashgraph-online/awesome-codex-plugins · plugins/1139030773-cmd/agent-workflow-system/skills/agent-phase-closeout/SKILL.md · 中文阶段收尾技能。用于完成一个阶段、准备开新对话、需要更新状态快照、冻结模块、整理已完成任务和下一步任务时。触发语包括"阶段收尾""帮我收工""准备开新对话""更新快照""冻结阶段""总结当前状态"。
git:20260615.9a28338 · audit A · 1,537 stars
agent-project-master SKILL.md skill
hashgraph-online/awesome-codex-plugins · plugins/1139030773-cmd/agent-workflow-system/skills/agent-project-master/SKILL.md · 中文项目总控技能。用于产品开发、软件项目、长期计划、任务拆分、阶段规划、项目真相源维护、多个任务防分叉管理。触发语包括"进入总控模式""帮我规划项目""拆任务""建立 PROJECT.md""管理任务队列""产品开发任务"。
git:20260615.9a28338 · audit A · 1,537 stars
computefirst SKILL.md skill
hashgraph-online/awesome-codex-plugins · plugins/321zz321/computefirst-skill/skills/computefirst/SKILL.md · Use ComputeFirst for exact or deterministic computation when model-side arithmetic or manual transformation risks being…
git:20261103.4c2b322 · audit A · 1,537 stars
task-planner SKILL.md skill
hashgraph-online/awesome-codex-plugins · plugins/6Delta9/task-scheduler-codex-plugin/skills/task-planner/SKILL.md · Turn a list of goals, tasks, deadlines, and working constraints into a practical schedule with next actions and…
git:20260403.40685f9 · audit A · 1,537 stars
use-burpsuite-mcp-bridge SKILL.md skill
hashgraph-online/awesome-codex-plugins · plugins/6jeffr3y/burpsuite-mcp-bridge/skills/use-burpsuite-mcp-bridge/SKILL.md · Operate BurpSuite MCP Bridge for professional, authorized web testing. Use when Codex needs to inspect Burp…
git:20260907.d3020b7 · audit A · 1,537 stars
Every file in hashgraph-online/awesome-codex-plugins
Other files named java-unit-test java-unit-test SKILL.md skill
baixuanzhu/skills · eval/java-unit-test/regression-v1.5.0/snapshots/version2/SKILL.md · Java 单元测试助手。在编写、评审、补全、重构单元测试时使用本技能—— 无论用户是否提到具体框架(unit test / JUnit / Mockito / 测试用例 / 怎么测 / 测哪些 / 写多少)。 次级触发信号——代码或…
v1.5.0 · audit A · 3 stars
java-unit-test SKILL.md skill
baixuanzhu/skills · eval/java-unit-test/darwin-validation-v1.4.0/snapshots/versionB/SKILL.md · Java 单元测试**规范对齐**助手。在编写、评审、补全单元测试时使用本技能—— 无论用户是否提到具体框架(unit test / JUnit / Mockito / 测试用例 / 怎么测 / 测哪些 / 写多少测试)。…
v1.3.2 · audit A · 3 stars
java-unit-test SKILL.md skill
baixuanzhu/skills · eval/java-test/darwin-validation-v2.0.0/snapshots/blind/unit-B/versionA/SKILL.md · Java 开发期测试(纯单元测试)助手——@Mock + @InjectMocks,毫秒级,不起 Spring Context、不起容器、零测试基础设施。在编写、评审、补全、重构单元 测试时使用本技能,无论用户是否提到具体框架(unit…
v2.0.0 · audit A · 3 stars
java-unit-test SKILL.md skill
baixuanzhu/skills · eval/java-unit-test/darwin-validation-v1.4.0/snapshots/v1.3.2/SKILL.md · Java 单元测试**规范对齐**助手。在编写、评审、补全单元测试时使用本技能—— 无论用户是否提到具体框架(unit test / JUnit / Mockito / 测试用例 / 怎么测 / 测哪些 / 写多少测试)。…
v1.3.2 · audit A · 3 stars
java-unit-test SKILL.md skill
baixuanzhu/skills · eval/java-test/darwin-validation-v2.0.0/snapshots/v1-online-unit/SKILL.md · Java 单元测试助手。在编写、评审、补全、重构单元测试时使用本技能—— 无论用户是否提到具体框架(unit test / JUnit / Mockito / 测试用例 / 怎么测 / 测哪些 / 写多少)。 次级触发信号——代码或…
v1.5.3 · audit A · 3 stars
java-unit-test SKILL.md skill
baixuanzhu/skills · eval/java-test/darwin-validation-v2.0.0/snapshots/blind/unit-A/version2/SKILL.md · Java 开发期测试(纯单元测试)助手——@Mock + @InjectMocks,毫秒级,不起 Spring Context、不起容器、零测试基础设施。在编写、评审、补全、重构单元 测试时使用本技能,无论用户是否提到具体框架(unit…
v2.0.0 · audit A · 3 stars
java-unit-test SKILL.md skill
baixuanzhu/skills · eval/java-unit-test/darwin-validation-v1.4.0/snapshots/version1/SKILL.md · Java 单元测试**规范对齐**助手。在编写、评审、补全单元测试时使用本技能—— 无论用户是否提到具体框架(unit test / JUnit / Mockito / 测试用例 / 怎么测 / 测哪些 / 写多少测试)。…
v1.3.2 · audit A · 3 stars
java-unit-test SKILL.md skill
baixuanzhu/skills · skills/java-unit-test/SKILL.md · Java 开发期测试(纯单元测试)助手——@Mock + @InjectMocks 或项目既有的 @TestConfiguration 轻量 mock 装配,AssertJ 断言,毫秒级,零外部基础设施 (不连真实 DB / 容器 /…
v2.2.0 · audit A · 3 stars
Browse by kind , by grade A , or by owner .