profile
Hello World ๐Ÿ˜Ž
post-thumbnail

[JUnit] MockMvc

์ฐธ๊ณ  ์ž๋ฃŒ : [ https://www.youtube.com/watch?v=8S8o46avgAw&t=956s, https://www.youtube.com/watch?v=Ijj5RLSAcYw&t=5s ] ์ด๋ฒˆ๊ธ€์—์„œ๋Š” MockMvc๋ฅผ ์‚ฌ์šฉํ•ด RestController๋ฅผ testํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. 1. RestController ๋จผ์ € ์ด...

2020๋…„ 1์›” 19์ผ
ยท
0๊ฐœ์˜ ๋Œ“๊ธ€
post-thumbnail

[JUnit] Spy

์ฐธ๊ณ  ์ž๋ฃŒ : https://www.udemy.com/course/practical-test-driven-development-for-java-programmers/ image.png ์ด๋ฒˆ๊ธ€์—์„œ๋Š” test์—์„œ ํŠน์ • ๋ฉ”์„œ๋“œ๋งŒ override ํ•˜๋Š” ๋ฐฉ๋ฒ•์ธ Spy์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. 1. Mock Instance ์šฐ๋ฆฌ๋Š” ์ด์ „ ๊ธ€์—์„œ Stub์™€ ...

2020๋…„ 1์›” 18์ผ
ยท
0๊ฐœ์˜ ๋Œ“๊ธ€
post-thumbnail

[JUnit] Bad Test

์ฐธ๊ณ  ์ž๋ฃŒ : https://www.udemy.com/course/practical-test-driven-development-for-java-programmers/ image.png ์ด๋ฒˆ๊ธ€์—์„œ๋Š” prime number ์˜ˆ์ œ๋ฅผ ํ†ตํ•ด ์ข‹์€ test code๋ฅผ ์ž‘์„ฑํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. 1. Check Prime Number ๋จผ์ € ์•„๋ž˜...

2020๋…„ 1์›” 18์ผ
ยท
0๊ฐœ์˜ ๋Œ“๊ธ€
post-thumbnail

[JUnit] Mock & Mockito -2

์ฐธ๊ณ  ์ž๋ฃŒ : https://www.udemy.com/course/practical-test-driven-development-for-java-programmers/ image.png ์ด๋ฒˆ๊ธ€์—์„œ๋Š” Mock์˜ Fake ๊ธฐ๋Šฅ๊ณผ, Stub๋ฅผ ๋Œ€์ฒดํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. 1. Stub & Mock ์ด์ „๊นŒ์ง€์˜ ๊ธ€์„ ํ†ตํ•ด ์šฐ๋ฆฌ๋Š” Stub๋Š” da...

2020๋…„ 1์›” 18์ผ
ยท
0๊ฐœ์˜ ๋Œ“๊ธ€
post-thumbnail

[JUnit] Mock & Mockito -1

์ฐธ๊ณ  ์ž๋ฃŒ : https://www.udemy.com/course/practical-test-driven-development-for-java-programmers/ image.png ์ด๋ฒˆ๊ธ€์—์„œ๋Š” JUnit์˜ Mock์„ ํ™œ์šฉํ•ด behavior๋ฅผ ํ…Œ์ŠคํŠธ ํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. 1. Test Behavior 1-1) Test Result ์ด์ „ ๊ธ€๊ณผ ๋™์ผ...

2020๋…„ 1์›” 17์ผ
ยท
0๊ฐœ์˜ ๋Œ“๊ธ€
post-thumbnail

[JUnit] Stub

์ฐธ๊ณ  ์ž๋ฃŒ : https://www.udemy.com/course/practical-test-driven-development-for-java-programmers/ image.png ์ด๋ฒˆ๊ธ€์—์„œ๋Š” JUnit์˜ Stub์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. 1. Stub๋ž€? > ํ…Œ์ŠคํŠธ ์šฉ๋„๋กœ ํ•˜๋“œ ์ฝ”๋”ฉํ•œ ๊ฐ’์„ ๋ฐ˜ํ™˜ํ•˜๋Š” ๊ตฌํ˜„์ฒด๋ฅผ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. Stub์€ ์ฃผ๋กœ ...

2020๋…„ 1์›” 16์ผ
ยท
0๊ฐœ์˜ ๋Œ“๊ธ€
post-thumbnail

[JUnit] TDD -2

์ฐธ๊ณ  ์ž๋ฃŒ : https://www.udemy.com/course/practical-test-driven-development-for-java-programmers/ image.png ์ด์ „ ๊ธ€ : https://velog.io/@minholee_93/2020-01-16-0901-%EC%9E%91%EC%84%B1%EB%90%A8-dak5fzblgc 5....

2020๋…„ 1์›” 16์ผ
ยท
0๊ฐœ์˜ ๋Œ“๊ธ€
post-thumbnail

[JUnit] TDD -1

์ฐธ๊ณ  ์ž๋ฃŒ : https://www.udemy.com/course/practical-test-driven-development-for-java-programmers/ image.png ์ด๋ฒˆ ๊ธ€์—์„œ๋Š” TDD์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. 1. TDD๋ž€? > test๋จผ์ € ์ž‘์„ฑํ•˜๊ณ  ๊ทธ test๋ฅผ ํ†ต๊ณผ์‹œํ‚ค๋Š” code๋ฅผ ์ž‘์„ฑํ•˜๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด A+...

2020๋…„ 1์›” 16์ผ
ยท
0๊ฐœ์˜ ๋Œ“๊ธ€