๐ŸŒป JAVA/JUnit

๐ŸŒป JAVA/JUnit

@WebMvcTest ์ž‘์„ฑ ์‹œ ์˜์กด์„ฑ ์—๋Ÿฌ

ํ™˜๊ฒฝ Spring boot 2.7.1 Spring Security JUnit 5 Controller ํ…Œ์ŠคํŠธ๋ฅผ ํ•˜๊ธฐ์œ„ํ•ด ๋ถˆํ•„์š”ํ•œ ์˜์กด์„ฑ๋“ค์€ ๊ฑท์–ด๋‚ด๊ณ  WebMvcTest ์–ด๋…ธํ…Œ์ด์…˜์„ ๋ถ™์—ฌ์„œ ์ปจํŠธ๋กค๋Ÿฌ ๋ ˆ์ด์–ด๋งŒ ๊ฐ€๋ณ๊ณ  ๋น ๋ฅด๊ฒŒ ํ…Œ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. WebMvcTest ์–ด๋…ธํ…Œ์ด์…˜์„ ๋ถ™์ด๊ฒŒ ๋˜๋ฉด, MVC ํ…Œ์ŠคํŠธ๋ฅผ ์œ„ํ•œ ์˜์กด์„ฑ๋“ค์ด Spring Contetxt์— ์˜ฌ๋ผ๊ฐ€๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. Using this annotation will disable full auto-configuration and instead apply only configuration relevant to MVC tests (i.e. @Controller, @ControllerAdvice, @JsonComponent, Converter/Generi..

iseunghan
'๐ŸŒป JAVA/JUnit' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก