[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6F4S0BCKBQAJWKCEPXCG30K":3,"skill-same:01M6F4S0BCKBQAJWKCEPXCG30K":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":42,"repositoryHtmlUrl":43,"repositoryHomepageUrl":44,"ownerHtmlUrl":45,"ownerBlogUrl":6,"ownerDescription":46,"updatedAt":47,"install":48,"resources":61},"01M6F4S0BCKBQAJWKCEPXCG30K","java-junit",null,"Get best practices for JUnit 5 unit testing, including data-driven tests","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fgithub\u002Fawesome-copilot\u002Fjava-junit\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33],"java","java junit","testing","best practices","data","unit testing","get","tests","driven","unit","2026-11-10 10:12:30",false,"---\nname: java-junit\ndescription: 'Get best practices for JUnit 5 unit testing, including data-driven tests'\n---\n\n# JUnit 5+ Best Practices\n\nYour goal is to help me write effective unit tests with JUnit 5, covering both standard and data-driven testing approaches.\n\n## Project Setup\n\n- Use a standard Maven or Gradle project structure.\n- Place test source code in `src\u002Ftest\u002Fjava`.\n- Include dependencies for `junit-jupiter-api`, `junit-jupiter-engine`, and `junit-jupiter-params` for parameterized tests.\n- Use build tool commands to run tests: `mvn test` or `gradle test`.\n\n## Test Structure\n\n- Test classes should have a `Test` suffix, e.g., `CalculatorTest` for a `Calculator` class.\n- Use `@Test` for test methods.\n- Follow the Arrange-Act-Assert (AAA) pattern.\n- Name tests using a descriptive convention, like `methodName_should_expectedBehavior_when_scenario`.\n- Use `@BeforeEach` and `@AfterEach` for per-test setup and teardown.\n- Use `@BeforeAll` and `@AfterAll` for per-class setup and teardown (must be static methods).\n- Use `@DisplayName` to provide a human-readable name for test classes and methods.\n\n## Standard Tests\n\n- Keep tests focused on a single behavior.\n- Avoid testing multiple conditions in one test method.\n- Make tests independent and idempotent (can run in any order).\n- Avoid test interdependencies.\n\n## Data-Driven (Parameterized) Tests\n\n- Use `@ParameterizedTest` to mark a method as a parameterized test.\n- Use `@ValueSource` for simple literal values (strings, ints, etc.).\n- Use `@MethodSource` to refer to a factory method that provides test arguments as a `Stream`, `Collection`, etc.\n- Use `@CsvSource` for inline comma-separated values.\n- Use `@CsvFileSource` to use a CSV file from the classpath.\n- Use `@EnumSource` to use enum constants.\n\n## Assertions\n\n- Use the static methods from `org.junit.jupiter.api.Assertions` (e.g., `assertEquals`, `assertTrue`, `assertNotNull`).\n- For more fluent and readable assertions, consider using a library like AssertJ (`assertThat(...).is...`).\n- Use `assertThrows` or `assertDoesNotThrow` to test for exceptions.\n- Group related assertions with `assertAll` to ensure all assertions are checked before the test fails.\n- Use descriptive messages in assertions to provide clarity on failure.\n\n## Mocking and Isolation\n\n- Use a mocking framework like Mockito to create mock objects for dependencies.\n- Use `@Mock` and `@InjectMocks` annotations from Mockito to simplify mock creation and injection.\n- Use interfaces to facilitate mocking.\n\n## Test Organization\n\n- Group tests by feature or component using packages.\n- Use `@Tag` to categorize tests (e.g., `@Tag(\"fast\")`, `@Tag(\"integration\")`).\n- Use `@TestMethodOrder(MethodOrderer.OrderAnnotation.class)` and `@Order` to control test execution order when strictly necessary.\n- Use `@Disabled` to temporarily skip a test method or class, providing a reason.\n- Use `@Nested` to group tests in a nested inner class for better organization and structure.\n\n","# JUnit 5+ Best Practices\n\nYour goal is to help me write effective unit tests with JUnit 5, covering both standard and data-driven testing approaches.\n\n## Project Setup\n\n- Use a standard Maven or Gradle project structure.\n- Place test source code in `src\u002Ftest\u002Fjava`.\n- Include dependencies for `junit-jupiter-api`, `junit-jupiter-engine`, and `junit-jupiter-params` for parameterized tests.\n- Use build tool commands to run tests: `mvn test` or `gradle test`.\n\n## Test Structure\n\n- Test classes should have a `Test` suffix, e.g., `CalculatorTest` for a `Calculator` class.\n- Use `@Test` for test methods.\n- Follow the Arrange-Act-Assert (AAA) pattern.\n- Name tests using a descriptive convention, like `methodName_should_expectedBehavior_when_scenario`.\n- Use `@BeforeEach` and `@AfterEach` for per-test setup and teardown.\n- Use `@BeforeAll` and `@AfterAll` for per-class setup and teardown (must be static methods).\n- Use `@DisplayName` to provide a human-readable name for test classes and methods.\n\n## Standard Tests\n\n- Keep tests focused on a single behavior.\n- Avoid testing multiple conditions in one test method.\n- Make tests independent and idempotent (can run in any order).\n- Avoid test interdependencies.\n\n## Data-Driven (Parameterized) Tests\n\n- Use `@ParameterizedTest` to mark a method as a parameterized test.\n- Use `@ValueSource` for simple literal values (strings, ints, etc.).\n- Use `@MethodSource` to refer to a factory method that provides test arguments as a `Stream`, `Collection`, etc.\n- Use `@CsvSource` for inline comma-separated values.\n- Use `@CsvFileSource` to use a CSV file from the classpath.\n- Use `@EnumSource` to use enum constants.\n\n## Assertions\n\n- Use the static methods from `org.junit.jupiter.api.Assertions` (e.g., `assertEquals`, `assertTrue`, `assertNotNull`).\n- For more fluent and readable assertions, consider using a library like AssertJ (`assertThat(...).is...`).\n- Use `assertThrows` or `assertDoesNotThrow` to test for exceptions.\n- Group related assertions with `assertAll` to ensure all assertions are checked before the test fails.\n- Use descriptive messages in assertions to provide clarity on failure.\n\n## Mocking and Isolation\n\n- Use a mocking framework like Mockito to create mock objects for dependencies.\n- Use `@Mock` and `@InjectMocks` annotations from Mockito to simplify mock creation and injection.\n- Use interfaces to facilitate mocking.\n\n## Test Organization\n\n- Group tests by feature or component using packages.\n- Use `@Tag` to categorize tests (e.g., `@Tag(\"fast\")`, `@Tag(\"integration\")`).\n- Use `@TestMethodOrder(MethodOrderer.OrderAnnotation.class)` and `@Order` to control test execution order when strictly necessary.\n- Use `@Disabled` to temporarily skip a test method or class, providing a reason.\n- Use `@Nested` to group tests in a nested inner class for better organization and structure.\n\n",{"name":5,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fgithub\u002Fawesome-copilot\u002Fjava-junit",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill java-junit",{"tool":54,"command":55},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill java-junit",{"tool":57,"command":58},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill java-junit","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fgithub\u002Fawesome-copilot\u002Fjava-junit\u002FSKILL.md",true,[],[63,75,85,94,100,107],{"skillNo":64,"name":65,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":71,"publishedAt":34},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[68],{"categoryNo":69,"categoryName":70,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[72,73,74],"model","model hierarchy","model hierarchy skill",{"skillNo":76,"name":77,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":81,"publishedAt":34},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[80],{"categoryNo":69,"categoryName":70,"taxonomyType":21,"taxonomyTypeDesc":22},[82,83,84],"MCP","zoom","zoom mcp",{"skillNo":86,"name":87,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":34},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[91,92,93,83],"sdk","zoom apps sdk","apps",{"skillNo":95,"name":96,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":34},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[96],{"skillNo":101,"name":102,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":106,"publishedAt":34},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[105],{"categoryNo":69,"categoryName":70,"taxonomyType":21,"taxonomyTypeDesc":22},[102],{"skillNo":108,"name":109,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":34},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[109]]