Skip to content

Conversation

@JIWONKIMS
Copy link
Collaborator

@JIWONKIMS JIWONKIMS commented Oct 10, 2025

Close #104

Summary

WeatherApiClientTest를 통합 테스트에서 MockMvc 기반 컨트롤러 테스트로 전환합니다.

Changes

  • @MockitoBean 추가: WeatherService를 mock하여 실제 API 호출 제거
  • @AutoConfigureMockMvc(addFilters = false): Security 필터 비활성화
  • MockMvc 사용: /weather/test1, /weather/test2 엔드포인트 테스트
  • Mock 데이터로 MidForecastDto, TemperatureAndLandForecastDto 생성

Benefits

  • ✅ 실제 기상청 API 의존성 제거 → 테스트 안정성 향상
  • ✅ 테스트 실행 속도 개선
  • ✅ 외부 API 장애 시에도 테스트 통과

Test plan

  • ktlint 체크 통과
  • 로컬 테스트 실행 확인
  • CI 테스트 통과 확인

🤖 Generated with Claude Code

- Change from integration test to controller test using MockMvc
- Add @MockitoBean for WeatherService to avoid real API calls
- Add @AutoConfigureMockMvc(addFilters = false) to bypass security filters
- Mock test data for MidForecastDto and TemperatureAndLandForecastDto
- Update imports to use MockMvc request builders and matchers

This improves test speed and reliability by removing external API dependencies.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Copy link
Collaborator

@YangHJ2415 YangHJ2415 left a comment

Choose a reason for hiding this comment

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

확인했습니다!

@YangHJ2415 YangHJ2415 merged commit de4cb70 into main Oct 10, 2025
1 check passed
@JIWONKIMS JIWONKIMS deleted the refeat/be/104 branch October 10, 2025 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

weather api 테스트 재작성

3 participants