{"id":"1f0dfa32-bffc-4fff-af86-96540c20dbeb","shortId":"X96sf6","kind":"skill","title":"322-frameworks-spring-boot-testing-integration-tests","tagline":"Use when you need to write or improve integration tests — including Testcontainers with @ServiceConnection, @DataJdbcTest persistence slices, TestRestTemplate or MockMvcTester for HTTP, data isolation, and container lifecycle management for Spring Boot 4.0.x. This should trigger ","description":"# Spring Boot Integration Testing\n\nApply Spring Boot integration testing guidelines for Spring Boot 4.0.x.\n\n**What is covered in this Skill?**\n\n- Integration test scope and purpose (verify wiring and contracts, not unit-test duplication)\n- Testcontainers with @ServiceConnection for zero-config wiring (preferred)\n- @DynamicPropertySource as fallback for containers without built-in service connection support\n- Static @Container instances shared across test methods for performance\n- MockMvcTester for fluent AssertJ-based HTTP assertions (Spring Boot 4.0.x)\n- TestRestTemplate for full HTTP stack testing\n- @DataJdbcTest / @DataJpaTest persistence slices (load only persistence layer, start faster)\n- Data isolation: each test owns its scenario; no shared mutable state or ordering assumptions\n- @MockitoBean for mock registration (Spring Boot 4.0.x — @MockBean removed)\n- Resource lifecycle: Testcontainers JUnit integration for teardown; *IT / integration test separation\n\n**Scope:** Apply recommendations based on the reference rules and good/bad code examples.\n\n## Constraints\n\nBefore applying any integration test changes, ensure the project compiles. If compilation fails, stop immediately. After applying improvements, run full verification.\n\n- **MANDATORY**: Run `./mvnw compile` or `mvn compile` before applying any change\n- **SAFETY**: If compilation fails, stop immediately\n- **VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after applying improvements\n- **BEFORE APPLYING**: Read the reference for detailed rules and good/bad patterns\n- **EDGE CASE**: If request scope is ambiguous, stop and ask a clarifying question before applying changes\n- **EDGE CASE**: If required inputs, files, or tooling are missing, report what is missing and ask whether to proceed with setup guidance\n\n## When to use this skill\n\n- Review Java code for Spring Boot integration tests\n- Apply best practices for Spring Boot integration tests in Java code\n\n## Workflow\n\n1. **Read reference and assess project context**\n\nRead `references/322-frameworks-spring-boot-testing-integration-tests.md` and inspect the current project setup before proposing changes.\n\n2. **Gather scope and decide target improvements**\n\nIdentify requested outcomes, constraints, and the minimum safe set of changes to apply.\n\n3. **Apply framework-aligned changes**\n\nImplement or refactor configuration/code following the reference patterns and project conventions.\n\n4. **Run verification and report results**\n\nExecute appropriate build/tests and summarize what changed, what was verified, and any follow-up actions.\n\n## Reference\n\nFor detailed guidance, examples, and constraints, see [references/322-frameworks-spring-boot-testing-integration-tests.md](references/322-frameworks-spring-boot-testing-integration-tests.md).","tags":["322","frameworks","spring","boot","testing","integration","tests","cursor","rules","java","jabrena","agent-skills"],"capabilities":["skill","source-jabrena","skill-322-frameworks-spring-boot-testing-integration-tests","topic-agent-skills","topic-ai-skills","topic-claude","topic-claude-code","topic-claude-code-skills","topic-claude-code-subagents","topic-claude-skills","topic-cursor-agent","topic-cursor-ai","topic-cursor-skills","topic-cursorai","topic-github-copilot"],"categories":["cursor-rules-java"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/jabrena/cursor-rules-java/322-frameworks-spring-boot-testing-integration-tests","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add jabrena/cursor-rules-java","source_repo":"https://github.com/jabrena/cursor-rules-java","install_from":"skills.sh"}},"qualityScore":"0.631","qualityRationale":"deterministic score 0.63 from registry signals: · indexed on github topic:agent-skills · 362 github stars · SKILL.md body (2,796 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-26T12:53:37.422Z","embedding":null,"createdAt":"2026-04-18T22:02:16.407Z","updatedAt":"2026-04-26T12:53:37.422Z","lastSeenAt":"2026-04-26T12:53:37.422Z","tsv":"'/mvnw':209,226 '1':310 '2':328 '3':348 '322':1 '4':365 '4.0':40,58,120,158 'across':105 'action':386 'align':352 'ambigu':253 'appli':49,174,187,202,215,234,237,261,298,347,349 'appropri':372 'ask':256,278 'assert':117 'assertj':114 'assertj-bas':113 'assess':314 'assumpt':151 'base':115,176 'best':299 'boot':5,39,46,51,57,119,157,295,303 'build/tests':373 'built':96 'built-in':95 'case':248,264 'chang':191,217,262,327,345,353,377 'clarifi':258 'clean':227,231 'code':183,292,308 'compil':195,197,210,213,220 'config':86 'configuration/code':357 'connect':99 'constraint':185,338,393 'contain':34,93,102 'context':316 'contract':74 'convent':364 'cover':62 'current':322 'data':31,138 'datajdbctest':23,128 'datajpatest':129 'decid':332 'detail':242,389 'duplic':79 'dynamicpropertysourc':89 'edg':247,263 'ensur':192 'exampl':184,391 'execut':371 'fail':198,221 'fallback':91 'faster':137 'file':268 'fluent':112 'follow':358,384 'follow-up':383 'framework':3,351 'framework-align':350 'frameworks-spring-boot-testing-integration-test':2 'full':124,205 'gather':329 'good/bad':182,245 'guidanc':284,390 'guidelin':54 'http':30,116,125 'identifi':335 'immedi':200,223 'implement':354 'improv':16,203,235,334 'includ':19 'input':267 'inspect':320 'instanc':103 'integr':7,17,47,52,66,166,170,189,296,304 'isol':32,139 'java':291,307 'junit':165 'layer':135 'lifecycl':35,163 'load':132 'manag':36 'mandatori':207 'method':107 'minimum':341 'miss':272,276 'mock':154 'mockbean':160 'mockitobean':152 'mockmvctest':28,110 'mutabl':147 'mvn':212,230 'need':12 'order':150 'outcom':337 'own':142 'pattern':246,361 'perform':109 'persist':24,130,134 'practic':300 'prefer':88 'proceed':281 'project':194,315,323,363 'propos':326 'purpos':70 'question':259 'read':238,311,317 'recommend':175 'refactor':356 'refer':179,240,312,360,387 'references/322-frameworks-spring-boot-testing-integration-tests.md':318,395,396 'registr':155 'remov':161 'report':273,369 'request':250,336 'requir':266 'resourc':162 'result':370 'review':290 'rule':180,243 'run':204,208,225,366 'safe':342 'safeti':218 'scenario':144 'scope':68,173,251,330 'see':394 'separ':172 'servic':98 'serviceconnect':22,82 'set':343 'setup':283,324 'share':104,146 'skill':65,289 'skill-322-frameworks-spring-boot-testing-integration-tests' 'slice':25,131 'source-jabrena' 'spring':4,38,45,50,56,118,156,294,302 'stack':126 'start':136 'state':148 'static':101 'stop':199,222,254 'summar':375 'support':100 'target':333 'teardown':168 'test':6,8,18,48,53,67,78,106,127,141,171,190,297,305 'testcontain':20,80,164 'testresttempl':26,122 'tool':270 'topic-agent-skills' 'topic-ai-skills' 'topic-claude' 'topic-claude-code' 'topic-claude-code-skills' 'topic-claude-code-subagents' 'topic-claude-skills' 'topic-cursor-agent' 'topic-cursor-ai' 'topic-cursor-skills' 'topic-cursorai' 'topic-github-copilot' 'trigger':44 'unit':77 'unit-test':76 'use':9,287 'verif':206,367 'verifi':71,224,228,232,380 'whether':279 'wire':72,87 'without':94 'workflow':309 'write':14 'x':41,59,121,159 'zero':85 'zero-config':84","prices":[{"id":"6e7fcaa9-f476-42aa-981f-3bc22588dcb9","listingId":"1f0dfa32-bffc-4fff-af86-96540c20dbeb","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"jabrena","category":"cursor-rules-java","install_from":"skills.sh"},"createdAt":"2026-04-18T22:02:16.407Z"}],"sources":[{"listingId":"1f0dfa32-bffc-4fff-af86-96540c20dbeb","source":"github","sourceId":"jabrena/cursor-rules-java/322-frameworks-spring-boot-testing-integration-tests","sourceUrl":"https://github.com/jabrena/cursor-rules-java/tree/main/skills/322-frameworks-spring-boot-testing-integration-tests","isPrimary":false,"firstSeenAt":"2026-04-18T22:02:16.407Z","lastSeenAt":"2026-04-26T12:53:37.422Z"}],"details":{"listingId":"1f0dfa32-bffc-4fff-af86-96540c20dbeb","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"jabrena","slug":"322-frameworks-spring-boot-testing-integration-tests","github":{"repo":"jabrena/cursor-rules-java","stars":362,"topics":["agent-skills","ai-skills","claude","claude-code","claude-code-skills","claude-code-subagents","claude-skills","cursor-agent","cursor-ai","cursor-skills","cursorai","github-copilot","intellij-idea","java","prompting","system-prompts"],"license":"apache-2.0","html_url":"https://github.com/jabrena/cursor-rules-java","pushed_at":"2026-04-26T12:50:01Z","description":"A curated and opinionated collection of Skills and Agents to be used in modern SDLC workflows for Java Enterprise development with your favorite AI Agent harness.","skill_md_sha":"080f1726aa00e53cdcbff9dfc576d38cbae915f3","skill_md_path":"skills/322-frameworks-spring-boot-testing-integration-tests/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/jabrena/cursor-rules-java/tree/main/skills/322-frameworks-spring-boot-testing-integration-tests"},"layout":"multi","source":"github","category":"cursor-rules-java","frontmatter":{"name":"322-frameworks-spring-boot-testing-integration-tests","license":"Apache-2.0","description":"Use when you need to write or improve integration tests — including Testcontainers with @ServiceConnection, @DataJdbcTest persistence slices, TestRestTemplate or MockMvcTester for HTTP, data isolation, and container lifecycle management for Spring Boot 4.0.x. This should trigger for requests such as Review Java code for Spring Boot integration tests; Apply best practices for Spring Boot integration tests in Java code. Part of cursor-rules-java project"},"skills_sh_url":"https://skills.sh/jabrena/cursor-rules-java/322-frameworks-spring-boot-testing-integration-tests"},"updatedAt":"2026-04-26T12:53:37.422Z"}}