Skip to content

[FEAT] restaurant-service 배포환경 API 시나리오 테스트 추가 - #64

Merged
jihxonx merged 2 commits into
devfrom
feat/63-restaurant-service-prod-e2e-timezone
May 19, 2026
Merged

jihxonx merged 2 commits into
devfrom
feat/63-restaurant-service-prod-e2e-timezone

Conversation

@jihxonx

@jihxonx jihxonx commented May 19, 2026

Copy link
Copy Markdown
Contributor

📝 작업 내용

이번 PR에서 작업한 내용을 설명해주세요.

  • restaurant-service 배포환경 API 시나리오 테스트용 HTTP Client 파일을 추가

🚀 주요 변경 사항

완료한 이슈 번호
Close #63
관련된 이슈 번호 (닫고 싶지 않은 경우)
Related to #

✅ 자체 체크리스트 (필수)

  • ./gradlew build 실행 결과 정상 (인증샷 첨부)
  • IntelliJ HTTP Client 테스트 완료 (인증샷 첨부)
  • 팀 내 컨벤션 준수 및 불필요한 로그, import 제거
  • 중요한 변경 사항이 팀에 공유되었는지

📸 테스트 인증샷

빌드 결과 및 IntelliJ HTTP Client 실행 화면을 여기에 첨부해 주세요.

💬 리뷰어 전달사항 (선택)

특별히 봐주었으면 하는 부분이나 논의가 필요한 점을 적어주세요.

  • 논의점


📎 참고 자료

관련 문서, 레퍼런스 링크 등이 있다면 여기에 첨부해주세요.

Summary by CodeRabbit

릴리스 노트

  • Tests
    • E2E 체크인 테스트 시나리오 업데이트 (시간대 설정, 테스트 데이터, 에러 처리 개선)
    • 새로운 레스토랑 API 시나리오 테스트 추가 (계정 관리, 식당 및 코스 등록, 검색 및 조회 기능 포함)

Review Change Stack

@jihxonx jihxonx self-assigned this May 19, 2026
@jihxonx jihxonx added the test 테스트 코드 및 검증 작업 label May 19, 2026
@jihxonx jihxonx linked an issue May 19, 2026 that may be closed by this pull request
7 tasks
@coderabbitai

coderabbitai Bot commented May 19, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

두 개의 E2E 테스트 시나리오가 변경됨. 기존 체크인 E2E 테스트는 Asia/Seoul 타임존으로 갱신되고 슬롯 선택·대기열 폴링·예약 흐름이 정교해짐. 새로운 레스토랑 API 시나리오는 소유자 등록부터 사용자 조회까지 전체 흐름을 테스트하며 다중 토큰 형식 추출과 에러 검증을 포함함.

Changes

E2E 체크인 및 레스토랑 API 시나리오 테스트

Layer / File(s) Summary
체크인 E2E 사전 조건 및 초기화
src/test/mvp/prod-full-checkin-e2e.http
실행 전제를 Asia/Seoul 기준으로 정정하고, 테스트 계정·식당·코스·시간 파라미터를 새 값으로 교체. Actuator health 호출 후 타임슬롯·대기열·예약 관련 전역 변수를 초기화하는 STEP RESET 블록 추가.
슬롯 생성 및 선택 조건부 처리
src/test/mvp/prod-full-checkin-e2e.http
STEP 7 일괄 생성이 200/201/409를 허용하고, 409일 때는 로그 안내 후 STEP 8 조회로 진행. STEP 8에서 선택된 슬롯 정보를 파일 상단에 수동 입력하도록 안내하는 로그 메시지 추가.
대기열 폴링 및 예약 토큰 명확화
src/test/mvp/prod-full-checkin-e2e.http
STEP 10 폴링 설명을 "ACTIVE 상태와 accessToken 수신까지" 로 정정. STEP 11에서 X-Waiting-Token이 queueToken이 아닌 waitingAccessToken을 사용함을 명시. 체크인 조건과 중복 호출 기대값 주석 갱신.
레스토랑 API 시나리오 초기화 및 헬스 체크
src/test/mvp/prod-restaurant-api-scenario.http
Gateway SSH 터널과 테스트 목적 주석 추가. 글로벌 변수(ownerToken, userToken, restaurantId, courseId)와 테스트 URL/계정 파라미터 선언. Actuator health 엔드포인트 호출 및 HTTP 200 검증.
소유자 등록 및 레스토랑·코스 설정
src/test/mvp/prod-restaurant-api-scenario.http
OWNER 회원가입(200/201/409 허용)과 로그인으로 응답의 다중 토큰 필드(data.accessToken, data.token, accessToken, token)에서 순차적으로 토큰 추출. OWNER 토큰으로 식당 등록 및 restaurantId 저장, 코스 등록 및 courseId 저장.
사용자 등록 및 식당·코스 조회 검증
src/test/mvp/prod-restaurant-api-scenario.http
USER 회원가입과 로그인(OWNER와 동일 토큰 추출 방식). USER 토큰으로 식당 목록/검색, 식당 상세 조회(restaurantId 일치도 검증), 코스 목록 조회(배열 및 최소 1개 검증). 존재하지 않는 식당 ID로 4xx/5xx와 success===false 검증.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Miche-Let/restaurant-service#62: 동일 파일의 체크인 E2E STEP 흐름(특히 대기열 ACTIVE 조건, waitingAccessToken 사용, X-Waiting-Token 처리, 중복 체크인 기대값)을 구체적으로 수정하여 직접 연관.

Suggested reviewers

  • Sehi55
  • githyj-jang
  • ji-circle
  • Jinyoung-Kim96
  • qldo

Poem

🐰 E2E 테스트 정리해주니 반갑네,
서울 시간으로 기준 맞춰지고,
토큰도 명확히, 흐름도 정교해,
예약부터 체크인까지 한 줄로 쭉!
식당도 떴으니 API 검증 준비 완료. 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 메인 변경사항을 명확하게 요약하고 있습니다. restaurant-service 배포환경 API 시나리오 테스트 추가라는 핵심 변경사항을 간결하게 표현합니다.
Linked Issues check ✅ Passed PR의 변경사항들이 #63 이슈의 모든 주요 요구사항을 충족합니다. 시간 기준 수정(Asia/Seoul), 테스트 계정/식당/코스 값 변경, 예약/슬롯 시간 조정, 전역 변수 초기화 등이 모두 구현되었습니다.
Out of Scope Changes check ✅ Passed 변경사항들이 모두 #63 이슈의 범위 내에 포함됩니다. 기존 체크인 E2E 파일 수정과 새로운 restaurant API 시나리오 테스트 추가는 모두 배포환경 E2E 테스트 개선이라는 목표에 부합합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/63-restaurant-service-prod-e2e-timezone

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/test/mvp/prod-full-checkin-e2e.http`:
- Around line 430-434: The test's STEP 8 only logs selected.startTime which can
be undefined because the response may use slot.slotStartTime; update the logging
so `@selectedSlotStartTime` always gets a value by using selected.startTime
fallback to selected.slotStartTime (or vice versa) where the logs are emitted
(the block that checks if (selected) and calls client.log for `@timeSlotId` and
`@selectedSlotStartTime`), ensuring you reference both selected.startTime and
selected.slotStartTime so the variable is never undefined.
- Around line 376-389: The test currently treats any 409 as a successful path
which can mask other conflicts; in the client.test "타임슬롯 일괄 생성 또는 기존 슬롯 존재 확인"
change the 409 branch to assert the conflict is the expected TS_008 case (e.g.
assert response.body.code === "TS_008" or response.body.errorCode === "TS_008"
depending on your API) and only log/continue when that check passes, otherwise
fail the test; keep the existing assert(response.body.success === true) for
non-409 responses and ensure you reference response.status and
response.body.code/errorCode in the checks.

In `@src/test/mvp/prod-restaurant-api-scenario.http`:
- Around line 16-27: The file contains hardcoded production credentials
(`@ownerLoginId`, `@ownerPassword`, `@ownerName`, `@ownerEmail`, `@ownerPhone` and
`@userLoginId`, `@userPassword`, `@userName`, `@userEmail`, `@userPhone`); remove these
literal values from src/test/mvp/prod-restaurant-api-scenario.http and replace
them with environment-backed placeholders (e.g., reference keys that map to
http-client.private.env.json or process/CI secrets), update the repo to read
those values at runtime and ensure http-client.private.env.json is gitignored
(or instruct CI to inject the secrets) so credentials are never committed to
source control.
- Around line 318-321: The test in client.test currently only asserts
response.body exists but allows an empty array; update the assertion to verify
the created restaurant is present by checking response.body.data contains the
previously created restaurantId (use response.body.data.some(item => item.id ===
restaurantId) or equivalent) and fail the test if not found; keep this check
inside the same client.test block that reads response.status and response.body
to ensure the scenario verifies the newly created restaurant is returned.
- Around line 354-358: The test currently only checks that response.body.data is
a non-empty array; add an assertion to verify the created course appears in the
results by checking that some item in response.body.data has id ===
createdCourseId (or the appropriate key used for course id), e.g., use
Array.prototype.some on response.body.data to assert presence of createdCourseId
so the test fails if the created course is not returned; update the client.test
block (the handler using client.test, response, and response.body.data) to
include this additional assertion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f8c24d7f-32e7-419c-b434-a8d6e546f333

📥 Commits

Reviewing files that changed from the base of the PR and between f44fb30 and d5bdea5.

📒 Files selected for processing (2)
  • src/test/mvp/prod-full-checkin-e2e.http
  • src/test/mvp/prod-restaurant-api-scenario.http

Comment thread src/test/mvp/prod-full-checkin-e2e.http
Comment thread src/test/mvp/prod-full-checkin-e2e.http
Comment thread src/test/mvp/prod-restaurant-api-scenario.http
Comment thread src/test/mvp/prod-restaurant-api-scenario.http
Comment thread src/test/mvp/prod-restaurant-api-scenario.http

@qldo qldo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인하였습니다

@jihxonx
jihxonx merged commit e9c2597 into dev May 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test 테스트 코드 및 검증 작업

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] restaurant-service 배포환경 E2E 테스트 시간 기준 수정

2 participants