The system under test is the application whose behavior a test verifies. In Spring Boot testing, it can range from a focused application slice to the full application, depending on how much context the test needs. section 1.6 section 2.1
With @SpringBootTest, Spring Boot detects the application configuration, prepares a test-oriented application context, starts the application before tests, and shuts it down with cleanup afterward. Tests can access beans with @Autowired, inspect repository state, change properties, or replace beans with stubs and mocks. section 1.6 section 3.0
Choose the test subject and application context deliberately:
- Use a full application context for user scenarios that exercise the application end to end within the test environment. section 1.6
- Prefer a narrower or more focused setup for fine-grained conditional logic and tests containing substantial state. section 1.6
- Customize the application under test when external services need stubbing, profiles need separation, or only selected modules should load. section 3.0
Weather dashboard
A sample application under test displays weather and temperature for user-selected cities. Its controller receives requests, application classes hold the logic, and external weather services provide data. It can use the live Open-Meteo API or a local profile with a fake API that returns random weather, allowing tests to avoid the external dependency. section 2.1
Figure 2.2 The architecture of the application under test. On the left side, the @Controller is the entrypoint to the application. On the right side are external systems that the application connects to. In between are the classes that hold your application logic. Solid arrows represent code dependencies and dashed arrows external connections.
Use the architecture diagram to trace the controller entry point, application logic, and external connections that together define the test subject. section 2.1




