Why can\'t I use @Autowired in this case?
@Autowired
@SpringBootApplication public class Application { @Autowired BookingService bookingService;
great answer by @DaveyDaveDave In the example instead of
@Bean BookingService bookingService() { return new BookingService(); }
You can use @Service annotation on BookingService class