refactor: 실패 테스트 케이스에 사용할 INVALID PK 상수화

This commit is contained in:
이상진 2025-09-09 09:04:10 +09:00
parent c717e1cb5b
commit fc3c6e42b0
3 changed files with 12 additions and 12 deletions

View File

@ -50,7 +50,7 @@ class ScheduleApiTest(
runTest(
token = token,
on = {
get("/schedules/1")
get("/schedules/$INVALID_PK")
},
expect = commonAssertion
)
@ -63,7 +63,7 @@ class ScheduleApiTest(
body(createRequest)
},
on = {
get("/schedules/1")
get("/schedules/$INVALID_PK")
},
expect = commonAssertion
)
@ -263,7 +263,7 @@ class ScheduleApiTest(
runTest(
token = loginUtil.loginAsAdmin(),
on = {
get("/schedules/1")
get("/schedules/$INVALID_PK")
},
expect = {
statusCode(HttpStatus.NOT_FOUND.value())
@ -402,7 +402,7 @@ class ScheduleApiTest(
runTest(
token = loginUtil.loginAsUser(),
on = {
patch("/schedules/1/hold")
patch("/schedules/$INVALID_PK/hold")
},
expect = {
statusCode(HttpStatus.NOT_FOUND.value())
@ -515,7 +515,7 @@ class ScheduleApiTest(
body(updateRequest)
},
on = {
patch("/schedules/1")
patch("/schedules/$INVALID_PK")
},
expect = {
statusCode(HttpStatus.NOT_FOUND.value())

View File

@ -33,7 +33,6 @@ class ThemeApiTest(
private val themeRepository: ThemeRepository
) : FunSpecSpringbootTest() {
init {
context("관리자가 아니면 접근할 수 없다.") {
lateinit var token: String
@ -74,7 +73,7 @@ class ThemeApiTest(
runTest(
token = token,
on = {
get("/admin/themes/1")
get("/admin/themes/$INVALID_PK")
},
expect = commonAssertion
)
@ -87,7 +86,7 @@ class ThemeApiTest(
body(createRequest)
},
on = {
patch("/admin/themes/1")
patch("/admin/themes/$INVALID_PK")
},
expect = commonAssertion
)
@ -97,7 +96,7 @@ class ThemeApiTest(
runTest(
token = token,
on = {
delete("/admin/themes/1")
delete("/admin/themes/$INVALID_PK")
},
expect = commonAssertion
)
@ -402,7 +401,7 @@ class ThemeApiTest(
runTest(
token = loginUtil.loginAsAdmin(),
on = {
get("/admin/themes/1")
get("/admin/themes/$INVALID_PK")
},
expect = {
statusCode(HttpStatus.NOT_FOUND.value())
@ -433,7 +432,7 @@ class ThemeApiTest(
runTest(
token = loginUtil.loginAsAdmin(),
on = {
delete("/admin/themes/1")
delete("/admin/themes/$INVALID_PK")
},
expect = {
statusCode(HttpStatus.NOT_FOUND.value())
@ -507,7 +506,7 @@ class ThemeApiTest(
body(updateRequest)
},
on = {
patch("/admin/themes/1")
patch("/admin/themes/$INVALID_PK")
},
expect = {
statusCode(HttpStatus.NOT_FOUND.value())

View File

@ -9,6 +9,7 @@ import roomescape.theme.web.ThemeCreateRequest
import java.time.LocalDate
import java.time.LocalTime
const val INVALID_PK: Long = 9999L
val tsidFactory = TsidFactory(0)
object MemberFixture {