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

[출석 체크] test : 출석 체크 테스트(#89) #96

Closed
wants to merge 13 commits into from

Conversation

Minjae-An
Copy link
Contributor

작업 대상

출석 체크 단위 테스트, 통합 테스트

📄 작업 내용

출석 체크 단위 테스트, 통합 테스트 작성

🙋🏻 주의 사항

테스트 구성

  • 일각에선 @SpringBootTest를 통해 service layer + repository layer 형태로 통합 테스트를 구성하고, service layer 단위
    테스트를 별도로 작성하지 않는 경우 존재
  • 필자는 서비스 로직에 대한 단위 차원의 검증이 필요하다고 생각하여 service layer에 대한 단위 테스트를 따로 작성
  • 그리고, 통합 테스트는 @SpringBootTestMockMvc를 활용하여 실제 사용자 요청 처리 상황을 연출하는 형식으로 작성

사용자 최종 접속 일시 갱신 확인

  • 기존 로직에서는 출석 체크 날짜를 받아 로직 내부에서 사용자 최종 접속 일시를 갱신하는 형식
  • 사용자 최종 접속 일시가 출석 체크 여부와 관계 없이 갱신되었는 지 테스트하기 어려운 형태
  • 출석 체크 날짜가 아닌 일시를 비즈니스 로직에 전달하여 해당 일시로 사용자 최종 접속 일시를 갱신하도록 로직 변경

📎 관련 이슈

controller layer, 통합 테스트에서 인터셉터를 일단 배제하고 인가에 필요한 데이터(userId)를 직접 request attribute로 설정하는 형식으로 작성하였는데, 이것이 적절한 지 적절하지 않다면 어떤 식으로 구성하는 지 의견 주시면 감사하겠습니다.

레퍼런스

@Minjae-An Minjae-An added the 🧑‍💻 test 테스트 코드 작성 label May 26, 2024
@Minjae-An Minjae-An requested a review from acceptor-gyu May 26, 2024 07:19
@Minjae-An Minjae-An self-assigned this May 26, 2024
@Minjae-An Minjae-An linked an issue May 26, 2024 that may be closed by this pull request
@Minjae-An Minjae-An closed this May 26, 2024
@Minjae-An Minjae-An reopened this May 26, 2024
Minjae-An added 2 commits May 26, 2024 17:18
- 테스트 코드 실행시 기본 이름(default)의 FirebaseApp이 중복 생성되는 예외 발생
- 반드시 한 번만 초기화를 수행하도록 설정 변경
@Minjae-An Minjae-An removed the request for review from acceptor-gyu July 25, 2024 01:03
@Minjae-An Minjae-An closed this Jul 26, 2024
@Minjae-An Minjae-An deleted the test/#89-daily-check branch July 26, 2024 01:20
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.

[BE] test : 출석 체크 테스트
1 participant