refactor: 여행 정보 조회 시 getTrip → getValidTrip로 통합 리팩토링(#30)#31
Merged
refactor: 여행 정보 조회 시 getTrip → getValidTrip로 통합 리팩토링(#30)#31
Conversation
Contributor
chaiminwoo0223
left a comment
There was a problem hiding this comment.
고생 많으셨습니다. 코드 리뷰 확인해주시면 감사하겠습니다. 피드백도 부탁드려요~^^
src/test/java/com/ject/studytrip/trip/application/service/TripServiceTest.java
Outdated
Show resolved
Hide resolved
...test/java/com/ject/studytrip/trip/presentation/controller/TripControllerIntegrationTest.java
Outdated
Show resolved
Hide resolved
chaiminwoo0223
approved these changes
Jul 15, 2025
Contributor
chaiminwoo0223
left a comment
There was a problem hiding this comment.
변경된 내용 모두 확인했습니다. 머지 부탁드려요!
* refactor: 유효한 여행 정보가 필요한 로직에 getValidTrip() 메서드를 사용하도록 통일하고 중복된 검증 로직 제거 * test: 중복 검증 제거에 따라 TripServiceTest 내 관련 테스트 제거 * test: 여행 상세 조회 시 소유자 검증 테스트를 TripServiceTest 및 TripControllerIntegrationTest에 추가
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.
📌 작업 내용 및 특이사항
✅ 여행 조회 로직을 getValidTrip() 으로 통합
getTrip()메서드로 삭제 여부만 검증하고 소유자 검증은 각 기능에서 별도로 수행했지만, 중복된 코드를 줄이고 각 역할을 분리하기 위해getValidTrip()메서드 하나에서 삭제 여부 및 소유자 검증을 모두 수행하도록 변경하고, 검증된 여행 정보가 필요한 모든 곳에서getValidTrip()메서드를 사용하도록 리팩토링getValidTrip()메서드는 검증을 수행해 유효한 여행 정보 조회 역할을 담당하고,getTrip()메서드는 단순 여행 조회 용도로 역할을 분리✅ TripServiceTest 및 TripControllerIntegrationTest 수정
TripServiceTest내 관련 테스트 제거TripServiceTest및TripControllerIntegrationTest에 추가🌱 관련 이슈
🔍 참고사항(선택)
📚 기타(선택)