·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.空安全註解或消除測試反模式(例如基於反射)測試或共享可變狀態。 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.空安全註解或消除測試反模式(例如基於反射)測試或共享可變狀態。 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.空安全註解或消除測試反模式(例如基於反射)測試或共享可變狀態。 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