-
Notifications
You must be signed in to change notification settings - Fork 0
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
[BG-200]: 테스트 fixture 리팩토링 (5h / 3h) #14
Conversation
@@ -13,8 +14,9 @@ data class GoogleUserInfoDto( | |||
val givenName: String, | |||
val picture: String, | |||
) { | |||
fun toDomain(): User = | |||
fun toDomain(idPublisher: IdPublisher): User = |
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.
우리 유저쪽 ID어떻게 될지 모르니까 일단 추상화 시켜놨는데 어떨까??
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.
이건 좋아!!! 👍
class UUIDIdPublisher : IdPublisher { | ||
override fun publishId(): String = UUID.randomUUID().toString() | ||
} |
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.
지금은 그 유저 식별자 퍼블리싱하는 거 기본 구현체로 UUID
로 발행하는데 나중에 정해지면 여기서 발행하면 될 것 같아서
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.
좋아좋아 다음에 쉽게 바꿀수 있을듯
근데 우리가 사용하는 IdPublisher가 유저 하나만 있을까 싶기도 한데
그럼 팩토리 패턴? 을 사용해야 될까싶네
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.
으음... 일단 오케 일단은 우리가 직접 설계한 키를 사용하는 도메인이 user
밖에 없으니까 간단하게 이렇게 처리하긴 했는데
지금 당장하기보단 키 설계를 해야하는 다른 도메인 개발이 들어갈 때 처리하면 되지 않을까??
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.
좋아좋아!! 👍
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.
첫 번째 커밋 e368e6e890f519ea5060066f4bc8af8283012138
이건 유저 식별자 String
으로 변환하는 부분인데 이게 대부분 fileChanged 차지하는거라 그거 제외하고 봐주는게 좋을 것 같아!
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.
👍
api/src/test/kotlin/com/backgu/amaker/common/annotation/IntegrationTestComponent.kt
Outdated
Show resolved
Hide resolved
domain/src/main/kotlin/com/backgu/amaker/user/jpa/UserEntity.kt
Outdated
Show resolved
Hide resolved
api/src/test/kotlin/com/backgu/amaker/fixture/WorkspaceFixture.kt
Outdated
Show resolved
Hide resolved
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.
👍
Why
간단하게 테스트 픽스처만 리팩토링하려고 했는데,
user의 식별자를
UUID
에서String
으로 수정하면서 작업양이 많아짐Result
Prize
setup
메서드를 따로 만들어 주었다.given
이 보여지는 것이 좋다고 생각하여 이렇게 구성하였다.Link
BG-200