-
Notifications
You must be signed in to change notification settings - Fork 8
refactor: 성적 관련 통합 테스트 데이터 fixture 메서드로 변경 #325
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
Merged
Gyuhyeok99
merged 11 commits into
solid-connection:develop
from
Gyuhyeok99:refactor/321-score-test-fixture-module
May 21, 2025
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
93805c3
feat: GpaScoreFixture에 GPA점수 생성 메서드 추가
Gyuhyeok99 d41f6b5
refactor: GPA점수 데이터 Fixture 메서드로 변경
Gyuhyeok99 ae730bb
fix: 양방향 연관관계 추가
Gyuhyeok99 c82688c
refacotr: GPA_점수로 함수명 변경
Gyuhyeok99 1270d2e
feat: LanguageTestScoreFixture에 어학점수 생성 메서드 추가
Gyuhyeok99 69d4c67
refactor: 어학점수 데이터 Fixture 메서드로 변경
Gyuhyeok99 3e49fb0
test: score 관련 테스트에서 상세 필드 검증 제거
Gyuhyeok99 e778155
test: 어학 점수 fixture 어학 타입 및 점수 파라미터 제거
Gyuhyeok99 da38921
test: GPA 점수 fixture GPA 타입 및 점수 파라미터 제거
Gyuhyeok99 e5f5aa2
refactor: 변수명 순서 오름차순으로 변경
Gyuhyeok99 8ca6823
refactor: 점수 목록 조회 검증 시 닉네임과 상태 추가
Gyuhyeok99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/test/java/com/example/solidconnection/score/fixture/GpaScoreFixture.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| package com.example.solidconnection.score.fixture; | ||
|
|
||
| import com.example.solidconnection.application.domain.Gpa; | ||
| import com.example.solidconnection.application.domain.VerifyStatus; | ||
| import com.example.solidconnection.score.domain.GpaScore; | ||
| import com.example.solidconnection.siteuser.domain.SiteUser; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.boot.test.context.TestComponent; | ||
|
|
||
| @TestComponent | ||
| @RequiredArgsConstructor | ||
| public class GpaScoreFixture { | ||
|
|
||
| private final GpaScoreFixtureBuilder gpaScoreFixtureBuilder; | ||
|
|
||
| public GpaScore GPA_점수 (VerifyStatus verifyStatus, SiteUser siteUser) { | ||
| return gpaScoreFixtureBuilder.gpaScore() | ||
| .gpa(new Gpa(4.0, 4.5, "/gpa-report.pdf")) | ||
| .verifyStatus(verifyStatus) | ||
| .siteUser(siteUser) | ||
| .create(); | ||
| } | ||
| } |
46 changes: 46 additions & 0 deletions
46
src/test/java/com/example/solidconnection/score/fixture/GpaScoreFixtureBuilder.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| package com.example.solidconnection.score.fixture; | ||
|
|
||
| import com.example.solidconnection.application.domain.Gpa; | ||
| import com.example.solidconnection.application.domain.VerifyStatus; | ||
| import com.example.solidconnection.score.domain.GpaScore; | ||
| import com.example.solidconnection.score.repository.GpaScoreRepository; | ||
| import com.example.solidconnection.siteuser.domain.SiteUser; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.boot.test.context.TestComponent; | ||
|
|
||
| @TestComponent | ||
| @RequiredArgsConstructor | ||
| public class GpaScoreFixtureBuilder { | ||
|
|
||
| private final GpaScoreRepository gpaScoreRepository; | ||
|
|
||
| private Gpa gpa; | ||
| private VerifyStatus verifyStatus; | ||
| private SiteUser siteUser; | ||
|
|
||
| public GpaScoreFixtureBuilder gpaScore() { | ||
| return new GpaScoreFixtureBuilder(gpaScoreRepository); | ||
| } | ||
|
|
||
| public GpaScoreFixtureBuilder gpa(Gpa gpa) { | ||
| this.gpa = gpa; | ||
| return this; | ||
| } | ||
|
|
||
| public GpaScoreFixtureBuilder verifyStatus(VerifyStatus verifyStatus) { | ||
| this.verifyStatus = verifyStatus; | ||
| return this; | ||
| } | ||
|
|
||
| public GpaScoreFixtureBuilder siteUser(SiteUser siteUser) { | ||
| this.siteUser = siteUser; | ||
| return this; | ||
| } | ||
|
|
||
| public GpaScore create() { | ||
| GpaScore gpaScore = new GpaScore(gpa, siteUser); | ||
| gpaScore.setSiteUser(siteUser); | ||
| gpaScore.setVerifyStatus(verifyStatus); | ||
| return gpaScoreRepository.save(gpaScore); | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 테스트 코드에서 검증하려는 것은, "verifyStatus으로 조회했을 때 잘 되는가?" 라고 생각해요.
아래와 같이 응답의 모든 status가 PENDIND임을 확인해주는게 필요할 것 같습니다.
다른곳들도 마찬가지이고요! 🫨
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그렇네요 좋은 거 같습니다! 추가로 닉네임으로 검증하는 것도 필요할 거 같아서 그것만 추가해주었습니다!
(8ca6823)