작성
·
381
0
@Component
//@RequiredArgsConstructor
public class OrderServiceImpl implements OrderService {
private final MemberRepository memberRepository;
private final DiscountPolicy discountPolicy;
@Autowired
public OrderServiceImpl(MemberRepository memberRepository, DiscountPolicy rateDiscountPolicy) {
this.memberRepository = memberRepository;
this.discountPolicy = rateDiscountPolicy;
}
2:50초 쯤에서 DiscountPolicy 의 변수를 rateDicountPolicy 로 변경을 하는 내용이 나오거든요
그리고 테스트를 돌리는데 성공하시더라구요 그런데 저는 여기서 아래에러가 발생해서요
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'orderServiceImpl' defined in file [C:\Users\kkk\Downloads\core\out\production\classes\hello\core\order\OrderServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 1: No qualifying bean of type 'hello.core.discount.DiscountPolicy' available: expected single matching bean but found 2: fixDiscountPolicy,rateDiscountPolicy
매칭이 안된것 같은데 어떻게 해야 할지 문의 드립니다.