A child-JVM configuration test checks inherited process state and startup behavior without testing a production deployment.
Spring Boot config tests: what a child JVM proves and what deployment still owes
Three layers of evidence
A manually inserted property source checks binding rules in a local context. A Boot context checks framework startup with supplied arguments and files. RelaySettingsProcessTest goes one layer further by launching a new JVM with environment values and a separate working directory. The environment result and the import result make that difference concrete.
The probe is not ReceiptApplication. It has no network listener, persistent database or work queue. A later fixture now reads a synthetic local file tree through configtree:; it still does not read a Kubernetes Secret, production-mounted volume or external config service. A deployment test should start the packaged application with the actual entrypoint, mount, user ID and rollout settings, then inspect a non-secret effective value and failure status.
Test an outage without leaking data
Inject a missing required file and an invalid non-secret value in a staging deployment. Confirm the instance does not accept traffic and that the failure message does not expose a credential. Check a working config after restart as a separate case. Readiness and shutdown are distinct contracts; a process-exit assertion cannot stand in for them.
Checked source
Result result = run(Map.of("RELAY_BATCHSIZE", "29"), launchDirectory);
assertEquals(0, result.exitCode());
assertTrue(result.output().contains("BOUND_BATCH=29"));Verification boundary
RelaySettingsProcessTest (five child-JVM cases). The source kit contains the full test and entry point.
Common Mistakes
- Do not describe a local child JVM as a container or production service.
- Do not copy non-secret diagnostic techniques to credential values.
- Do not skip deployment startup and rollout tests because local binding passed.
Read next
Spring Boot environment binding: prove the value in a child JVM, Spring Boot relative config import: change the working directory and inspect the value, Spring Boot required import: fail when a relative file is missing, Spring tests: separate business rules, wiring and transport.
Checked config-data continuation
Continue with Spring Boot file-tree tests: prove binding without claiming secret delivery.
