·131-java-testing-unit-testing
</>

131-java-testing-unit-testing

当您需要审查、改进或编写 Java 单元测试时使用 - 包括从 JUnit 4 迁移到 JUnit 5、采用 AssertJ 进行流畅断言、使用 Give-When-Then 构建测试、确保测试独立性、应用参数化测试、使用 Mockito 模拟依赖关系、验证边界条件(RIGHT-BICEP、CORRECT、A-TRIP)、利用 JSpecify 空安全注释或消除测试反模式(例如基于反射)测试或共享可变状态。 java 技能项目的一部分

12安装·2热度·@jabrena

安装

$npx skills add https://github.com/jabrena/cursor-rules-java --skill 131-java-testing-unit-testing

如何安装 131-java-testing-unit-testing

通过命令行快速安装 131-java-testing-unit-testing AI 技能到你的开发环境

  1. 打开终端: 打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等)
  2. 运行安装命令: 复制并运行以下命令:npx skills add https://github.com/jabrena/cursor-rules-java --skill 131-java-testing-unit-testing
  3. 验证安装: 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用

来源:jabrena/cursor-rules-java。

SKILL.md

查看原文

Review and improve Java unit tests using modern JUnit 5, AssertJ, and Mockito best practices.

Prerequisites: Run ./mvnw compile or mvn compile before applying any change. If compilation fails, stop immediately and do not proceed — compilation failure is a blocking condition.

Core areas: JUnit 5 annotations (@Test, @BeforeEach, @AfterEach, @DisplayName, @Nested, @ParameterizedTest), AssertJ fluent assertions (assertThat, assertThatThrownBy), Given-When-Then test structure, descriptive test naming, single-responsibility tests, test independence and isolated state, parameterized tests with @ValueSource/@CsvSource/@MethodSource, Mockito dependency mocking (@Mock, @InjectMocks, MockitoExte...

当您需要审查、改进或编写 Java 单元测试时使用 - 包括从 JUnit 4 迁移到 JUnit 5、采用 AssertJ 进行流畅断言、使用 Give-When-Then 构建测试、确保测试独立性、应用参数化测试、使用 Mockito 模拟依赖关系、验证边界条件(RIGHT-BICEP、CORRECT、A-TRIP)、利用 JSpecify 空安全注释或消除测试反模式(例如基于反射)测试或共享可变状态。 java 技能项目的一部分 来源:jabrena/cursor-rules-java。

可引用信息

为搜索与 AI 引用准备的稳定字段与命令。

安装命令
npx skills add https://github.com/jabrena/cursor-rules-java --skill 131-java-testing-unit-testing
分类
</>开发工具
认证
收录时间
2026-03-10
更新时间
2026-03-10

Browse more skills from jabrena/cursor-rules-java

快速解答

什么是 131-java-testing-unit-testing?

当您需要审查、改进或编写 Java 单元测试时使用 - 包括从 JUnit 4 迁移到 JUnit 5、采用 AssertJ 进行流畅断言、使用 Give-When-Then 构建测试、确保测试独立性、应用参数化测试、使用 Mockito 模拟依赖关系、验证边界条件(RIGHT-BICEP、CORRECT、A-TRIP)、利用 JSpecify 空安全注释或消除测试反模式(例如基于反射)测试或共享可变状态。 java 技能项目的一部分 来源:jabrena/cursor-rules-java。

如何安装 131-java-testing-unit-testing?

打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/jabrena/cursor-rules-java --skill 131-java-testing-unit-testing 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用

这个 Skill 的源码在哪?

https://github.com/jabrena/cursor-rules-java