[π μ¬μ΄ν΄2 - λ―Έμ (μμ½ λ³κ²½/μ·¨μμ μλ¬ μ²λ¦¬)] μλ¬ λ―Έμ μ μΆν©λλ€.#443
Open
jeonwonjun wants to merge 13 commits into
Open
[π μ¬μ΄ν΄2 - λ―Έμ
(μμ½ λ³κ²½/μ·¨μμ μλ¬ μ²λ¦¬)] μλ¬ λ―Έμ
μ μΆν©λλ€.#443jeonwonjun wants to merge 13 commits into
jeonwonjun wants to merge 13 commits into
Conversation
- μ§λ λ μ§, μκ°μ λν mockν μ€νΈ μΆκ° - μ΄λ―Έ μ‘΄μ¬νλ μμ½μ λν mockν μ€νΈ μΆκ°
- νμ¬ λ μ§ κΈ°μ€μΌλ‘ μ΄νμ΄κ³ , λ μ§κ° λμΌνλ€λ©΄ μκ°μ΄ μ΄νμΈ μμ½λ€κ³Ό λΉκ΅ν΄μ timeId μμ - λͺκ°μ§ λ³μλͺ μμ
- GlobalExceptionHandler μΆκ° - @Validμ λν κ²μ¦ - λ μ§ νμμ λν κ²μ¦
λ°©νμΆ λΉμ¦λμ€ λ‘μ§ κ΄λ¦¬ μμΈ
- μ§λ μκ°μ λν μμΈ - μ΄λ―Έ μ‘΄μ¬νλ μμ½μ λν μμΈ
- μμ΄λλ‘ μμ½ μ‘°νμ μλ¬μ²λ¦¬ - μ§λ μμ½μ λν λ³κ²½ λΆκ° - μ‘΄μ¬ν μμ½ λ μ§ λ° μκ°μΌλ‘ λ³κ²½ λΆκ°
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
μ²΄ν¬ λ¦¬μ€νΈ
testλ₯Ό μ€ννμ λ, λͺ¨λ ν μ€νΈκ° μ μμ μΌλ‘ ν΅κ³Όνλμ?λ² μ΄μ€ μ½λ μ ν 체ν¬
μ΄λ€ λΆλΆμ μ§μ€νμ¬ λ¦¬λ·°ν΄μΌ ν κΉμ?
μλ νμΈμ μλ§μ°!
μ΄λ² λ―Έμ μ Reservation μμ£Όλ‘ μμΈμ²λ¦¬λ₯Ό μ§ννμ΅λλ€. μΆν Theme, ReservationTimeμ λν΄μλ μμΈμ²λ¦¬ μ§νν μμ μ λλ€!
μ§λ¬Έμ μΈμ λ νμν©λλ€
μ΄λ² 리뷰λ μλΆνλλ €μ ππ»ββοΈ
κΆκΈν μ
1. ErrorResponseμ μ± μ λ²μ
νμ¬ ErrorResponseμμ μ¬μ©μμκ² λ€μ νλ(action)κΉμ§ μ λ¬ν μ§ κ³ λ―Όνμ΅λλ€.
λ€μ νλκΉμ§ μ λ¬νκ² λλ€λ©΄ μ μ°μ±μ΄ λ¨μ΄μ§κ³ , μμ μμ μ΄ λ°μν΄λ μλ²μ½λλ₯Ό μμ ν΄μΌνλ μΌμ΄ λ°μν κ² κ°μμ νμ¬λ code, messageλ§ μ λ¬νκ² νμ΅λλ€.
λ°±μλλ μλ¬ μμΈκΉμ§λ§ μ± μμ§κ³ , μ€μ μ¬μ©μ νλ μ λλ νλ‘ νΈμμ μ²λ¦¬νλ κ²μ΄ λ μμ°μ€λ¬μ΄ ꡬ쑰μΌκΉμ?
μμ
{ "code": "RESERVATION_ALREADY_EXISTS", "message": "μ΄λ―Έ μμ½λ μκ°μ λλ€." } vs { "code": "RESERVATION_ALREADY_EXISTS", "message": "μ΄λ―Έ μμ½μ΄ μ‘΄μ¬ν©λλ€.", "action": "λ€λ₯Έ μκ°μ μ νν΄μ£ΌμΈμ." }2. Service ν μ€νΈμ λ°©ν₯μ±
ReservationServiceTestμμ
λ³ΈμΈ_μμ½_λ³κ²½_μ±κ³΅κ³Ό κ°μμ±κ³΅ ν μ€νΈλ DAOμ μλ μ¬λΆκ° νμν ν μ€νΈλΌκ³ μκ°λ©λλ€.Service ν μ€νΈμμ μ€μ λ³κ²½ κ²°κ³ΌκΉμ§ κ²μ¦ν΄μΌ νλμ§,
μλλ©΄ μ μ± νλ¨ ν DAO νΈμΆ μ¬λΆλ§ κ²μ¦νλ κ²μ΄ λ μ μ νμ§ κ³ λ―Όμ λλ€.
μμ
3.
selectByIdμμ Optionalμ μ¬μ©νλ μ΄μκΈ°μ‘΄μλ queryForObject()λ₯Ό μ¬μ©νλλ°, Optionalμ λ°ννκΈ° μν΄ query() + findAny() λ°©μμΌλ‘ λ³κ²½νμ΅λλ€.
μ΄λ° λ°©μμ΄ μμ°μ€λ¬μ΄μ§ κΆκΈν©λλ€.
μμ