Skip to content
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

refactor: 소요시간 계산 외부 api 의존성 낮추기 #555

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

hyeon0208
Copy link
Contributor

@hyeon0208 hyeon0208 commented Sep 22, 2024

🚩 연관 이슈

close #521


📝 작업 내용

Google Distance Matrix API를 사용하는 RouteClient 구현체를 추가해
OdsayRouteClient에 장애가 발생하면 GoogleRouteClient로 소요시간을 계산할 수 있도록 의존성을 낮췄습니다.

GoogleRouteClient 구현은
아래 API 가이드 문서를 참고했습니다.
Google Distance Matrix API 가이드

  • 추가로 RouteClient의 구현체를 추가하면서 @RestClientTest를 상뇽하던 OdsayRouteClientTest에서 사용하고 있던 에서
    테스트할 구현체의 Bean을 지정해주어도 모든 구현체들을 구성으로 등록하려해 에러가 발생했어요
    그래서 해당 테스트를 실행가능하도록 설정 부분을 수정했습니다

🏞️ 스크린샷 (선택)


🗣️ 리뷰 요구사항 (선택)

Copy link

github-actions bot commented Sep 22, 2024

Test Results

146 tests  +5   139 ✅ +5   4s ⏱️ -1s
 44 suites +2     7 💤 ±0 
 44 files   +2     0 ❌ ±0 

Results for commit e4a93a2. ± Comparison against base commit 587cfb9.

This pull request removes 6 and adds 11 tests. Note that renamed tests count towards both.
com.ody.auth.JwtTokenProviderTest$validateAccessToken ‑ [1] accessToken=com.ody.auth.token.AccessToken@5d80ad22
com.ody.auth.JwtTokenProviderTest$validateAccessToken ‑ [2] accessToken=com.ody.auth.token.AccessToken@7b672be5
com.ody.common.validator.FutureOrPresentDateTimeValidatorTest ‑ [1] date=2024-09-22, time=04:54:44.016305434, expected=false
com.ody.common.validator.FutureOrPresentDateTimeValidatorTest ‑ [2] date=2024-09-22, time=05:54:44.016346221, expected=true
com.ody.common.validator.FutureOrPresentDateTimeValidatorTest ‑ [3] date=2024-09-22, time=03:54:44.016331483, expected=false
com.ody.common.validator.FutureOrPresentDateTimeValidatorTest ‑ [4] date=2024-09-23, time=04:54:44.016305434, expected=true
com.ody.auth.JwtTokenProviderTest$validateAccessToken ‑ [1] accessToken=com.ody.auth.token.AccessToken@3c1a3112
com.ody.auth.JwtTokenProviderTest$validateAccessToken ‑ [2] accessToken=com.ody.auth.token.AccessToken@16f0168b
com.ody.common.validator.FutureOrPresentDateTimeValidatorTest ‑ [1] date=2024-09-22, time=11:26:29.642070471, expected=false
com.ody.common.validator.FutureOrPresentDateTimeValidatorTest ‑ [2] date=2024-09-22, time=12:26:29.642099876, expected=true
com.ody.common.validator.FutureOrPresentDateTimeValidatorTest ‑ [3] date=2024-09-22, time=10:26:29.642087383, expected=false
com.ody.common.validator.FutureOrPresentDateTimeValidatorTest ‑ [4] date=2024-09-23, time=11:26:29.642070471, expected=true
com.ody.route.service.GoogleRouteClientTest ‑ 버스, 지하철을 이용한 소요시간 계산 요청 성공 시, 가장 빠른 소요 시간을 분으로 변환하여 반환한다.
com.ody.route.service.GoogleRouteClientTest ‑ 서비스의 상태가 OK가 아니라면 서버 에러가 발생한다.
com.ody.route.service.GoogleRouteClientTest ‑ 응답 요소의 상태가 OK가 아니라면 클라이언트 에러가 발생한다.
com.ody.route.service.RouteServiceTest ‑ OdsayRouteClient에 에러가 발생하면 그 다음 요소인 Google API를 사용해 소요시간을 반환한다.
…

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Sep 22, 2024

📝 Test Coverage Report

Overall Project 80.49% -0.41% 🍏
Files changed 94.26% 🍏

File Coverage
GoogleRouteClient.java 100% 🍏
DistanceMatrixStatus.java 100% 🍏
DistanceMatrixElementStatus.java 100% 🍏
DistanceMatrixResponse.java 87.5% -12.5% 🍏
RouteService.java 84.31% -15.69% 🍏
RouteConfig.java 0% -15%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor: 소요시간 계산 외부 api 의존성 낮추기
1 participant