From fafcc8e83dd05878a1daa211a3d8def68126efc3 Mon Sep 17 00:00:00 2001 From: San Kim Date: Sun, 27 Oct 2024 22:26:55 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Test=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - user 생성 시 검증 로직으로인해 user fixture 생성 오류 수정 --- .../auth/service/AuthCodeServiceTest.kt | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/application/src/test/kotlin/com/threedays/application/auth/service/AuthCodeServiceTest.kt b/application/src/test/kotlin/com/threedays/application/auth/service/AuthCodeServiceTest.kt index 885e851..c45df88 100644 --- a/application/src/test/kotlin/com/threedays/application/auth/service/AuthCodeServiceTest.kt +++ b/application/src/test/kotlin/com/threedays/application/auth/service/AuthCodeServiceTest.kt @@ -166,9 +166,21 @@ class AuthCodeServiceTest : DescribeSpec({ it("인증 코드 검증 시, AuthException.UserExistsException 예외를 발생시킨다") { // arrange val phoneNumber = PhoneNumber("01012345678") + val userProfile = fixtureMonkey + .giveMeBuilder() + .set(UserProfile::company, null) + .sample() + + val userDesiredPartner = fixtureMonkey + .giveMeBuilder() + .set(UserDesiredPartner::allowSameCompany, null) + .sample() + fixtureMonkey .giveMeBuilder() .set(User::phoneNumber, phoneNumber) + .set(User::profile, userProfile) + .set(User::desiredPartner, userDesiredPartner) .sample() .also { userRepository.save(it) } @@ -267,9 +279,21 @@ class AuthCodeServiceTest : DescribeSpec({ it("AccessToken과 RefreshToken을 생성하여 반환한다") { // arrange val phoneNumber = PhoneNumber("01012345678") + val userProfile = fixtureMonkey + .giveMeBuilder() + .set(UserProfile::company, null) + .sample() + + val userDesiredPartner = fixtureMonkey + .giveMeBuilder() + .set(UserDesiredPartner::allowSameCompany, null) + .sample() + fixtureMonkey .giveMeBuilder() .set(User::phoneNumber, phoneNumber) + .set(User::profile, userProfile) + .sample() .also { userRepository.save(it) }