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

[Feat] #259 - KeyResultService 테스트 코드 작성 #260

Merged
merged 4 commits into from
Apr 1, 2024

Conversation

its-sky
Copy link
Member

@its-sky its-sky commented Apr 1, 2024

🚀PullRequest🚀

📟 관련 이슈

💻 작업 내용

KeyResultService 테스트 코드 작성을 하였습니다.

기존 ObjectiveService 테스트 코드와 다른 점은 given 절에 BDDMockito를 추가하여 좀 더 직관적인 테스팅 코드를 작성하였습니다.
테스트 코드에서 JPA에 의존하는 메소드 로직은 테스트 검증에서 뺐습니다. 또한 삭제하는 메소드도 JPA에 의존적이라고 판단하여 단위 테스트 코드에서는 뺐습니다. 추후 통합 테스트를 진행할 때 테스트를 진행하도록 하겠습니다!

📝 리뷰 노트

테스트 로직이 KeyResultService를 무결하게 테스트하지 않는다고 생각하시는 경우에 어떤 부분을 보완하면 좋을지 알려주시면 감사하겠습니다~

🧪 테스트 결과

image

@its-sky its-sky requested a review from 0lynny April 1, 2024 13:42
@its-sky its-sky self-assigned this Apr 1, 2024
Copy link
Member

@0lynny 0lynny left a comment

Choose a reason for hiding this comment

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

테스트 코드 작성 수고 많으셨습니다 ~ 저도 후딱 공부해서 짜볼게요 ...

public Log createUpdateLog(final KeyResultModifyRequestDto request, final Long keyResultId) {
KeyResult keyResult = keyResultRepository.findById(keyResultId)
.orElseThrow(() -> new NotFoundException(NOT_FOUND_KEY_RESULT));
public Log createUpdateLog(final KeyResultModifyRequestDto request, final KeyResult keyResult) {
Copy link
Member

Choose a reason for hiding this comment

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

p5;
이미 위에서 조회했으니 이렇게 해주었으면 됐었군요 !

@its-sky its-sky merged commit 5003db9 into develop Apr 1, 2024
1 check passed
@its-sky its-sky deleted the feature/#259 branch May 29, 2024 15:43
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.

[Feat] KeyResultService 테스트 코드 작성
2 participants