The Spring Boot repository contains three categories of end-to-end and higher-level tests, all declared in settings.gradle alongside the core library modules:
| Category | Prefix in settings.gradle | Count | Purpose |
|---|---|---|---|
| Smoke tests | :smoke-test:* | 90+ | Validate that a single feature/starter auto-configures correctly in a minimal app |
| Integration tests | :integration-test:* | 7 | Validate cross-component behavior (loader, server, actuator, etc.) |
| System tests | :system-test:* | 2 | Validate packaged artifacts (OCI images, deployment archives) |
These test categories build on shared test-support modules such as spring-boot-test-support, spring-boot-docker-test-support, and spring-boot-gradle-test-support.
Sources: settings.gradle384-491
Smoke tests are lightweight Spring Boot applications that validate the basic functionality of individual features or combinations of features. Each smoke test is a standalone project representing a realistic minimal use case.
The repository contains over 90 smoke test modules, serving as feature validation, integration verification, and regression prevention for starter modules.
All smoke test modules are organized under the :smoke-test prefix. Each module follows the naming pattern spring-boot-smoke-test-{feature}.
Smoke Test Project Structure and Code Entities
Sources: smoke-test/spring-boot-smoke-test-data-elasticsearch/build.gradle17-21 smoke-test/spring-boot-smoke-test-cache/src/dockerTest/java/smoketest/cache/SampleCacheApplicationRedisTests.java22-30
Standard smoke tests (e.g., spring-boot-smoke-test-prometheus or spring-boot-smoke-test-graphql) use the java plugin and include minimal dependencies like spring-boot-starter-webmvc and specific micrometer registries smoke-test/spring-boot-smoke-test-prometheus/build.gradle17-34 They typically include a compileTestJava task configuration to enable nullability checking smoke-test/spring-boot-smoke-test-prometheus/build.gradle36-38 smoke-test/spring-boot-smoke-test-graphql/build.gradle32-34
Many smoke tests utilize Testcontainers to validate integrations with external services like Redis, Elasticsearch, or MongoDB. These modules apply the org.springframework.boot.docker-test plugin smoke-test/spring-boot-smoke-test-data-elasticsearch/build.gradle20
Key components in these tests include:
TestImage: A catalog used to retrieve consistent container images (e.g., TestImage.container(RedisContainer.class)) smoke-test/spring-boot-smoke-test-cache/src/dockerTest/java/smoketest/cache/SampleCacheApplicationRedisTests.java43@ServiceConnection: Automatically configures Spring Boot connection details from the container smoke-test/spring-boot-smoke-test-cache/src/dockerTest/java/smoketest/cache/SampleCacheApplicationRedisTests.java42Awaitility: Used for handling asynchronous assertions, such as waiting for a cache to be populated after a repository call smoke-test/spring-boot-smoke-test-cache/src/dockerTest/java/smoketest/cache/SampleCacheApplicationRedisTests.java58-62Sources: smoke-test/spring-boot-smoke-test-cache/src/dockerTest/java/smoketest/cache/SampleCacheApplicationRedisTests.java37-43 smoke-test/spring-boot-smoke-test-data-elasticsearch/build.gradle20-33
Integration test modules (declared in the :integration-test namespace) validate lower-level cross-cutting concerns:
| Module | Purpose |
|---|---|
spring-boot-actuator-integration-tests | Actuator endpoint behavior across configurations |
spring-boot-configuration-processor-integration-tests | Annotation processor output correctness |
spring-boot-loader-integration-tests | Executable JAR/WAR loader behavior |
spring-boot-server-integration-tests | Embedded server lifecycle |
spring-boot-test-integration-tests | @SpringBootTest and test slice behavior |
Sources: settings.gradle481-487
System tests validate complete packaged artifacts, such as OCI images and deployment archives.
System test modules apply the org.springframework.boot.system-test plugin. This plugin configures a dedicated systemTest source set and task.
System Test Execution Flow
Sources: build-plugin/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImage.java45-49 build-plugin/spring-boot-gradle-plugin/src/dockerTest/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java53-78
Key behaviors:
systemTest Source Set: Extends the main source set's output, allowing system tests to access the application code.GradleBuild: A test utility (often used with GradleCompatibility) that leverages Gradle TestKit to execute builds in a temporary directory build-plugin/spring-boot-gradle-plugin/src/dockerTest/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java72-78The module :system-test:spring-boot-image-system-tests validates OCI images built by the Spring Boot Gradle and Maven plugins.
BootBuildImage Task: The core Gradle task responsible for OCI image creation via buildpacks build-plugin/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImage.java72 It configures a BuildRequest which includes image names, builders, and environment variables build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageTests.java67-71PaketoBuilderTests: Validates that images produced using Paketo Buildpacks are functional. Integration tests verify that the bootBuildImage task correctly reports success and outputs the expected image reference to the console build-plugin/spring-boot-gradle-plugin/src/dockerTest/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java78-83DockerApi and ImageApi: Used within the test infrastructure to verify that images were actually created in the local Docker daemon and to remove them after tests build-plugin/spring-boot-gradle-plugin/src/dockerTest/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java43-44Sources: settings.gradle490 build-plugin/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImage.java145-182 build-plugin/spring-boot-gradle-plugin/src/dockerTest/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java75-89
Spring Boot provides specialized "test starters" used by smoke tests to pull in required testing infrastructure for specific slices.
| Starter | Dependencies |
|---|---|
spring-boot-starter-actuator-test | spring-boot-starter-actuator, spring-boot-starter-test, micrometer-metrics-test |
spring-boot-starter-graphql-test | spring-boot-starter-graphql, spring-boot-starter-test, spring-boot-graphql-test, spring-boot-webtestclient |
spring-boot-starter-batch-jdbc-test | spring-boot-starter-batch-test, spring-boot-starter-jdbc-test |
spring-boot-starter-opentelemetry-test | spring-boot-starter-opentelemetry, spring-boot-starter-test, spring-boot-micrometer-tracing-test |
Sources: starter/spring-boot-starter-actuator-test/build.gradle23-27 starter/spring-boot-starter-graphql-test/build.gradle23-30 starter/spring-boot-starter-batch-jdbc-test/build.gradle23-26 starter/spring-boot-starter-opentelemetry-test/build.gradle23-29
Refresh this wiki