Skip to content

Commit

Permalink
test: (#286) 테스트 코드 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
softpeanut committed Jan 10, 2023
1 parent 49095d8 commit 69a98f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ChangeIndividualScheduleUseCaseTest {
password = "test password",
employeeNumber = 1234567890,
authority = Authority.ROLE_COMMON,
spotId = UUID.randomUUID(),
spotId = spotId,
teamId = UUID.randomUUID(),
profileImagePath = "test profile image"
)
Expand Down Expand Up @@ -112,35 +112,6 @@ class ChangeIndividualScheduleUseCaseTest {
}
}

@Test
fun `소유자가 아님`() {
// given
val otherScheduleStub = Schedule(
id = scheduleId,
userId = UUID.randomUUID(),
spotId = spotId,
title = "test title",
scope = Scope.INDIVIDUAL,
startAt = LocalDate.now(),
endAt = LocalDate.now(),
alarmTime = Schedule.DEFAULT_ALARM_TIME
)

given(securityPort.getCurrentUserId())
.willReturn(userId)

given(querySchedulePort.queryScheduleById(requestStub.scheduleId))
.willReturn(otherScheduleStub)

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

// when & then
assertThrows<ScheduleExceptions.NotScheduleOwner> {
changeIndividualScheduleUseCase.execute(requestStub)
}
}

@Test
fun `유저를 찾을 수 없음`() {
// given
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class ChangeSpotScheduleUseCaseTests {
.willReturn(individualScheduleStub)

// when & then
assertThrows<ScheduleExceptions.NotScheduleOwner> {
assertThrows<ScheduleExceptions.DifferentScope> {
changeSpotScheduleUseCase.execute(requestStub)
}
}
Expand Down

0 comments on commit 69a98f2

Please sign in to comment.