Skip to content

Commit

Permalink
πŸ› Test 였λ₯˜ μˆ˜μ •
Browse files Browse the repository at this point in the history
- user 생성 μ‹œ 검증 λ‘œμ§μœΌλ‘œμΈν•΄ user fixture 생성 였λ₯˜ μˆ˜μ •
  • Loading branch information
waterfogSW committed Oct 27, 2024
1 parent 2ffc510 commit fafcc8e
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,21 @@ class AuthCodeServiceTest : DescribeSpec({
it("인증 μ½”λ“œ 검증 μ‹œ, AuthException.UserExistsException μ˜ˆμ™Έλ₯Ό λ°œμƒμ‹œν‚¨λ‹€") {
// arrange
val phoneNumber = PhoneNumber("01012345678")
val userProfile = fixtureMonkey
.giveMeBuilder<UserProfile>()
.set(UserProfile::company, null)
.sample()

val userDesiredPartner = fixtureMonkey
.giveMeBuilder<UserDesiredPartner>()
.set(UserDesiredPartner::allowSameCompany, null)
.sample()

fixtureMonkey
.giveMeBuilder<User>()
.set(User::phoneNumber, phoneNumber)
.set(User::profile, userProfile)
.set(User::desiredPartner, userDesiredPartner)
.sample()
.also { userRepository.save(it) }

Expand Down Expand Up @@ -267,9 +279,21 @@ class AuthCodeServiceTest : DescribeSpec({
it("AccessTokenκ³Ό RefreshToken을 μƒμ„±ν•˜μ—¬ λ°˜ν™˜ν•œλ‹€") {
// arrange
val phoneNumber = PhoneNumber("01012345678")
val userProfile = fixtureMonkey
.giveMeBuilder<UserProfile>()
.set(UserProfile::company, null)
.sample()

val userDesiredPartner = fixtureMonkey
.giveMeBuilder<UserDesiredPartner>()
.set(UserDesiredPartner::allowSameCompany, null)
.sample()

fixtureMonkey
.giveMeBuilder<User>()
.set(User::phoneNumber, phoneNumber)
.set(User::profile, userProfile)

.sample()
.also { userRepository.save(it) }

Expand Down

0 comments on commit fafcc8e

Please sign in to comment.