반응형 junit1 [JUnit] does not declare any static, non-private, non-final, nested classes annotated with @Configuration 에러 해결 JUnit 테스트 코드 돌리다가 does not declare any static, non-private, non-final, nested classes annotated with @Configuration.라고 에러가 나오면서 실행이 안됨 @SpringBootTest 아래에@ContextConfiguration(classes = SpringBootApplication.class) 붙여서 해결함 기존에는 별도로 어떤 설정 클래스를 쓸지 명시를 안해놔서 스프링이 찾으려고 시도하려다가 못찾은거임. 근데 @ContextConfiguration(classes = BlogApplication.class) 라고 써줌으로써직접 명시로 덮어준것. 2025. 5. 28. 이전 1 다음 반응형