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 the shared test-support modules (spring-boot-test-support, spring-boot-docker-test-support, spring-boot-gradle-test-support). For test configuration conventions and @SpringBootTest slice annotations, see page 5.1
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 that represents a realistic minimal use case—for example, a simple web application using Tomcat, or a basic data access layer using JPA.
The Spring Boot repository contains over 90 smoke test modules, each testing a specific integration or feature combination. These tests serve multiple purposes:
Sources: settings.gradle384-478
All smoke test modules are organized under the :smoke-test prefix in the multi-project build. Each module follows the naming pattern spring-boot-smoke-test-{feature}.
Sources: settings.gradle384-478
The repository includes smoke tests organized into the following categories:
| Category | Example Modules | Count |
|---|---|---|
| Web Frameworks | webmvc, webflux, jersey, graphql, hateoas | ~15 |
| Data Access | data-jpa, data-mongodb, data-redis, data-cassandra, data-elasticsearch | ~15 |
| Messaging | kafka, pulsar, amqp, artemis, activemq | ~5 |
| Security | oauth2-client, oauth2-resource-server, oauth2-authorization-server, saml2-service-provider | ~10 |
| Actuator | actuator, actuator-custom-security, actuator-noweb, actuator-log4j2 | ~5 |
| Template Engines | thymeleaf, freemarker, mustache, groovy-templates | ~4 |
| Embedded Servers | tomcat, jetty, undertow variations | ~10 |
| Database Migrations | flyway, liquibase, data-r2dbc-flyway | ~3 |
| Session Management | session-jdbc, session-data-redis | ~3 |
| Build/Packaging | traditional, war, ant | ~3 |
| Logging | log4j2, logback, structured-logging | ~4 |
| Other | cache, batch, quartz, integration, devtools | ~15 |
Sources: settings.gradle384-478
Web framework smoke tests validate different web technologies and configurations:
Key Tests:
spring-boot-smoke-test-webmvc: Basic Spring MVC application with Tomcatspring-boot-smoke-test-webflux: Reactive application with Nettyspring-boot-smoke-test-webflux-coroutines: Kotlin coroutines supportspring-boot-smoke-test-jersey: JAX-RS using Jersey frameworkspring-boot-smoke-test-graphql: GraphQL endpoint configurationSources: settings.gradle473-477
Data smoke tests verify database integrations and repository configurations:
Key Tests:
spring-boot-smoke-test-data-jpa: JPA entity management with auto-configurationspring-boot-smoke-test-data-mongodb: MongoDB repository integrationspring-boot-smoke-test-data-redis: Redis operations and repositoriesspring-boot-smoke-test-data-r2dbc-flyway: Reactive SQL with Flyway migrationsspring-boot-smoke-test-data-elasticsearch: Elasticsearch document repositoriesSources: settings.gradle402-413
Messaging smoke tests validate message broker integrations:
Key Tests:
spring-boot-smoke-test-kafka: Kafka producer and consumer auto-configurationspring-boot-smoke-test-pulsar: Pulsar client and admin configurationspring-boot-smoke-test-amqp: RabbitMQ with Spring AMQPspring-boot-smoke-test-artemis: JMS with Apache ArtemisSources: settings.gradle384-394
Security smoke tests verify authentication and authorization configurations:
Key Tests:
spring-boot-smoke-test-oauth2-client: OAuth2 client registration and loginspring-boot-smoke-test-oauth2-resource-server: JWT token validationspring-boot-smoke-test-saml2-service-provider: SAML2 authenticationspring-boot-smoke-test-web-secure: Basic Spring Security configurationSources: settings.gradle430-445
Actuator smoke tests verify production-ready endpoints:
| Test Module | Purpose |
|---|---|
spring-boot-smoke-test-actuator | Basic actuator endpoints with web server |
spring-boot-smoke-test-actuator-noweb | Non-web application actuator endpoints |
spring-boot-smoke-test-actuator-custom-security | Custom security for actuator endpoints |
spring-boot-smoke-test-actuator-ui | Actuator with web UI |
spring-boot-smoke-test-actuator-log4j2 | Actuator with Log4j2 logging |
spring-boot-smoke-test-actuator-extension | Custom actuator endpoint extensions |
Sources: settings.gradle386-391
Each smoke test follows a consistent structure:
Smoke tests share these traits:
@SpringBootApplication class@SpringBootTest that verifies application context loadsSmoke tests typically depend on:
spring-boot-starter-web, spring-boot-starter-data-jpa)spring-boot-starter-testspring-boot-testcontainers for database tests)Sources: Based on smoke test organization in settings.gradle384-478
The three test categories form a layered validation strategy:
Testing Pyramid: Smoke, Integration, and System Tests
Sources: settings.gradle384-491
| Aspect | Smoke Tests | Integration Tests | System Tests |
|---|---|---|---|
| Scope | Single feature/starter | Cross-component behavior | Full packaged artifact |
| Count | 90+ modules | 7 modules | 2 modules |
| Gradle prefix | :smoke-test:* | :integration-test:* | :system-test:* |
| Key test runner | Standard test task | Standard test task | systemTest task (SystemTestPlugin) |
| CI caching | Cached | Cached | Never cached on CI |
Sources: settings.gradle384-491 buildSrc/src/main/java/org/springframework/boot/build/test/SystemTestPlugin.java88-93
Smoke tests use the standard Gradle test task. Each smoke test module has its own test task that runs during the verification phase. Test retries and predictive test selection from JavaConventions apply here as with any other subproject (see page 5.1).
# Run a specific smoke test module
./gradlew :smoke-test:spring-boot-smoke-test-data-jpa:test
# Run a reactive web smoke test
./gradlew :smoke-test:spring-boot-smoke-test-webflux:test
Smoke tests run as part of the continuous integration pipeline:
Sources: settings.gradle384-478
Seven integration test modules occupy the :integration-test:* namespace. Unlike smoke tests, they 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-integration-tests | General integration scenarios |
spring-boot-loader-integration-tests | Executable JAR/WAR loader behavior |
spring-boot-server-integration-tests | Embedded server lifecycle |
spring-boot-sni-integration-tests | SNI (Server Name Indication) SSL behavior |
spring-boot-test-integration-tests | @SpringBootTest and test slice behavior |
Integration tests use the standard test task (not systemTest) and are subject to the same JavaConventions test conventions as other modules.
Sources: settings.gradle481-487
Test support module relationships
Key modules:
spring-boot-test: @SpringBootTest and test utilitiesspring-boot-test-autoconfigure: Slice test configurationsspring-boot-testcontainers: Container lifecycle management for databases and brokersspring-boot-test-support: Common utilitiesspring-boot-docker-test-support: Docker infrastructure for testsspring-boot-gradle-test-support: Gradle TestKit helpers used by system testsSources: settings.gradle63-65 settings.gradle76-78
System tests are the highest-level tests in the repository. They validate complete packaged artifacts—OCI images and deployment archives—rather than source-level features.
Two system test modules are declared in settings.gradle:
include ":system-test:spring-boot-deployment-system-tests"
include ":system-test:spring-boot-image-system-tests"
spring-boot-deployment-system-tests: Validates that Spring Boot applications can be deployed and run correctly as packaged distributions.spring-boot-image-system-tests: Validates OCI images built by the Spring Boot Gradle and Maven plugins. Uses GradleBuildInjectionExtension to inject the locally-built plugin into test Gradle builds and then exercises container image creation and startup.Sources: settings.gradle489-490
System test modules apply the org.springframework.boot.system-test plugin, implemented by SystemTestPlugin in buildSrc. It is registered in buildSrc/build.gradle:
systemTestPlugin {
id = "org.springframework.boot.system-test"
implementationClass = "org.springframework.boot.build.test.SystemTestPlugin"
}
SystemTestPlugin source set and task conventions
Key behaviors of SystemTestPlugin:
| Behavior | Detail |
|---|---|
| Source set name | systemTest (SYSTEM_TEST_SOURCE_SET_NAME) |
| Task name | systemTest (SYSTEM_TEST_TASK_NAME) |
| Task group | LifecycleBasePlugin.VERIFICATION_GROUP |
| Ordering | shouldRunAfter(JavaPlugin.TEST_TASK_NAME) |
| CI behavior | outputs.upToDateWhen(NEVER) and doNotCacheIf(...) when CI=true |
| Classpath | systemTest compile and runtime classpaths extend main output |
| JUnit launcher | org.junit.platform:junit-platform-launcher added to systemTestRuntimeOnly |
| Eclipse | systemTest runtime classpath added to Eclipse .classpath via EclipseModel |
Sources: buildSrc/src/main/java/org/springframework/boot/build/test/SystemTestPlugin.java39-100 buildSrc/build.gradle157-160
spring-boot-image-system-tests uses GradleBuildInjectionExtension (from spring-boot-gradle-test-support) to inject the locally-built Spring Boot Gradle plugin into test Gradle projects. This allows system tests to build OCI images using the current development version of the plugin and then verify the resulting container images start and behave correctly.
The spring-boot-gradle-test-support module provides the Gradle TestKit infrastructure that image system tests rely on to fork Gradle processes.
Sources: settings.gradle65 settings.gradle489-490
Because system tests exercise packaged artifacts and OCI image builds, they are never cached on CI. SystemTestPlugin.createTestTask() sets:
This ensures that every CI run re-executes the system tests against the freshly built artifacts.
Sources: buildSrc/src/main/java/org/springframework/boot/build/test/SystemTestPlugin.java83-93
Smoke test module names follow consistent patterns:
| Pattern | Example | Purpose |
|---|---|---|
data-{technology} | data-jpa, data-mongodb | Data access with Spring Data |
web-{feature} | web-secure, web-static | Web features with MVC |
{server}-{feature} | tomcat-ssl, jetty-jsp | Server-specific features |
actuator-{variant} | actuator-noweb, actuator-log4j2 | Actuator variations |
{technology} | kafka, pulsar, graphql | Technology-specific integration |
{feature} | batch, cache, quartz | General feature testing |
This naming makes it easy to identify which feature or integration a smoke test validates.
Sources: settings.gradle384-478
Smoke tests form the foundational validation layer in Spring Boot's comprehensive testing strategy. With over 90 modules covering web frameworks, data access, messaging, security, and various other features, they ensure that:
Each smoke test is a minimal, executable Spring Boot application that validates a specific feature or integration point. They provide fast feedback during development while maintaining realistic integration scenarios. For deeper integration validation, see Integration and System Tests.
Sources: Overall architecture from settings.gradle384-478 and Diagram 3 in high-level overview
Refresh this wiki