Skip to content

Commit

Permalink
test: (#281) import 변경사항
Browse files Browse the repository at this point in the history
  • Loading branch information
khcho0125 committed Jan 11, 2023
1 parent 24d6723 commit 205b81a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.mockito.BDDMockito.given
import org.springframework.boot.test.mock.mockito.MockBean
import team.comit.simtong.domain.auth.exception.AuthExceptions
import team.comit.simtong.domain.auth.model.AuthCode
import team.comit.simtong.domain.auth.model.Code
import team.comit.simtong.domain.auth.model.value.Code
import team.comit.simtong.domain.auth.spi.CommandAuthCodeLimitPort
import team.comit.simtong.domain.auth.spi.QueryAuthCodePort
import team.comit.simtong.global.annotation.SimtongTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.springframework.boot.test.mock.mockito.MockBean
import team.comit.simtong.domain.auth.exception.AuthExceptions
import team.comit.simtong.domain.auth.model.AuthCode
import team.comit.simtong.domain.auth.model.AuthCodeLimit
import team.comit.simtong.domain.auth.model.Code
import team.comit.simtong.domain.auth.model.value.Code
import team.comit.simtong.domain.auth.spi.CommandAuthCodeLimitPort
import team.comit.simtong.domain.auth.spi.CommandAuthCodePort
import team.comit.simtong.domain.auth.spi.QueryAuthCodeLimitPort
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ import org.mockito.kotlin.given
import org.springframework.boot.test.mock.mockito.MockBean
import team.comit.simtong.domain.holiday.exception.HolidayExceptions
import team.comit.simtong.domain.holiday.model.Holiday
import team.comit.simtong.domain.holiday.model.value.HolidayStatus
import team.comit.simtong.domain.holiday.model.value.HolidayType
import team.comit.simtong.domain.holiday.spi.CommandHolidayPort
import team.comit.simtong.domain.holiday.spi.HolidayQueryUserPort
import team.comit.simtong.domain.holiday.spi.HolidaySecurityPort
import team.comit.simtong.domain.holiday.spi.QueryHolidayPort
import team.comit.simtong.domain.user.exception.UserExceptions
import team.comit.simtong.domain.user.model.value.Authority
import team.comit.simtong.domain.user.model.User
import team.comit.simtong.domain.user.model.value.Authority
import team.comit.simtong.global.annotation.SimtongTest
import java.time.LocalDate
import java.util.UUID
Expand Down Expand Up @@ -133,14 +132,6 @@ class AppointAnnualUseCaseTests {
@Test
fun `이미 연차일때`() {
// given
val annualStub = Holiday(
date = date,
spotId = id,
type = HolidayType.ANNUAL,
employeeId = id,
status = HolidayStatus.COMPLETED
)

given(securityPort.getCurrentUserId())
.willReturn(id)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import org.junit.jupiter.api.assertDoesNotThrow
import org.junit.jupiter.api.assertThrows
import org.mockito.kotlin.given
import org.springframework.boot.test.mock.mockito.MockBean
import team.comit.simtong.domain.holiday.model.value.HolidayQueryType
import team.comit.simtong.domain.holiday.model.value.HolidayType
import team.comit.simtong.domain.holiday.spi.HolidayQueryUserPort
import team.comit.simtong.domain.holiday.spi.HolidaySecurityPort
import team.comit.simtong.domain.holiday.spi.QueryHolidayPort
import team.comit.simtong.domain.holiday.spi.vo.EmployeeHoliday
import team.comit.simtong.domain.user.exception.UserExceptions
import team.comit.simtong.domain.user.model.value.Authority
import team.comit.simtong.domain.user.model.User
import team.comit.simtong.domain.user.model.value.Authority
import team.comit.simtong.global.annotation.SimtongTest
import java.time.LocalDate
import java.util.UUID
Expand Down Expand Up @@ -85,7 +86,7 @@ class QueryEmployeeHolidayUseCaseTests {

// when & then
assertDoesNotThrow {
queryEmployeeHolidayUseCase.execute(year, month, "HOLIDAY", teamId)
queryEmployeeHolidayUseCase.execute(year, month, HolidayQueryType.HOLIDAY, teamId)
}
}

Expand Down Expand Up @@ -114,7 +115,7 @@ class QueryEmployeeHolidayUseCaseTests {

// when & then
assertDoesNotThrow {
queryEmployeeHolidayUseCase.execute(year, month, "ANNUAL", teamId)
queryEmployeeHolidayUseCase.execute(year, month, HolidayQueryType.ANNUAL, teamId)
}
}

Expand Down Expand Up @@ -143,7 +144,7 @@ class QueryEmployeeHolidayUseCaseTests {

// when & then
assertDoesNotThrow {
queryEmployeeHolidayUseCase.execute(year, month, "ALL", teamId)
queryEmployeeHolidayUseCase.execute(year, month, HolidayQueryType.ALL, teamId)
}
}

Expand All @@ -158,7 +159,7 @@ class QueryEmployeeHolidayUseCaseTests {

// when & then
assertThrows<UserExceptions.NotFound> {
queryEmployeeHolidayUseCase.execute(2022, 12, "HOLIDAY", null)
queryEmployeeHolidayUseCase.execute(2022, 12, HolidayQueryType.HOLIDAY, null)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import team.comit.simtong.domain.spot.exception.SpotExceptions
import team.comit.simtong.domain.spot.model.Spot
import team.comit.simtong.domain.user.dto.QueryUserInfoResponse
import team.comit.simtong.domain.user.exception.UserExceptions
import team.comit.simtong.domain.user.model.value.Authority
import team.comit.simtong.domain.user.model.User
import team.comit.simtong.domain.user.model.value.Authority
import team.comit.simtong.domain.user.spi.QueryUserPort
import team.comit.simtong.domain.user.spi.UserQuerySpotPort
import team.comit.simtong.domain.user.spi.UserSecurityPort
Expand All @@ -34,6 +34,8 @@ class QueryUserInfoUseCaseTests {

private val id: UUID = UUID.randomUUID()

private val spotId: UUID = UUID.randomUUID()

private val nickname = "test nickname"

private val name = "test name"
Expand All @@ -51,16 +53,16 @@ class QueryUserInfoUseCaseTests {
password = "test password",
employeeNumber = 1234567891,
authority = Authority.ROLE_COMMON,
spotId = id,
spotId = spotId,
teamId = id,
profileImagePath = profileImagePath
)
}

private val spotStub: Spot by lazy {
Spot(
id = id,
name = name,
id = spotId,
name = "test spot name",
location = "test location"
)
}
Expand Down

0 comments on commit 205b81a

Please sign in to comment.