๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Spring Boot

[JUnit] does not declare any static, non-private, non-final, nested classes annotated with @Configuration ์—๋Ÿฌ ํ•ด๊ฒฐ

by ์šฐ์ฃผ๋ฌผ๊ณ ๊ธฐ 2025. 5. 28.
๋ฐ˜์‘ํ˜•

JUnit ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ๋Œ๋ฆฌ๋‹ค๊ฐ€ 

 

does not declare any static, non-private, non-final, nested classes annotated with @Configuration.

๋ผ๊ณ  ์—๋Ÿฌ๊ฐ€ ๋‚˜์˜ค๋ฉด์„œ ์‹คํ–‰์ด ์•ˆ๋จ

 

 

 

@SpringBootTest ์•„๋ž˜์—

@ContextConfiguration(classes = SpringBootApplication.class) ๋ถ™์—ฌ์„œ ํ•ด๊ฒฐํ•จ

 

๊ธฐ์กด์—๋Š” ๋ณ„๋„๋กœ ์–ด๋–ค ์„ค์ • ํด๋ž˜์Šค๋ฅผ ์“ธ์ง€ ๋ช…์‹œ๋ฅผ ์•ˆํ•ด๋†”์„œ 

์Šคํ”„๋ง์ด ์ฐพ์œผ๋ ค๊ณ  ์‹œ๋„ํ•˜๋ ค๋‹ค๊ฐ€ ๋ชป์ฐพ์€๊ฑฐ์ž„.

 

๊ทผ๋ฐ @ContextConfiguration(classes = BlogApplication.class) ๋ผ๊ณ  ์จ์คŒ์œผ๋กœ์จ

์ง์ ‘ ๋ช…์‹œ๋กœ ๋ฎ์–ด์ค€๊ฒƒ.

 

 

๋ฐ˜์‘ํ˜•