lombok
-
Spring Framework의 테스트 클래스에서 단일 생성자로 의존성 자동 주입이 되지 않는 이유Spring Boot 2024. 10. 9. 21:39
사전 지식Spring Framework 4.3부터 해당 빈(bean)의 생성자가 하나뿐인 경우, 그 생성자에 @Autowired를 붙이지 않아도 생성자 주입이 된다.원문As of Spring Framework 4.3, an @Autowired annotation on such a constructor is no longer necessary if the target bean defines only one constructor to begin with. However, if several constructors are available and there is no primary/default constructor, at least one of the constructors must be annotated ..