Spring Boot
[JUnit] does not declare any static, non-private, non-final, nested classes annotated with @Configuration ์๋ฌ ํด๊ฒฐ
์ฐ์ฃผ๋ฌผ๊ณ ๊ธฐ
2025. 5. 28. 17:17
๋ฐ์ํ
JUnit ํ ์คํธ ์ฝ๋ ๋๋ฆฌ๋ค๊ฐ
does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
๋ผ๊ณ ์๋ฌ๊ฐ ๋์ค๋ฉด์ ์คํ์ด ์๋จ

@SpringBootTest ์๋์
@ContextConfiguration(classes = SpringBootApplication.class) ๋ถ์ฌ์ ํด๊ฒฐํจ
๊ธฐ์กด์๋ ๋ณ๋๋ก ์ด๋ค ์ค์ ํด๋์ค๋ฅผ ์ธ์ง ๋ช ์๋ฅผ ์ํด๋์
์คํ๋ง์ด ์ฐพ์ผ๋ ค๊ณ ์๋ํ๋ ค๋ค๊ฐ ๋ชป์ฐพ์๊ฑฐ์.
๊ทผ๋ฐ @ContextConfiguration(classes = BlogApplication.class) ๋ผ๊ณ ์จ์ค์ผ๋ก์จ
์ง์ ๋ช ์๋ก ๋ฎ์ด์ค๊ฒ.
๋ฐ์ํ