-
Notifications
You must be signed in to change notification settings - Fork 14
[3์ฃผ์ฐจ] ๐ 2๋จ๊ณ - ๋ค์ค ์๋น์ค ํ ์คํธ ํ๊ฒฝ #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: joydaheecha
Are you sure you want to change the base?
Conversation
This reverts commit e8f203b.
- ๋ชจ๋ ์๋น์ค(kiosk, admin, reservation)๋ฅผ ๊ณต์ฉ ๋คํธ์ํฌ atdd-net์ ์ฐ๊ฒฐ - admin๊ณผ reservation ์๋น์ค์ ๊ณต์ฉ DB(atdd-db) ์ ์ ์ ๋ณด ํ๊ฒฝ๋ณ์ ์ถ๊ฐ - MySQL 8.0 ๋๋ผ์ด๋ฒ ๋ฐ ๋ฐฉ์ธ ์ค์ - DDL ๋ชจ๋๋ฅผ validate๋ก ๋ณ๊ฒฝํ์ฌ ๊ธฐ์กด ์คํค๋ง ์ฌ์ฉ - kiosk๊ฐ admin์ ์์กดํ๋๋ก depends_on ์ค์
- ์ธํ๋ผ DB(atdd-db) ์๋ ์์ ๋ฐ ์ด๊ธฐํ ๊ธฐ๋ฅ ์ถ๊ฐ - start_infra_db() ํจ์๋ก DB ํฌ์ค์ฒดํฌ ๋ฐ ์ด๊ธฐํ ์๋ํ - stop_infra_db() ํจ์๋ก ์ธํ๋ผ DB ์ ๋ฆฌ ๊ธฐ๋ฅ ์ถ๊ฐ - ์๋น์ค ์์ ์ ์ธํ๋ผ DB๋ฅผ ๋จผ์ ์์ํ๋๋ก ์์ ์กฐ์ - ๋ชจ๋ ์๋น์ค ์ค์ง ์ ์ธํ๋ผ DB๋ ํจ๊ป ์ค์งํ๋๋ก ์์ - ๋์๋ง์ ๊ณต์ฉ DB ๊ด๋ จ ์ ๋ณด ์ถ๊ฐ
- customers ํ ์ด๋ธ ์ถ๊ฐ (Admin ์๋น์ค์์ ํ์) - JPA DDL ๋ชจ๋๋ฅผ validate์์ none์ผ๋ก ๋ณ๊ฒฝํ์ฌ ์คํค๋ง ๊ฒ์ฆ ๋นํ์ฑํ - ๊ณต์ฉ DB์ ์ ํ๋ฆฌ์ผ์ด์ ์ํฐํฐ ๊ฐ ํธํ์ฑ ๊ฐ์
- atdd-tests ๋ด init.sql๊ณผ ์ถฉ๋ํ์ฌ ์ ๊ฑฐ
- atdd-tests ๋ด init.sql๊ณผ ์ถฉ๋ํ์ฌ ์ ๊ฑฐ
boorownie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์๋
ํ์ธ์ ๋คํฌ๋!
2๋จ๊ณ๋ ๊ณ ์ ๋ง์ผ์
จ์ต๋๋ค!
์ ๋จ๊ณ ํผ๋๋ฐฑ๋ ๋ง์ด ๋ฐ์ํด์ฃผ์
จ๋ค์ ๐
2๋จ๊ณ ์๊ตฌ์ฌํญ ์ค ๋ช ๊ฐ์ง ์๊ตฌ์ฌํญ์ ๋ํด์ ์ฝ๋ฉํธ๋ฅผ ๋จ๊ฒจ๋์๋๋ฐ ํ์ธ ๋ถํ๋๋ฆฌ๊ณ ์!
ํน์ ์ ๊ฐ ์๋ชป์ดํดํ ๋ถ๋ถ์ด ์๋ค๋ฉด ์ฝ๋ฉํธ ๋จ๊ฒจ์ฃผ์๊ณ ์์ ํ ๋ถ๋ถ์ด ์์ผ๋ฉด ๋ฐ๋ก ๋ฆฌ๋ทฐ์์ฒญ ์ฃผ์
๋ ๋ฉ๋๋ค!
์ง๋ฌธ1๋ฒ์ ์ฝ๋์ ์ฝ๋ฉํธ๋ก ๋จ๊ฒจ๋์๊ณ , 2๋ฒ์ ์๋ ๋จ๊ฒจ๋๊ฒ ์ต๋๋ค!
์ฐธ๊ณ ํด์ ํ์ธ๋ถํ๋๋ฆฝ๋๋ค :)
===
cursor ๊ฐ ์์ ํ ๋ด์ฉ์ ๋ํด ๊ธฐ์ ์ง์์ด ์ถฉ๋ถํ์ง ์์, ์ฝ๋๋ฅผ ๋ดค์๋ ์ข์ ์ฝ๋์ธ์ง ์ ๋งคํ ๊ฒฝ์ฐ, "์ด์ ๋๋ฉด ๋์๋ค" ๊ฒฐ์ ํ์๋ ๊ธฐ์ค์ ๊ฐ์ง๊ณ ๊ณ์ ์ง ๊ถ๊ธํฉ๋๋ค!
์ฐ์ ์ ๋ cursor๋ก ๊ตฌํ์ ํ ๋๋ TDD ํ ๋ ์ฒ๋ผ ๋์ํ๋ ์ฝ๋๊ฐ ๋๋์ง๋ฅผ ์ฐ์ ํ์ธํฉ๋๋ค. ์ ๋๋ก ๋์ํ๋ ๊ฒ์ ํ์ธํ ํ ๋ฆฌํฉํฐ๋ง์ ์ด์ด์ ์งํํด์ฃผ๋๋ฐ์, ์๋ง ๋ฆฌํฉํฐ๋ง์ ์ธ์ ๊น์ง ํ๋์ง์ ๋ํ ์ง๋ฌธ์ ํด์ฃผ์ ๊ฒ์ผ๋ก ์ดํดํ์ด์.
์ฌ์ค AI ๋๊ตฌ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ๊ณผ ์ฌ์ฉํ ๋ ๋ฆฌํฉํฐ๋ง ์ํ ๊ธฐ์ค์ด ๋ค๋ฅด์ง ์์ต๋๋ค. ์ถ๊ฐ๋ก ๋ ๊ฐ์ ํ ๋ถ๋ถ์ด ์์ด๋ณด์ผ ๋ ๊น์ง ์งํํฉ๋๋ค. ๋จ, ์์ ์ ํ์ ๋ ํฐ ์ฝ๋ ๋ณ๊ฒฝ์ด ์๊ธธ ๊ฒ ๊ฐ๋ค ๋๊ปด์ง๋ฉด ์ง๊ธ ํ ์ง ๋ค์์ ํ ์ง๋ฅผ ํ๋จํ๊ณ ๋๋ถ๋ถ ๊ทธ๋ง๋๋ ํธ์ด์์!
| private static void initializeRestAssured() { | ||
| kioskBaseUrl = KIOSK_URL; | ||
| adminBaseUrl = ADMIN_URL; | ||
| reservationBaseUrl = RESERVATION_URL; | ||
| RestAssured.enableLoggingOfRequestAndResponseIfValidationFails(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hooks์์ baseUrl์ ๊ณ์ ์ถ๊ฐํ๋๋ฐ ์ด ๊ฒฝ์ฐ, ํ ์คํธ ํ๋ ์๋น์ค๊ฐ ๋ง์์ง๋๋ง๋ค Hook ์์ ์ด๊ธฐํํ ๋์์ด ๋ง๊ฒ ๋ค๋ ์๊ฐ์ด ๋ค์์ด์. ํ์ฌ ๋ ๋ฒจ์์๋ 3๊ฐ ์๋น์ค ๋ฟ์ด๋ผ ํ๋์ Hook์ผ๋ก ๋์๋๋ฐ, ๋ณ๊ฐ์ Hook์ผ๋ก ๋๋๊ฒ ๋์์ง ์๊ฒฌ ์ฌ์ญค๋ด ๋๋ค~
๊ฐ์ธ์ ์ผ๋ก๋ Context์ kioskBaseUrl ์ฒ๋ผ ๊ด๋ฆฌํด์ฃผ๋ ๊ฒ๋ ์ข์ง๋ง ๋ฐ๋ก BaseUrl์ ์ ์ํ URL์ ์ฐ๋๋กํ๋ฉด
๋งค๋ฒ ์ฌ์ ์ํด์ค ํ์์์ด BaseUrl์ ์ ์ํ ๋ถ๋ถ์ผ๋ก ์ฌ์ฉํด์ค ์ ์์ ๊ฒ ๊ฐ์๋ฐ ์ด๋จ๊น์?
| - SPRING_PROFILES_ACTIVE=docker | ||
| # Database configuration for shared DB | ||
| - SPRING_DATASOURCE_URL=jdbc:mysql://atdd-db:3306/atdd?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Seoul | ||
| - SPRING_DATASOURCE_USERNAME=root | ||
| - SPRING_DATASOURCE_PASSWORD=secret | ||
| - SPRING_DATASOURCE_DRIVER_CLASS_NAME=com.mysql.cj.jdbc.Driver | ||
| - SPRING_JPA_DATABASE_PLATFORM=org.hibernate.dialect.MySQL8Dialect | ||
| - SPRING_JPA_HIBERNATE_DDL_AUTO=none |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ณตํต์ ์ผ๋ก ์ฌ์ฉํ ์ ์๋ ๋ถ๋ถ์ ๋ฌถ์ด์ ์ฌ์ฌ์ฉํด๋ณผ ์ ์๋๋ฐ ์ฐธ๊ณ ํด๋ณด์ธ์ :)
| @@ -0,0 +1,53 @@ | |||
| # Multi-stage build for Spring Boot application | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋์ปคํ์ผ ์ ๋ง๋ค์ด์ฃผ์
จ๋ค์ ๐
๋ค๋ฅธ ๋์ปคํ์ผ๊ณผ ํฌ๊ฒ ๋ค๋ฅธ ๋ถ๋ถ์ด ์๋ค๋ฉด ๊ณตํต์ผ๋ก ์ฌ์ฉํด๋ณผ ์ ์๋ ๋ฐฉ๋ฒ๋ ๊ณ ๋ คํด๋ณผ๋งํ ๊ฒ ๊ฐ์์!
| "https://github.com/next-step/atdd-camping-kiosk.git", | ||
| "repos/atdd-camping-kiosk" | ||
| // ํด๋ก ํ ์ ์ฅ์ ๋ชฉ๋ก | ||
| val repositories = listOf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ฐ์ ธ ์ฌ ๋ธ๋์น ๋ช ๋ ๊ฐ ์๋น์ค๋ณ๋ก ๋ฐ๋ก ๊ด๋ฆฌํด์ค๋ ์ข์ ๊ฒ ๊ฐ๋ค์ :)
| ./manage-services.sh status # ์ํ ํ์ธ | ||
| ./manage-services.sh restart # ์ฌ์์ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํด๋น ํ์ผ์ด ๋ณด์ด์ง ์๋ค์!
์ด ํ์ผ๋ค์ ์์
๋ clone๊ณผ ๋ง์ฐฌ๊ฐ์ง๋ก gradle task๋ก ์ฎ๊ฒจ๋ณด๋๊ฑด ์ด๋จ๊น์?
| @@ -1,4 +1,12 @@ | |||
| -- Create tables if not exist (so we can seed before apps start) | |||
| CREATE TABLE IF NOT EXISTS customers ( | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์๋น์ค์ ๋ง๊ฒ ํ์ํ ํ ์ด๋ธ ์ถ๊ฐ ๐
|
|
||
| @When("ํค์ค์คํฌ ์ํ ๋ชฉ๋ก์ ์กฐํํ๋ค") | ||
| public void ํค์ค์คํฌ์ํ๋ชฉ๋ก์์กฐํํ๋ค() { | ||
| lastResponse = getWithAuth(kioskBaseUrl, "/api/products", authToken); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํค์ค์คํฌ ์ํ ๋ชฉ๋ก ์กฐํ API์์ ์ธ์ฆ์ด ํ์ํ๊ฐ์?
ํน์ admin์ ์๋๊ฐ์?
๋ธ๋ผ์ด๋ ์๋ ํ์ธ์!
์ด๋ฒ ๋ฆฌ๋ทฐ๋ ์ ๋ถํ๋๋ฆฝ๋๋ค~
์ง๋ฌธ 1
Hooks์์ baseUrl์ ๊ณ์ ์ถ๊ฐํ๋๋ฐ ์ด ๊ฒฝ์ฐ, ํ ์คํธ ํ๋ ์๋น์ค๊ฐ ๋ง์์ง๋๋ง๋ค Hook ์์ ์ด๊ธฐํํ ๋์์ด ๋ง๊ฒ ๋ค๋ ์๊ฐ์ด ๋ค์์ด์. ํ์ฌ ๋ ๋ฒจ์์๋ 3๊ฐ ์๋น์ค ๋ฟ์ด๋ผ ํ๋์ Hook์ผ๋ก ๋์๋๋ฐ, ๋ณ๊ฐ์ Hook์ผ๋ก ๋๋๊ฒ ๋์์ง ์๊ฒฌ ์ฌ์ญค๋ด ๋๋ค~
์ง๋ฌธ 2
docker ๊ตฌ์ฑ์ด ์ต์ํ์ง ์์ cursor ์ ์์ ํ๋ฉฐ ์ฌ๋ฌ๋ฒ ์ํ์ฐฉ์ค๋ฅผ ๊ฒช์์ต๋๋ค ใ ใ
cursor ๊ฐ ์์ ํ ๋ด์ฉ์ ๋ํด ๊ธฐ์ ์ง์์ด ์ถฉ๋ถํ์ง ์์, ์ฝ๋๋ฅผ ๋ดค์๋ ์ข์ ์ฝ๋์ธ์ง ์ ๋งคํ ๊ฒฝ์ฐ, "์ด์ ๋๋ฉด ๋์๋ค" ๊ฒฐ์ ํ์๋ ๊ธฐ์ค์ ๊ฐ์ง๊ณ ๊ณ์ ์ง ๊ถ๊ธํฉ๋๋ค!
(ํ๋กฌํํธ ํ์ด๊ฒ ์ง๋ง...)
๊ฐ์ฌํฉ๋๋ค!