DEV/Spring
[해결] java.lang.IlleagalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
꼭두새벽에비명소리
2020. 6. 1. 10:32
[junit] 오류
java.lang.IlleagalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
[해결]
즉 원본소스는 src/main/java/com/example/ 밑에 있는데
테스트 소스가 src/test/com/exam/ 밑에 있어서 맞지 않는다면 해당 오류가 나더라.
테스트 소스를 원본소스 패키지와 맞춰서 밑에 두면 해결
my-test-project
+--pom.xml
+--src
+--main
+--com
+--example
+-- 원본소스.java
+--test
+--com
+--example
+--test
+-- 테스트소스.java