๋ฐ์ํ
์ํฉ
Service UnitTest ์ค ๋ฐ์

์์ธ
@Before ์์ ์คํ๋๋ ์๋ Stubbing์ด ์ฐ์ด์ง ์์ ๋ฉ์๋๊ฐ ์์๋ค.
given(userRepository.findByEmail(userEmail)).willReturn(Optional.of(user));
ํด๊ฒฐ
@Before ์ด๋ ธํ ์ด์ ์ ์ ๊ฑฐํ๊ณ ,
ํ์ํ ๋ฉ์๋์์ ํธ์ถํ๋ ๋ฐฉ์์ผ๋ก ๋ณ๊ฒฝ!
๋ฐ์ํ
'๐ป ๊ฐ๋ฐ ์ผ์ง > SpringBoot' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Spring Boot] Custom Exception Response ๋ง๋ค๊ธฐ (0) | 2022.04.26 |
---|---|
SpringBoot - Slack Bot ์ฐ๋ํ๊ธฐ (0) | 2022.04.05 |
[Test] SpringBoot Test - Service (Mockito) (0) | 2022.03.27 |
[22.03.09] QueryDSL (0) | 2022.03.09 |
[22.03.04] Service, Controller ์์ฑ (0) | 2022.03.07 |
๋ฐ์ํ
์ํฉ
Service UnitTest ์ค ๋ฐ์

์์ธ
@Before ์์ ์คํ๋๋ ์๋ Stubbing์ด ์ฐ์ด์ง ์์ ๋ฉ์๋๊ฐ ์์๋ค.
given(userRepository.findByEmail(userEmail)).willReturn(Optional.of(user));
ํด๊ฒฐ
@Before ์ด๋ ธํ ์ด์ ์ ์ ๊ฑฐํ๊ณ ,
ํ์ํ ๋ฉ์๋์์ ํธ์ถํ๋ ๋ฐฉ์์ผ๋ก ๋ณ๊ฒฝ!
๋ฐ์ํ
'๐ป ๊ฐ๋ฐ ์ผ์ง > SpringBoot' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Spring Boot] Custom Exception Response ๋ง๋ค๊ธฐ (0) | 2022.04.26 |
---|---|
SpringBoot - Slack Bot ์ฐ๋ํ๊ธฐ (0) | 2022.04.05 |
[Test] SpringBoot Test - Service (Mockito) (0) | 2022.03.27 |
[22.03.09] QueryDSL (0) | 2022.03.09 |
[22.03.04] Service, Controller ์์ฑ (0) | 2022.03.07 |