junit5

ํ…Œ์ŠคํŠธ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๋ฉด์„œ ๋ฐ˜ํ™˜๊ฐ’ ์—†๋Š” ๋ฉ”์„œ๋“œ๋ฅผ ํ…Œ์ŠคํŠธํ•ด์•ผํ•  ๊ฒฝ์šฐ๊ฐ€ ์ƒ๊ฒผ๋‹ค. ์ด ๋ฉ”์„œ๋“œ๋Š” Message๋ฅผ ๋ณด๋‚ด๋Š” ๊ธฐ๋Šฅ์„ ํ•˜๋Š” ๋ฉ”์„œ๋“œ์ด๊ธฐ ๋•Œ๋ฌธ์— ๋‚ด๋ถ€์—์„œ ๋ฉ”์„ธ์ง€๋ฅผ ๋ณด๋‚ด๊ณ , ๋กœ๊ทธ ์ €์žฅ ํ›„ ๋ฐ˜ํ™˜ํ•˜๋Š” ๊ฐ’์ด ์—†๋‹ค. ๋‚˜๋Š” ์ด ๋‚ด๋ถ€์—์„œ ๋ฐ์ดํ„ฐ ์ •์ œ๊ฐ€ ๋๋‚œ ํ›„ ๋งˆ์ง€๋ง‰์— private send(RequestDto request) ์— ์ „๋‹ฌ๋˜๋Š” RequestDto ๋ฅผ ์•Œ๊ณ  ์‹ถ์—ˆ๋‹ค. private sendMessageList(){ // ๋ฐ์ดํ„ฐ ์ •์ œ send(reqeust); } private send(RequestDto request){ // ์‹ค์ œ๋กœ ์ „์†ก } ์ด๋•Œ, ArgumentCaptor ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋œ๋‹ค. @Test void sendMessageTest() { sendService.sendMessageList(new Oth..
์• ์ •์“ฐ
'junit5' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก