Skip to content
AITroveRead. Build. Understand.
Make this comfortable

Spring release tests: distinguish context checks from process and platform checks

Last updated: 30 Sept 20264 min read
tutorial
IntermediateBy AITrove Editorial

A Spring context test proves bean behavior inside one process; it cannot by itself prove process signals, ingress routing or external transport.

Download Spring source kit

Write the test at the failing layer

For a configuration import, a non-web context is enough to check a missing local file. For RELAY_BATCHSIZE supplied by the OS, launch a child process with that environment. For graceful shutdown, terminate the packaged server with the normal signal while a request is active. For routing drain, place the same artifact behind the intended ingress and measure the last admitted request.

The general test guide separates unit, context and HTTP coverage. The current kit already has local HTTP health tests, config-import tests, staged H2 migration tests and outbox claim tests. These are evidence for their named local boundaries, not a production release rehearsal.

Capture state after failure

Do not stop at a response code. Read the receipt row, outbox row, replay key and migration history after each injected cut point. A lost response can follow a successful commit; an interrupted worker can leave a lease that another instance later claims. The relay trace lists those persisted states.

The source kit now also checks a loopback RestClient read timeout and uncertain write. The missing matrix still includes a target database, two application versions running together, a real broker, process kill between consumer commit and acknowledgement, and the actual proxy. An integration environment should run the exact packaged artifact and migration SQL. Keep each failure case bounded so a red test identifies the broken boundary.

Working sketch

Output
1. Start the packaged old and new applications against a disposable target database.
2. Apply V2, send old and new writes, then stop one instance mid-request.
3. Inspect rows, outbox state and routed responses before applying V3.

Verification boundary

The existing Maven suite checks local contexts, H2 states and loopback HTTP; this multi-process matrix has not run.

Costs and limits

No target database, ingress, broker, process-kill setup or mixed-version deployment is included.

Common Mistakes

  • Do not label a context-close test a graceful platform shutdown test.
  • Do not assert only HTTP status while ignoring committed rows.
  • Do not apply a breaking migration before proving old-version retirement.

Read next

Spring tests: separate business rules, wiring and transport, Spring Boot graceful shutdown: finish accepted requests within a deadline, Spring schema rollout tests: check old and new writers at every phase, Spring relay failure trace: inspect persisted state at each cut point.

spring
spring-boot
release
Storage details