[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6BXVP5QBEYCNWG56FFBBHZK":3,"skill-same:01M6BXVP5QBEYCNWG56FFBBHZK":72},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":43,"linkOnly":44,"markdownContent":45,"markdownBody":46,"frontMatter":47,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":51,"repositoryHtmlUrl":52,"repositoryHomepageUrl":53,"ownerHtmlUrl":54,"ownerBlogUrl":55,"ownerDescription":56,"updatedAt":57,"install":58,"resources":71},"01M6BXVP5QBEYCNWG56FFBBHZK","spring-integration-test-wiring","Spring Boot 集成测试依赖装配","Conventions for dependency injection and mocking in Spring Boot integration tests in this project. Use this whenever writing, reviewing, or refactoring integration test classes (anything annotated @SpringBootTest, or under src\u002Ftest that talks to a real Spring context), especially when deciding how to wire dependencies or mock collaborators. Also consult this before adding @Autowired, @MockBean, @MockitoBean, or field injection in any test class.","本项目中 Spring Boot 集成测试的依赖注入与 mock 约定。在编写、审查或重构集成测试类时（任何标注 @SpringBootTest 的类，或 src\u002Ftest 下与真实 Spring 上下文交互的类）使用，尤其是在决定如何装配依赖或 mock 协作者时。在任何测试类中添加 @Autowired、@MockBean、@MockitoBean 或字段注入之前，也应先参考本技能。","jesperancinha\u002Fkotlin-mysteries","jesperancinha","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F11569930?v=4","01M6BXV038GJ2R8FQNEPT7AVZC","João Filipe Sabino Esperancinha","01M6BXV07CCQXNTGXREN86RZBR",2,"Apache-2.0",null,"https:\u002F\u002Fgithub.com\u002Fjesperancinha\u002Fkotlin-mysteries\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fspring-test\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42],"test","integration","spring integration test wiring","writing","integration tests","boot","spring boot","injection","how","consult","refactoring","src","2026-11-10 10:12:30",false,"---\nname: spring-integration-test-wiring\ndescription: Conventions for dependency injection and mocking in Spring Boot integration tests in this project. Use this whenever writing, reviewing, or refactoring integration test classes (anything annotated @SpringBootTest, or under src\u002Ftest that talks to a real Spring context), especially when deciding how to wire dependencies or mock collaborators. Also consult this before adding @Autowired, @MockBean, @MockitoBean, or field injection in any test class.\n---\n\n# Spring Boot Integration Test Wiring for all projects with tests developed in Kotlin\n\nRules for how dependencies get injected and mocked in this project's integration tests. Apply these whenever creating a\nnew integration test class or reviewing\u002Fediting an existing one.\n\n## 1. Constructor injection only — no field injection (only for Kotlin files .kt)\n\nIntegration test classes must wire their dependencies through the constructor, never through `@Autowired` fields.\nThis skill applies to all modules and submodules of the whole project. This means that all tests made in Kotlin are a\nsubject of this skill. Only Kotlin files, the ones with the .kt extension should be subject to this change. No other\nfiles should be affected.\n\n**Do:**\n\n```kotlin\n@SpringBootTest\nclass JeorgActionAOPLauncherExtAOPTest @Autowired constructor(\n  private val bonitoCatcher: BonitoCatcher,\n  private val codCatcher: CodCatcher\n) {\n}\n```\n\n**Don't:**\n\n```kotlin\n@SpringBootTest\nclass JeorgActionAOPLauncherExtAOPTest() {\n\n    @Autowired\n    lateinit var bonitoCatcher: BonitoCatcher\n\n    @Autowired\n    lateinit var codCatcher: CodCatcher;\n}\n```\n\nNotes:\n\n- For every file with extension .kt that ends in IT or Test, make sure that if they need `@Autowire` annotated fields or\n  params, that they\n  get injected via the mentioned above `@Autowired constructor` pattern.\n- JUnit 5 + Spring's `TestConstructor` support allows constructor injection in test classes the same way it works in\n  production beans. If the project hasn't set `spring.test.constructor.autowire.mode=all` in\n  `application-test.properties` (or via `@TestConstructor(autowireMode = ALL)`), the constructor still needs an explicit\n  `@Autowired` annotation as shown above — include it only in the constructor and remove it from the fields, or the\n  injected params.\n- Keep injected fields `private val`.\n- If a test only needs one or two collaborators, still use the constructor — don't fall back to field injection \"just\n  for this one.\"\n- If the `@Autowired constructor` pattern is already in use, make sure that all injected params are `private val`, but\n  also remove `@Autowire` if they have it.\n- For all beans using any of the annotations `@MockitoBean`, `@MockBean`, `@SpyBean`, `@MockkBean`, `@MockkSpyBean`, or\n  others, and injected with `lateinit`, please put them with the correct annotation in the constructor as well\n\n## 2. Replace initMocks with OpenMocks\n\n### Example 1\n\nWhen finding this:\n\n```kotlin\ninitMocks(testRestTemplate)\n```\n\nReplace with:\n\n```kotlin\nopenMocks(testRestTemplate)\n```\n\nAlso replace imports from `import org.mockito.MockitoAnnotations.initMocks` to `import org.mockito.MockitoAnnotations.openMocks`\n\n## 3. Migrate `@MockBean` annotations\n\nThe annotation `@MockBean` is deprecated and its usage needs to be replaced by `@MockitoBean`\nThe annotation `@SpyBean` is deprecated and its usage needs to be replaced by `@MockitoSpyBean`\nThe above annotations should be updated in the same way following the examples bellow.\n\n### Example 1\n\nOn a class level, replace this:\n\n```java\n@MockBean(Planet.class)\nprivate MyService myService;\n```  \nwith this:\n\n```java\n@MockitoBean(types = Planet.class)\nprivate MyService myService;\n```\n\n### Example 2\n\nReplace also the usages of `import org.springframework.boot.test.mock.mockito.MockBean;` with `import org.springframework.test.context.bean.override.mockito.MockitoBean;`\n\n### Example 3\nThe beans that are declared are like this:\n\n```java\n@MockBean\nprivate BankCompanyBankRepository bankCompanyBankRepository;\n```\n\nshould be replaced to something like:\n\n```java\n@MockitoBean\nprivate BankCompanyBankRepository bankCompanyBankRepository;\n```\n\n## 4. MockMvc test upgrade for Sprin Boot 4.0.0\n\nPlease add:\n\n```xml\n\u003Cdependency>\n    \u003CgroupId>org.springframework.boot\u003C\u002FgroupId>\n    \u003CartifactId>spring-boot-starter-webmvc-test\u003C\u002FartifactId>\n    \u003Cscope>test\u003C\u002Fscope>\n\u003C\u002Fdependency>\n```\n\nas a dependency for projects that use `WebMvcTest`\n\nReplace the import: `import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest` to `org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest`\n\n\n## 5. MockKBean uses different syntax in recent MockK versions\n\nThe syntax is slightly changed in the latest Spring MocK versions.\n\n### Example 1\n\nChanges in `MockKBean`\n\nReplace `@MockkBean(classes = [DataSource::class])` with `@MockkBean(types = [DataSource::class])`\n\n## 6. There should be no integration\u002Funit\u002Fother tests creating entities with an assigned id\n\nCreating entities via JPA should assume the usage of an ID autogeneration engine.\nIt could be a sequence, or something else, like a counter, entity, or any other strategy\nIf creating an entity like this, somehow works and is used in the test, the test should be updated so that it does not use a fixed ID on the entity creation and persistence to the database.\n\nUpdates and other CRUD methods should be left as is. Only on creation should the above be considered.\n\n## 7. Test class checklist\n\nBefore submitting\u002Freviewing an integration test class, confirm:\n\n- [ ] All Spring-managed dependencies come in through the constructor\n- [ ] Constructor is annotated `@Autowired` (unless project-wide `TestConstructor` autowire mode is configured)\n- [ ] No `@Autowired` on fields\n- [ ] Use the new Spring configuration for security\n- [ ] New Spring versions don't use `AntPathRequestMatcher` anymore. Make sure none is used\n- [ ] No `@MockBean` or `@SpyBean` annotations are used. Use `@MockitoBean` or `@MockitoSpyBean` instead.\n- [ ] No `@MockkBean(classes = ` type of declarations left\n- [ ] No more usages of `import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest`\n","# Spring Boot Integration Test Wiring for all projects with tests developed in Kotlin\n\nRules for how dependencies get injected and mocked in this project's integration tests. Apply these whenever creating a\nnew integration test class or reviewing\u002Fediting an existing one.\n\n## 1. Constructor injection only — no field injection (only for Kotlin files .kt)\n\nIntegration test classes must wire their dependencies through the constructor, never through `@Autowired` fields.\nThis skill applies to all modules and submodules of the whole project. This means that all tests made in Kotlin are a\nsubject of this skill. Only Kotlin files, the ones with the .kt extension should be subject to this change. No other\nfiles should be affected.\n\n**Do:**\n\n```kotlin\n@SpringBootTest\nclass JeorgActionAOPLauncherExtAOPTest @Autowired constructor(\n  private val bonitoCatcher: BonitoCatcher,\n  private val codCatcher: CodCatcher\n) {\n}\n```\n\n**Don't:**\n\n```kotlin\n@SpringBootTest\nclass JeorgActionAOPLauncherExtAOPTest() {\n\n    @Autowired\n    lateinit var bonitoCatcher: BonitoCatcher\n\n    @Autowired\n    lateinit var codCatcher: CodCatcher;\n}\n```\n\nNotes:\n\n- For every file with extension .kt that ends in IT or Test, make sure that if they need `@Autowire` annotated fields or\n  params, that they\n  get injected via the mentioned above `@Autowired constructor` pattern.\n- JUnit 5 + Spring's `TestConstructor` support allows constructor injection in test classes the same way it works in\n  production beans. If the project hasn't set `spring.test.constructor.autowire.mode=all` in\n  `application-test.properties` (or via `@TestConstructor(autowireMode = ALL)`), the constructor still needs an explicit\n  `@Autowired` annotation as shown above — include it only in the constructor and remove it from the fields, or the\n  injected params.\n- Keep injected fields `private val`.\n- If a test only needs one or two collaborators, still use the constructor — don't fall back to field injection \"just\n  for this one.\"\n- If the `@Autowired constructor` pattern is already in use, make sure that all injected params are `private val`, but\n  also remove `@Autowire` if they have it.\n- For all beans using any of the annotations `@MockitoBean`, `@MockBean`, `@SpyBean`, `@MockkBean`, `@MockkSpyBean`, or\n  others, and injected with `lateinit`, please put them with the correct annotation in the constructor as well\n\n## 2. Replace initMocks with OpenMocks\n\n### Example 1\n\nWhen finding this:\n\n```kotlin\ninitMocks(testRestTemplate)\n```\n\nReplace with:\n\n```kotlin\nopenMocks(testRestTemplate)\n```\n\nAlso replace imports from `import org.mockito.MockitoAnnotations.initMocks` to `import org.mockito.MockitoAnnotations.openMocks`\n\n## 3. Migrate `@MockBean` annotations\n\nThe annotation `@MockBean` is deprecated and its usage needs to be replaced by `@MockitoBean`\nThe annotation `@SpyBean` is deprecated and its usage needs to be replaced by `@MockitoSpyBean`\nThe above annotations should be updated in the same way following the examples bellow.\n\n### Example 1\n\nOn a class level, replace this:\n\n```java\n@MockBean(Planet.class)\nprivate MyService myService;\n```  \nwith this:\n\n```java\n@MockitoBean(types = Planet.class)\nprivate MyService myService;\n```\n\n### Example 2\n\nReplace also the usages of `import org.springframework.boot.test.mock.mockito.MockBean;` with `import org.springframework.test.context.bean.override.mockito.MockitoBean;`\n\n### Example 3\nThe beans that are declared are like this:\n\n```java\n@MockBean\nprivate BankCompanyBankRepository bankCompanyBankRepository;\n```\n\nshould be replaced to something like:\n\n```java\n@MockitoBean\nprivate BankCompanyBankRepository bankCompanyBankRepository;\n```\n\n## 4. MockMvc test upgrade for Sprin Boot 4.0.0\n\nPlease add:\n\n```xml\n\u003Cdependency>\n    \u003CgroupId>org.springframework.boot\u003C\u002FgroupId>\n    \u003CartifactId>spring-boot-starter-webmvc-test\u003C\u002FartifactId>\n    \u003Cscope>test\u003C\u002Fscope>\n\u003C\u002Fdependency>\n```\n\nas a dependency for projects that use `WebMvcTest`\n\nReplace the import: `import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest` to `org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest`\n\n\n## 5. MockKBean uses different syntax in recent MockK versions\n\nThe syntax is slightly changed in the latest Spring MocK versions.\n\n### Example 1\n\nChanges in `MockKBean`\n\nReplace `@MockkBean(classes = [DataSource::class])` with `@MockkBean(types = [DataSource::class])`\n\n## 6. There should be no integration\u002Funit\u002Fother tests creating entities with an assigned id\n\nCreating entities via JPA should assume the usage of an ID autogeneration engine.\nIt could be a sequence, or something else, like a counter, entity, or any other strategy\nIf creating an entity like this, somehow works and is used in the test, the test should be updated so that it does not use a fixed ID on the entity creation and persistence to the database.\n\nUpdates and other CRUD methods should be left as is. Only on creation should the above be considered.\n\n## 7. Test class checklist\n\nBefore submitting\u002Freviewing an integration test class, confirm:\n\n- [ ] All Spring-managed dependencies come in through the constructor\n- [ ] Constructor is annotated `@Autowired` (unless project-wide `TestConstructor` autowire mode is configured)\n- [ ] No `@Autowired` on fields\n- [ ] Use the new Spring configuration for security\n- [ ] New Spring versions don't use `AntPathRequestMatcher` anymore. Make sure none is used\n- [ ] No `@MockBean` or `@SpyBean` annotations are used. Use `@MockitoBean` or `@MockitoSpyBean` instead.\n- [ ] No `@MockkBean(classes = ` type of declarations left\n- [ ] No more usages of `import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest`\n",{"name":5,"description":7},"main","697d8147950c43487405f9593abb95dc5dc7aabe",".claude\u002Fskills\u002Fspring-test",0,"https:\u002F\u002Fgithub.com\u002Fjesperancinha\u002Fkotlin-mysteries","https:\u002F\u002Fjesperancinha.github.io\u002Fkotlin-mysteries\u002F","https:\u002F\u002Fgithub.com\u002Fjesperancinha","http:\u002F\u002Fjoaofilipesabinoesperancinha.nl\u002F","IT Engineer","2026-07-20 17:47:29",{"source":9,"skillName":5,"commands":59,"prompt":69,"zipAvailable":70},[60,63,66],{"tool":61,"command":62},"npx","npx skills add jesperancinha\u002Fkotlin-mysteries --skill spring-integration-test-wiring",{"tool":64,"command":65},"bunx","bunx skills add jesperancinha\u002Fkotlin-mysteries --skill spring-integration-test-wiring",{"tool":67,"command":68},"pnpm","pnpm dlx skills add jesperancinha\u002Fkotlin-mysteries --skill spring-integration-test-wiring","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjesperancinha\u002Fkotlin-mysteries\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fspring-test\u002FSKILL.md",true,[],[73,84,99,114,127,140],{"skillNo":74,"name":75,"nameZh":76,"description":77,"descriptionZh":78,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":79,"categories":80,"keywords":83,"publishedAt":43},"01M6BXVS2Q1EJRCHG37A671S8K","spring","Spring Boot 依赖注入与 Mock 规范","Conventions for dependency injection and mocking in Spring Boot in this project. Use this whenever writing, reviewing, or refactoring integration test classes (anything annotated @SpringBootTest, or under src\u002Ftest that talks to a real Spring context), especially when deciding how to wire dependencies or mock collaborators. Also consult this before adding @Autowired, @MockBean, @MockitoBean, or field injection in any test class.","本项目中 Spring Boot 的依赖注入与 mock 约定。在编写、审查或重构集成测试类时（任何标注 @SpringBootTest 的类，或 src\u002Ftest 下与真实 Spring 上下文交互的类）使用，尤其是在决定如何装配依赖或 mock 协作者时。在任何测试类中添加 @Autowired、@MockBean、@MockitoBean 或字段注入之前，也应先参考本技能。","https:\u002F\u002Fgithub.com\u002Fjesperancinha\u002Fkotlin-mysteries\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fspring\u002FSKILL.md",[81,82],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[75,34,31,36,37,32,38,39,40,41,42],{"skillNo":85,"name":86,"nameZh":87,"description":88,"descriptionZh":89,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":90,"categories":91,"keywords":96,"publishedAt":43},"01M6BXVM9KDEWYJ7WWJSTA22GR","Scripts patterns","Shell 与 Python 脚本规范","Conventions for using sh, bash, bat, python scripts","使用 sh、bash、bat、python 脚本时应遵循的约定。","https:\u002F\u002Fgithub.com\u002Fjesperancinha\u002Fkotlin-mysteries\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fscripts\u002FSKILL.md",[92,93],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":94,"categoryName":95,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSTR9G4A4GZ0VB2DFN9490","开发环境与工具链管理",[86,97,98],"python","Bash",{"skillNo":100,"name":101,"nameZh":102,"description":103,"descriptionZh":104,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":105,"categories":106,"keywords":113,"publishedAt":43},"01M6BXVJETCKANCGG2ZVJJVWYN","Readme standards","README 文档编写规范","Conventions to use in Readme files","README 文件中应遵循的约定规范。","https:\u002F\u002Fgithub.com\u002Fjesperancinha\u002Fkotlin-mysteries\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Freadme\u002FSKILL.md",[107,110],{"categoryNo":108,"categoryName":109,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BVB0FJ0RR8KXYVFTKEA3XX","技术文档工程师",{"categoryNo":111,"categoryName":112,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C5C7NGT4DWWBE15R6QGEX5","技术文档编写",[101],{"skillNo":115,"name":116,"nameZh":117,"description":118,"descriptionZh":119,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":120,"categories":121,"keywords":126,"publishedAt":43},"01M6BXVGR52RYGR5R2A4N4C3SE","parallelization","Jupiter 测试并行化","Conventions for using parallelization in all tests using Jupiter","在所有使用 Jupiter 的测试中使用并行化的约定。","https:\u002F\u002Fgithub.com\u002Fjesperancinha\u002Fkotlin-mysteries\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fparallel\u002FSKILL.md",[122,125],{"categoryNo":123,"categoryName":124,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD5WG86P4AQ5GPSSKBFR","测试工程师",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[116],{"skillNo":128,"name":129,"nameZh":130,"description":131,"descriptionZh":132,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":133,"categories":134,"keywords":137,"publishedAt":43},"01M6BXVEP33NG1YREVBDF5R3TN","Maven standards","Maven pom.xml 配置规范","Conventions to use in Maven files, mostly the `pom.xml` files","在 Maven 文件中（主要是 `pom.xml` 文件）使用的约定。","https:\u002F\u002Fgithub.com\u002Fjesperancinha\u002Fkotlin-mysteries\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fmaven\u002FSKILL.md",[135,136],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":94,"categoryName":95,"taxonomyType":28,"taxonomyTypeDesc":29},[129,138,139],"maven","xml",{"skillNo":141,"name":142,"nameZh":143,"description":144,"descriptionZh":145,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":146,"categories":147,"keywords":152,"publishedAt":43},"01M6BXVCG904KP6JBVVXVR01CN","kotlin patterns","Kotlin 编码规范","Conventions for using Kotlin","使用 Kotlin 的约定。","https:\u002F\u002Fgithub.com\u002Fjesperancinha\u002Fkotlin-mysteries\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fkotlin\u002FSKILL.md",[148,149],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":150,"categoryName":151,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BT7QVANT4709358VEJK53E","代码实现",[153,142],"kotlin"]