Skip to content

Commit

Permalink
style: (#210) 변수 이름 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
khcho0125 committed Dec 11, 2022
1 parent b13af1c commit 2f371ad
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ import team.comit.simtong.global.annotation.ReadOnlyUseCase
@ReadOnlyUseCase
class UserInfoUseCase(
private val queryUserPort: QueryUserPort,
private val userSecurityPort: UserSecurityPort,
private val userQuerySpotPort: UserQuerySpotPort
private val securityPort: UserSecurityPort,
private val querySpotPort: UserQuerySpotPort
) {

fun execute(): UserInfoResponse {
val currentUserId = userSecurityPort.getCurrentUserId()
val currentUserId = securityPort.getCurrentUserId()

val user = queryUserPort.queryUserById(currentUserId) ?: throw UserNotFoundException.EXCEPTION
val spot = userQuerySpotPort.querySpotById(user.spotId) ?: throw SpotNotFoundException.EXCEPTION
val spot = querySpotPort.querySpotById(user.spotId) ?: throw SpotNotFoundException.EXCEPTION

return UserInfoResponse(
name = user.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ class UserInfoUseCaseTests {
private lateinit var queryUserPort: QueryUserPort

@MockBean
private lateinit var userSecurityPort: UserSecurityPort
private lateinit var securityPort: UserSecurityPort

@MockBean
private lateinit var userQuerySpotPort: UserQuerySpotPort
private lateinit var querySpotPort: UserQuerySpotPort

private lateinit var userInfoUseCase: UserInfoUseCase

Expand Down Expand Up @@ -79,21 +79,21 @@ class UserInfoUseCaseTests {
fun setUp() {
userInfoUseCase = UserInfoUseCase(
queryUserPort,
userSecurityPort,
userQuerySpotPort
securityPort,
querySpotPort
)
}

@Test
fun `사용자 정보 보기`() {
// given
given(userSecurityPort.getCurrentUserId())
given(securityPort.getCurrentUserId())
.willReturn(id)

given(queryUserPort.queryUserById(id))
.willReturn(userStub)

given(userQuerySpotPort.querySpotById(id))
given(querySpotPort.querySpotById(id))
.willReturn(spotStub)

// when
Expand All @@ -106,7 +106,7 @@ class UserInfoUseCaseTests {
@Test
fun `유저 찾기 실패`() {
// given
given(userSecurityPort.getCurrentUserId())
given(securityPort.getCurrentUserId())
.willReturn(id)

given(queryUserPort.queryUserById(id))
Expand All @@ -121,13 +121,13 @@ class UserInfoUseCaseTests {
@Test
fun `지점 찾기 실패`() {
// given
given(userSecurityPort.getCurrentUserId())
given(securityPort.getCurrentUserId())
.willReturn(id)

given(queryUserPort.queryUserById(id))
.willReturn(userStub)

given(userQuerySpotPort.querySpotById(id))
given(querySpotPort.querySpotById(id))
.willReturn(null)

// when & then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import javax.validation.constraints.Pattern
class WebUserAdapter(
private val signUpUseCase: SignUpUseCase,
private val signInUseCase: SignInUseCase,
private val getInfoUseCase: UserInfoUseCase,
private val userInfoUseCase: UserInfoUseCase,
private val changeEmailUseCase: ChangeEmailUseCase,
private val changeNicknameUseCase: ChangeNicknameUseCase,
private val changeProfileImageUseCase: ChangeProfileImageUseCase,
Expand Down Expand Up @@ -88,8 +88,8 @@ class WebUserAdapter(
}

@GetMapping("/information")
fun getMyInfo(): UserInfoResponse {
return getInfoUseCase.execute()
fun getUserInfo(): UserInfoResponse {
return userInfoUseCase.execute()
}

@PutMapping("/nickname")
Expand Down

0 comments on commit 2f371ad

Please sign in to comment.