Skip to content

Commit

Permalink
test: (#301) 인자 변경 Test
Browse files Browse the repository at this point in the history
  • Loading branch information
khcho0125 committed Jan 23, 2023
1 parent e3c8b9f commit aa8639d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import org.junit.jupiter.api.assertDoesNotThrow
import org.junit.jupiter.api.assertThrows
import org.mockito.BDDMockito.given
import org.springframework.boot.test.mock.mockito.MockBean
import team.comit.simtong.domain.auth.dto.request.CheckAuthCodeData
import team.comit.simtong.domain.auth.exception.AuthExceptions
import team.comit.simtong.domain.auth.model.AuthCode
import team.comit.simtong.domain.auth.model.Code
Expand Down Expand Up @@ -45,8 +44,6 @@ class CheckAuthCodeUseCaseTests {
)
}

private val requestStub = CheckAuthCodeData(email, code)

@BeforeEach
fun setUp() {
checkAuthCodeUseCase = CheckAuthCodeUseCase(
Expand All @@ -63,7 +60,7 @@ class CheckAuthCodeUseCaseTests {

// when & then
assertDoesNotThrow {
checkAuthCodeUseCase.execute(requestStub)
checkAuthCodeUseCase.execute(email, code)
}
}

Expand All @@ -75,7 +72,7 @@ class CheckAuthCodeUseCaseTests {

// when & then
assertThrows<AuthExceptions.RequiredNewEmailAuthentication> {
checkAuthCodeUseCase.execute(requestStub)
checkAuthCodeUseCase.execute(email, code)
}
}

Expand All @@ -87,7 +84,7 @@ class CheckAuthCodeUseCaseTests {

// when & then
assertThrows<AuthExceptions.DifferentAuthCode> {
checkAuthCodeUseCase.execute(requestStub)
checkAuthCodeUseCase.execute(email, code)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ 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.menu.dto.request.SaveMenuData
import team.comit.simtong.domain.menu.exception.MenuExceptions
import team.comit.simtong.domain.menu.model.Menu
import team.comit.simtong.domain.menu.spi.CommandMenuPort
Expand Down Expand Up @@ -44,14 +43,6 @@ class SaveMenuUseCaseTests {
)
}

private val requestStub: SaveMenuData by lazy {
SaveMenuData(
file = fileStub,
year = year,
month = month
)
}

@BeforeEach
fun setUp() {
saveMenuUseCase = SaveMenuUseCase(
Expand All @@ -72,7 +63,7 @@ class SaveMenuUseCaseTests {

// when & then
assertDoesNotThrow {
saveMenuUseCase.execute(requestStub, spotId)
saveMenuUseCase.execute(fileStub, year, month, spotId)
}
}

Expand All @@ -87,7 +78,7 @@ class SaveMenuUseCaseTests {

// when & then
assertThrows<MenuExceptions.AlreadyExistsSameMonth> {
saveMenuUseCase.execute(requestStub, spotId)
saveMenuUseCase.execute(fileStub, year, month, spotId)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class FindEmployeeNumberUseCaseTests {
.willReturn(userStub)

// when
val response = findEmployeeNumberUseCase.execute(requestStub)
val response = findEmployeeNumberUseCase.execute(name, spotId, email)

// when & then
assertEquals(response.employeeNumber, employeeNumber)
Expand All @@ -78,7 +78,7 @@ class FindEmployeeNumberUseCaseTests {

// when & then
assertThrows<UserExceptions.NotFound> {
findEmployeeNumberUseCase.execute(requestStub)
findEmployeeNumberUseCase.execute(name, spotId, email)
}
}

Expand Down

0 comments on commit aa8639d

Please sign in to comment.