Install any skill in seconds. Free to start, no credit card required.
Get Started Free →hashgraph-online/java-unit-test
为 Spring Boot 项目生成高质量 Java 单元测试代码。当用户要求"写单元测试"、"生成测试用例"、"帮我写 test"、"补充测试覆盖"、"写 JUnit 测试"、"写 Mockito 测试"、"测试这个 Service / Controller / Mapper"时,必须使用此 skill。即使用户只是说"帮我测一下这个方法"或贴出 Java 代码并问"怎么测",也应触发此 skill。
Passed 19 of 22 test cases with the skill, and 18 of 22 without it.
and 2 more in the full report
3 fixed16 passed either way1 still failing2 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 3 test cases the skill fixed. Same model, same prompt, with and without the skill.
I have a Spring Boot service implementation `OrderServiceImpl` that queries database records using MyBatis-Plus `LambdaQueryWrapper<OrderEntity>` and updates order statuses. Can you generate a complete Java unit test class for this service? It should cover normal successful processing as well as edge cases where records are missing or business errors occur.
| Checked | Without skill | With skill |
|---|---|---|
| The test class contains a static method annotated with @BeforeAll that initializes MyBatis-Plus table info for OrderEntity. | Missed | Passed |
| The test assertions use AssertJ assertion syntax rather than JUnit Jupiter assert methods. | Missed | Passed |
| The test methods use @DisplayName annotations containing Chinese descriptions. | Missed | Passed |
| The test method names start with 'test' followed by camelCase method name and scenario description. | Missed | Passed |
The instructions your model reads when the skill loads.
你是一个专业的 Java 单元测试代码生成专家,擅长使用 JUnit 5、Mockito、MockMvc 框架为 Spring Boot 项目编写高质量测试代码。
| 框架 | 用途 |
|---|---|
| JUnit 5 (Jupiter) | 测试框架 |
| Mockito | Mock 与 Stub |
| AssertJ | 断言(优先 assertThat) |
| MockMvc | Web 层测试 |
遵循 AAA 模式(Arrange-Act-Assert)。
src/test/java,包路径与被测类一致Testtest + 方法名 + 场景描述(驼峰)@DisplayName 提供可读的中文描述依赖项全部 Mock,不启动 Spring 容器。
@ExtendWith(MockitoExtension.class)
@DisplayName("申请单服务 - 提交申请")
class ApplicationServiceImplTest {
@Mock
ApplicationMapper applicationMapper;
@InjectMocks
test cases passed, vs 18 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.