diff --git a/maeumgagym-infrastructure/src/test/kotlin/com/info/maeumgagym/domain/auth/AuthTestModule.kt b/maeumgagym-infrastructure/src/test/kotlin/com/info/maeumgagym/domain/auth/AuthTestModule.kt index 335efde71..b59dfa7ef 100644 --- a/maeumgagym-infrastructure/src/test/kotlin/com/info/maeumgagym/domain/auth/AuthTestModule.kt +++ b/maeumgagym-infrastructure/src/test/kotlin/com/info/maeumgagym/domain/auth/AuthTestModule.kt @@ -2,7 +2,6 @@ package com.info.maeumgagym.domain.auth import com.info.maeumgagym.domain.user.entity.UserJpaEntity import com.info.maeumgagym.domain.user.mapper.UserMapper -import com.info.maeumgagym.security.principle.CustomUserDetails import org.springframework.security.authentication.UsernamePasswordAuthenticationToken import org.springframework.security.core.context.SecurityContextHolder @@ -14,9 +13,7 @@ internal object AuthTestModule { fun UserJpaEntity.saveInContext(userMapper: UserMapper): UserJpaEntity = apply { SecurityContextHolder.getContext().authentication = - CustomUserDetails(userMapper.toDomain(this), this.oauthId).run { - UsernamePasswordAuthenticationToken(this, null, this.authorities) - } + UsernamePasswordAuthenticationToken(this.oauthId, null) } /**