MindIQ Academy
1 / 100
Dependency Injection and Beans

Question 1

A Spring Boot 3 application has two beans of the same interface and a service using constructor injection:

public interface PaymentGateway {}

@Component
class StripeGateway implements PaymentGateway {}

@Component
class PaypalGateway implements PaymentGateway {}

@Service
class CheckoutService {
    private final PaymentGateway gateway;

    CheckoutService(PaymentGateway gateway) {
        this.gateway = gateway;
    }
}

What is the most likely startup outcome?