Skillshub spring-boot-testing
Standards for unit, integration, and slice testing in Spring Boot 3. Use when writing unit tests, integration tests, or slice tests for Spring Boot 3 applications. (triggers: **/*Test.java, webmvctest, datajpatest, testcontainers, assertj)
install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/HoangNguyen0403/agent-skills-standard/spring-boot-testing" ~/.claude/skills/comeonoliver-skillshub-spring-boot-testing && rm -rf "$T"
manifest:
skills/HoangNguyen0403/agent-skills-standard/spring-boot-testing/SKILL.mdsource content
Spring Boot Testing Standards
Priority: P0
Implementation Guidelines
TDD Workflow
- Red: Write a failing test (e.g.,
).returns 404 - Green: Implement minimal code to pass.
- Refactor: Clean up while keeping tests green.
- Coverage: Verify with JaCoCo.
Best Practices
- Real Infrastructure: Use Testcontainers for DB/Queues. See Integration Template. Avoid H2/Embedded.
- Assertions: Use AssertJ (
) over JUnit assertions.assertThat - Isolation: Use
for downstream dependencies in Slice Tests.@MockBean
Anti-Patterns
- No Dirty Contexts: Avoid @MockBean in base classes; it reloads context per test.
- No network I/O in tests: Mock external calls with WireMock.
- No System.out in tests: Use AssertJ assertions instead.