개발 공부

[문제 해결] Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test 본문

Spring/Spring Boot

[문제 해결] Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test

hyecozy 2022. 8. 9. 14:35

이 오류는 
@SpringBootApplication 어노테이션이 붙은 클래스가 존재하는 패키지의 하위 패키지에 둬야 한다는 원칙을 어겨서 나는 오류이다.

다시 보니 테스트 하고자 했던 클래스의 패키지가 테스트 클래스 패키지와 위치가 달라서 오류가 난 것이었다. (머쓱,,
이름 잘 확인하고 만들자...ㅎㅎ!



아래의 블로그에 다른 해결 방안에 대해서 잘 설명해 놓았으니 참고하시면 좋을 것 같다.

https://kwonnam.pe.kr/wiki/springframework/springboot/test

 

springframework:springboot:test [권남]

 

kwonnam.pe.kr

 

Comments