Skip to content

Commit

Permalink
REFACT :: 테스트 코드에 변경점 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
Daybreak312 committed Mar 20, 2024
1 parent 92bf9f5 commit f151df1
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
}

/**
Expand Down

0 comments on commit f151df1

Please sign in to comment.