generated from pricelees/issue-pr-template
refactor: 실패 테스트 케이스에 사용할 INVALID PK 상수화
This commit is contained in:
parent
c717e1cb5b
commit
fc3c6e42b0
@ -50,7 +50,7 @@ class ScheduleApiTest(
|
|||||||
runTest(
|
runTest(
|
||||||
token = token,
|
token = token,
|
||||||
on = {
|
on = {
|
||||||
get("/schedules/1")
|
get("/schedules/$INVALID_PK")
|
||||||
},
|
},
|
||||||
expect = commonAssertion
|
expect = commonAssertion
|
||||||
)
|
)
|
||||||
@ -63,7 +63,7 @@ class ScheduleApiTest(
|
|||||||
body(createRequest)
|
body(createRequest)
|
||||||
},
|
},
|
||||||
on = {
|
on = {
|
||||||
get("/schedules/1")
|
get("/schedules/$INVALID_PK")
|
||||||
},
|
},
|
||||||
expect = commonAssertion
|
expect = commonAssertion
|
||||||
)
|
)
|
||||||
@ -263,7 +263,7 @@ class ScheduleApiTest(
|
|||||||
runTest(
|
runTest(
|
||||||
token = loginUtil.loginAsAdmin(),
|
token = loginUtil.loginAsAdmin(),
|
||||||
on = {
|
on = {
|
||||||
get("/schedules/1")
|
get("/schedules/$INVALID_PK")
|
||||||
},
|
},
|
||||||
expect = {
|
expect = {
|
||||||
statusCode(HttpStatus.NOT_FOUND.value())
|
statusCode(HttpStatus.NOT_FOUND.value())
|
||||||
@ -402,7 +402,7 @@ class ScheduleApiTest(
|
|||||||
runTest(
|
runTest(
|
||||||
token = loginUtil.loginAsUser(),
|
token = loginUtil.loginAsUser(),
|
||||||
on = {
|
on = {
|
||||||
patch("/schedules/1/hold")
|
patch("/schedules/$INVALID_PK/hold")
|
||||||
},
|
},
|
||||||
expect = {
|
expect = {
|
||||||
statusCode(HttpStatus.NOT_FOUND.value())
|
statusCode(HttpStatus.NOT_FOUND.value())
|
||||||
@ -515,7 +515,7 @@ class ScheduleApiTest(
|
|||||||
body(updateRequest)
|
body(updateRequest)
|
||||||
},
|
},
|
||||||
on = {
|
on = {
|
||||||
patch("/schedules/1")
|
patch("/schedules/$INVALID_PK")
|
||||||
},
|
},
|
||||||
expect = {
|
expect = {
|
||||||
statusCode(HttpStatus.NOT_FOUND.value())
|
statusCode(HttpStatus.NOT_FOUND.value())
|
||||||
|
|||||||
@ -33,7 +33,6 @@ class ThemeApiTest(
|
|||||||
private val themeRepository: ThemeRepository
|
private val themeRepository: ThemeRepository
|
||||||
) : FunSpecSpringbootTest() {
|
) : FunSpecSpringbootTest() {
|
||||||
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
context("관리자가 아니면 접근할 수 없다.") {
|
context("관리자가 아니면 접근할 수 없다.") {
|
||||||
lateinit var token: String
|
lateinit var token: String
|
||||||
@ -74,7 +73,7 @@ class ThemeApiTest(
|
|||||||
runTest(
|
runTest(
|
||||||
token = token,
|
token = token,
|
||||||
on = {
|
on = {
|
||||||
get("/admin/themes/1")
|
get("/admin/themes/$INVALID_PK")
|
||||||
},
|
},
|
||||||
expect = commonAssertion
|
expect = commonAssertion
|
||||||
)
|
)
|
||||||
@ -87,7 +86,7 @@ class ThemeApiTest(
|
|||||||
body(createRequest)
|
body(createRequest)
|
||||||
},
|
},
|
||||||
on = {
|
on = {
|
||||||
patch("/admin/themes/1")
|
patch("/admin/themes/$INVALID_PK")
|
||||||
},
|
},
|
||||||
expect = commonAssertion
|
expect = commonAssertion
|
||||||
)
|
)
|
||||||
@ -97,7 +96,7 @@ class ThemeApiTest(
|
|||||||
runTest(
|
runTest(
|
||||||
token = token,
|
token = token,
|
||||||
on = {
|
on = {
|
||||||
delete("/admin/themes/1")
|
delete("/admin/themes/$INVALID_PK")
|
||||||
},
|
},
|
||||||
expect = commonAssertion
|
expect = commonAssertion
|
||||||
)
|
)
|
||||||
@ -402,7 +401,7 @@ class ThemeApiTest(
|
|||||||
runTest(
|
runTest(
|
||||||
token = loginUtil.loginAsAdmin(),
|
token = loginUtil.loginAsAdmin(),
|
||||||
on = {
|
on = {
|
||||||
get("/admin/themes/1")
|
get("/admin/themes/$INVALID_PK")
|
||||||
},
|
},
|
||||||
expect = {
|
expect = {
|
||||||
statusCode(HttpStatus.NOT_FOUND.value())
|
statusCode(HttpStatus.NOT_FOUND.value())
|
||||||
@ -433,7 +432,7 @@ class ThemeApiTest(
|
|||||||
runTest(
|
runTest(
|
||||||
token = loginUtil.loginAsAdmin(),
|
token = loginUtil.loginAsAdmin(),
|
||||||
on = {
|
on = {
|
||||||
delete("/admin/themes/1")
|
delete("/admin/themes/$INVALID_PK")
|
||||||
},
|
},
|
||||||
expect = {
|
expect = {
|
||||||
statusCode(HttpStatus.NOT_FOUND.value())
|
statusCode(HttpStatus.NOT_FOUND.value())
|
||||||
@ -507,7 +506,7 @@ class ThemeApiTest(
|
|||||||
body(updateRequest)
|
body(updateRequest)
|
||||||
},
|
},
|
||||||
on = {
|
on = {
|
||||||
patch("/admin/themes/1")
|
patch("/admin/themes/$INVALID_PK")
|
||||||
},
|
},
|
||||||
expect = {
|
expect = {
|
||||||
statusCode(HttpStatus.NOT_FOUND.value())
|
statusCode(HttpStatus.NOT_FOUND.value())
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import roomescape.theme.web.ThemeCreateRequest
|
|||||||
import java.time.LocalDate
|
import java.time.LocalDate
|
||||||
import java.time.LocalTime
|
import java.time.LocalTime
|
||||||
|
|
||||||
|
const val INVALID_PK: Long = 9999L
|
||||||
val tsidFactory = TsidFactory(0)
|
val tsidFactory = TsidFactory(0)
|
||||||
|
|
||||||
object MemberFixture {
|
object MemberFixture {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user