[DEV-178/BE] test: dashboard controller 통합 테스트 작성#375
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello @kckc0608, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 대시보드 기능의 견고성을 보장하기 위해 통합 테스트 스위트를 도입합니다. 이 테스트는 다양한 시나리오에서 대시보드 API의 동작을 검증하며, 테스트 과정에서 발견된 몇 가지 작은 로직 오류를 수정하여 전반적인 안정성을 향상시켰습니다. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
...end/src/test/java/com/shyashyashya/refit/interview/integration/DashboardIntegrationTest.java
Outdated
Show resolved
Hide resolved
| QnaSet difficultQna = QnaSet.create("Question 1", "Answer 1", true, interview, null); | ||
| QnaSet easyQna = QnaSet.create("Question 2", "Answer 2", false, interview, null); | ||
| qnaSetRepository.save(difficultQna); | ||
| qnaSetRepository.save(easyQna); |
There was a problem hiding this comment.
테스트 데이터 생성을 위해 qnaSetRepository를 직접 사용하고 있습니다. IntegrationTest 기본 클래스에 다른 엔티티들을 위한 createAndSave... 헬퍼 메서드가 있는 것처럼, QnaSet을 위한 헬퍼 메서드를 추가하면 테스트 코드의 일관성과 재사용성을 높일 수 있습니다.
IntegrationTest 클래스에 createAndSaveQnaSet과 같은 헬퍼 메서드를 만들고, 이 테스트 클래스에서는 해당 메서드를 호출하는 방식으로 리팩토링하는 것을 고려해보세요. 이렇게 하면 테스트 준비(given) 단계가 더 간결해지고, 다른 테스트에서도 쉽게 QnaSet 테스트 데이터를 생성할 수 있습니다.
| QnaSet difficultQna = QnaSet.create("Question 1", "Answer 1", true, interview, null); | |
| QnaSet easyQna = QnaSet.create("Question 2", "Answer 2", false, interview, null); | |
| qnaSetRepository.save(difficultQna); | |
| qnaSetRepository.save(easyQna); | |
| createAndSaveQnaSet("Question 1", "Answer 1", true, interview); | |
| createAndSaveQnaSet("Question 2", "Answer 2", false, interview); |
관련 이슈
close #251
작업한 내용
PR 리뷰시 참고할 사항
참고 자료 (링크, 사진, 예시 코드 등)