@Service identifies a class as application service logic managed by the Spring application context and discovered through component scanning. In a typical Spring Boot structure, a controller delegates to a service, which coordinates repositories and external integrations. section 2.1
A service can aggregate results from components such as repositories and HTTP clients. Keep complex behavior independently testable: instantiate a service directly with constructor dependencies when Spring infrastructure is unnecessary. section 2.1 section 2.7
Service-layer testing boundary
A WeatherScoringService can calculate scores from weather history and user preferences without starting Spring. Pass mocked dependencies to its constructor, call score("Paris", 6), and assert the result directly. section 2.7
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-to-service flow and the service’s connections to repositories and external systems. section 2.1

