Provides Spring Boot 4.1 test templates for service-edge integration tests: WireMock HTTP clients, Kafka/RabbitMQ listeners, Testcontainers, and property-based domain logic tests.
Ships in springboot-architecture. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use this for tests where the framework, not the logic, decides whether the test proves anything: calls and messages between services, retries, timeouts, transactions, and Boot 4 test wiring. For domain logic, see "Domain rules as properties". For other plain unit tests you need nothing here beyond the rules.
traps.md.UnusedCodeTests fails on a method only tests call. Changing the code for a test is right when it also improves the design, such as taking a Clock or a client through the constructor instead of creating it.Read ../code-reviewer/references/testing/traps.md: the Boot 4.1 / Framework 7 / Spring Kafka 4 traps found by running these templates (@Retryable behind an interface proxy, @RestClientTest ignoring timeouts, Apache HttpClient retrying 503, blocked partitions, corrupted dead letters, single-batch topic reads), and the Testcontainers and test-data traps.
Imports, starters and PIT: ../code-reviewer/references/testing/boot4-test-toolkit.md.
Take the mechanics (annotations, wiring, stubbing, polling) from them; take the cases from rule 1, not from the template.
| Edge | Template |
|---|---|
| Outbound HTTP client: request, 4xx, 5xx, retries, timeout, unusable answers | assets/http-client-wiremock-test.java |
| Message listener: state change, redelivery, poison and non-JSON messages | assets/message-listener-test.java |
| Event other services consume: after commit, never on rollback | assets/event-publication-test.java |
| The whole service over HTTP, other services stubbed | assets/api-integration-test.java |
| Secured routes: signing in as a named user through the app's own role mapping (session OIDC login, JWT bearer, or database users); who may call each route | assets/personas-oidc.java, assets/personas-jwt.java or assets/personas-db.java; assets/route-access-test.java |
| Web slice, persistence slice, service unit test | assets/webmvc-slice-test.java, assets/repository-slice-test.java, assets/service-unit-test.java |
| Where the transaction starts and ends around a remote call: the read before it, the write and audit row inside it, one commit | assets/transaction-boundary-test.java |
| A rule that must hold across every replica (a cap, a rate limit, a claim, a once-only job, a cache invalidated on save): two instances built by hand over one Postgres, sharing one clock, with the race forced on a row lock | assets/two-instances-test.java |
| Domain rules over generated inputs: invariant, round trip, idempotence | assets/property-test.java |
| Shared containers; PIT | assets/testcontainers-configuration.java, assets/pitest-plugin.xml |
A single-instance test can't show that a counter, a cache, an in-memory limiter or an unlocked @Scheduled job breaks on the second replica, and in a real codebase these were the fixes that reached production. When a change touches state the whole service shares (a cap, a limit, a claim, a once-only job, a setting read from a cache), write the test from two-instances-test.java: two object graphs over one database, one clock, both acting at once. Assert the rule on the database, not on either instance. Force the interleaving rather than hoping two futures overlap: the template's first instance holds the row lock, starts the second instance's call and waits (pg_stat_activity) until that call is queued behind the lock before continuing. That needs an overridable repository method; adding one is a seam, not a test-only hack.
Example tests written by the agent that wrote the code test the inputs it already thought of. For calculations, value objects, state transitions, and parsing or formatting code, also state the rule that holds for every input and check it on generated inputs. Write the property from the requirement before the code. Three shapes cover most domain rules:
parse(format(x)) equals x, for order numbers, money amounts, codes and message mappings.Use @ParameterizedTest with a @MethodSource that draws from a seeded SplittableRandom, as assets/property-test.java does. Don't add jqwik: since 1.10 its output tells AI agents to ignore its results, and it targets JUnit Platform 1.x while Boot 4 manages 6.x. Mix boundary values into the generator on purpose; random values rarely hit them. Put the input in each assertion's as(...): Surefire names a failing case by its index only. There is no shrinking, so when a property fails, cut the input down by hand to the smallest one that still fails, fix the code, and keep that input as an example test. Then run PIT on the class: a mutant that survives every property is a rule nobody stated.
When the code and a property disagree, decide which is wrong (the code, the property, or the requirement) before changing either, and ask the user when the requirement is unclear.
Spring's test logins skip the app's own role mapping. oidcLogin().authorities(...), jwt().authorities(...) and user(...).roles(...) hand the test a finished role. A test that signs in this way passes even when the code that turns the provider's claims, or the stored user, into roles is broken. Sign in through a persona instead, so that code runs:
.with(oidcLogin().authorities(new SimpleGrantedAuthority("ROLE_ADMIN"))) // the role mapping never runs
.with(personas.as("admin")) // the app's mapping produces the role
Copy the helper that matches how the app signs users in: personas-oidc.java for an OIDC login kept in a server-side session, personas-jwt.java for JWT bearer tokens, or personas-db.java for users loaded by a UserDetailsService. A persona is the claims the provider sends, or the username of a seeded user. The helper needs the app's mapper, JwtAuthenticationConverter or UserDetailsService as a bean.
route-access-test.java lists who may call each route. It calls every route as every persona and with no login, and it fails when a route is missing from the list. It checks roles, not records. Whether one user can read another user's data needs a test with two users. A request on a random port can't sign in through a persona, so test secured routes through @AutoConfigureMockMvc.
List the tests added (behavior and level), how each was shown to fail, tests that fail on the current code with the contract clause they rely on, and contract clauses left untested.
assets/api-integration-test.java (opens in a new tab)assets/event-publication-test.java (opens in a new tab)assets/http-client-wiremock-test.java (opens in a new tab)assets/message-listener-test.java (opens in a new tab)assets/personas-db.java (opens in a new tab)assets/personas-jwt.java (opens in a new tab)assets/personas-oidc.java (opens in a new tab)assets/pitest-plugin.xml (opens in a new tab)assets/property-test.java (opens in a new tab)assets/repository-slice-test.java (opens in a new tab)assets/route-access-test.java (opens in a new tab)assets/service-unit-test.java (opens in a new tab)assets/testcontainers-configuration.java (opens in a new tab)assets/transaction-boundary-test.java (opens in a new tab)assets/two-instances-test.java (opens in a new tab)assets/webmvc-slice-test.java (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
5 skills in this plugin
/code-reviewerUse when asked to review, check or diagnose Spring Boot code: a pull request, diff, module or file before it merges; a slow endpoint or query (N+1, unbounded reads, JPA and Hibernate performance); security, JSpecify null-safety, architecture boundaries or Boot 4 migration risks in existing code; or whether the tests would catch real bugs, proving each finding by running it. Not for Kotlin-only code, non-Spring frameworks, or generic review advice without code context./creating-springboot-projectsUse when starting a new Spring Boot project or service: scaffolding or bootstrapping a backend, REST API, microservice or modular monolith; choosing how to structure it (layered, package-by-module, modular monolith, tomato, DDD-hexagonal); selecting Spring Boot 4 features; generating the base project with progen or Spring Initializr; or applying the bundled templates and references in this skill. Not for migrating existing projects or for isolated JPA/repository work without broader project-creation context./springboot-migrationUse when upgrading an existing Spring Boot application, for example from Boot 3.x to Boot 4 or to the latest Spring Boot and Java: dependency transitions and starter renames, test annotations such as @MockBean to @MockitoBean, Jackson 3 issues, Spring Modulith 2 or Testcontainers 2 upgrades, code that stops compiling after a version bump, or planning a phased migration. Not for greenfield project creation or isolated repository design./springboot-architecture:writing-springboot-testsfrom springboot-architecture
npx claudepluginhub a-pavithraa/springboot-skills-marketplace --plugin springboot-architectureOther plugins' skills for the same job