diff --git a/adapters/out-persistence/src/main/kotlin/com/pokit/out/persistence/user/persist/UserEntity.kt b/adapters/out-persistence/src/main/kotlin/com/pokit/out/persistence/user/persist/UserEntity.kt index e4552475..a34724b6 100644 --- a/adapters/out-persistence/src/main/kotlin/com/pokit/out/persistence/user/persist/UserEntity.kt +++ b/adapters/out-persistence/src/main/kotlin/com/pokit/out/persistence/user/persist/UserEntity.kt @@ -15,14 +15,14 @@ class UserEntity( val id: Long = 0L, @Column(name = "email") - val email: String, + val email: String = "EMAIL@EMAIL.COM", @Column(name = "role") @Enumerated(EnumType.STRING) val role: Role, @Column(name = "nickname") - var nickname: String = email, + var nickname: String = "NOT_REGISTERED", @Column(name = "auth_platform") @Enumerated(EnumType.STRING) diff --git a/application/src/main/kotlin/com/pokit/auth/port/service/AuthService.kt b/application/src/main/kotlin/com/pokit/auth/port/service/AuthService.kt index 3cecac09..12c5fc6d 100644 --- a/application/src/main/kotlin/com/pokit/auth/port/service/AuthService.kt +++ b/application/src/main/kotlin/com/pokit/auth/port/service/AuthService.kt @@ -65,7 +65,6 @@ class AuthService( private fun createUser(userInfo: UserInfo): User { val user = User( - email = userInfo.email!!, // 존재하지 않았던 유저면 이메일 항상 존재 role = Role.USER, authPlatform = userInfo.authPlatform, sub = userInfo.sub diff --git a/application/src/test/kotlin/com/pokit/auth/port/service/AuthServiceTest.kt b/application/src/test/kotlin/com/pokit/auth/port/service/AuthServiceTest.kt index 982cb4de..7306eef6 100644 --- a/application/src/test/kotlin/com/pokit/auth/port/service/AuthServiceTest.kt +++ b/application/src/test/kotlin/com/pokit/auth/port/service/AuthServiceTest.kt @@ -35,7 +35,7 @@ class AuthServiceTest : BehaviorSpec({ every { googleApiClient.getUserInfo(request.idToken) } returns userInfo every { - userPort.loadByEmailAndAuthPlatform(userInfo.email, AuthPlatform.of(request.authPlatform)) + userPort.loadByEmailAndAuthPlatform(userInfo.email!!, AuthPlatform.of(request.authPlatform)) } returns user every { userPort.loadById(user.id) } returns user every { tokenProvider.createToken(user.id) } returns token diff --git a/domain/src/main/kotlin/com/pokit/user/model/User.kt b/domain/src/main/kotlin/com/pokit/user/model/User.kt index 92ed9793..7b899ed1 100644 --- a/domain/src/main/kotlin/com/pokit/user/model/User.kt +++ b/domain/src/main/kotlin/com/pokit/user/model/User.kt @@ -7,9 +7,9 @@ import java.util.regex.Pattern data class User( val id: Long = 0L, - val email: String, + val email: String = "EMAIL@EMAIL.COM", val role: Role, - var nickName: String = email, + var nickName: String = "NOT_REGISTERED", val authPlatform: AuthPlatform, var registered: Boolean = false, var sub: String?