[#18] 코드 정리 및 일부 컨벤션 통일 #19

Merged
pricelees merged 24 commits from refactor/#18 into main 2025-07-22 09:05:31 +00:00
6 changed files with 0 additions and 66 deletions
Showing only changes of commit 09014efd7b - Show all commits

View File

@ -43,7 +43,6 @@ class AuthControllerTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
body = userRequest, body = userRequest,
log = true
) { ) {
status { isOk() } status { isOk() }
header { header {
@ -66,7 +65,6 @@ class AuthControllerTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
body = userRequest, body = userRequest,
log = true
) { ) {
status { isBadRequest() } status { isBadRequest() }
jsonPath("$.errorType", equalTo(ErrorType.MEMBER_NOT_FOUND.name)) jsonPath("$.errorType", equalTo(ErrorType.MEMBER_NOT_FOUND.name))
@ -83,7 +81,6 @@ class AuthControllerTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
body = invalidRequest, body = invalidRequest,
log = true
) { ) {
status { isBadRequest() } status { isBadRequest() }
jsonPath("$.message", containsString("이메일 형식이 일치하지 않습니다.")) jsonPath("$.message", containsString("이메일 형식이 일치하지 않습니다."))
@ -97,7 +94,6 @@ class AuthControllerTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
body = invalidRequest, body = invalidRequest,
log = true
) { ) {
status { isBadRequest() } status { isBadRequest() }
jsonPath("$.message", containsString("비밀번호는 공백일 수 없습니다.")) jsonPath("$.message", containsString("비밀번호는 공백일 수 없습니다."))
@ -116,7 +112,6 @@ class AuthControllerTest(
runGetTest( runGetTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
log = true
) { ) {
status { isOk() } status { isOk() }
jsonPath("$.data.name", equalTo(user.name)) jsonPath("$.data.name", equalTo(user.name))
@ -134,7 +129,6 @@ class AuthControllerTest(
runGetTest( runGetTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
log = true
) { ) {
status { isBadRequest() } status { isBadRequest() }
jsonPath("$.errorType", equalTo(ErrorType.MEMBER_NOT_FOUND.name)) jsonPath("$.errorType", equalTo(ErrorType.MEMBER_NOT_FOUND.name))
@ -153,7 +147,6 @@ class AuthControllerTest(
runPostTest( runPostTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
log = true
) { ) {
status { is3xxRedirection() } status { is3xxRedirection() }
header { header {
@ -170,7 +163,6 @@ class AuthControllerTest(
runPostTest( runPostTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
log = true
) { ) {
status { isOk() } status { isOk() }
header { header {

View File

@ -35,7 +35,6 @@ class MemberControllerTest(
val result: String = runGetTest( val result: String = runGetTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
log = true
) { ) {
status { isOk() } status { isOk() }
}.andReturn().response.contentAsString }.andReturn().response.contentAsString
@ -59,7 +58,6 @@ class MemberControllerTest(
runGetTest( runGetTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
log = true
) { ) {
status { is3xxRedirection() } status { is3xxRedirection() }
header { header {
@ -74,7 +72,6 @@ class MemberControllerTest(
runGetTest( runGetTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
log = true
) { ) {
status { is3xxRedirection() } status { is3xxRedirection() }
header { header {

View File

@ -80,7 +80,6 @@ class ReservationControllerTest(
}.When { }.When {
post("/reservations") post("/reservations")
}.Then { }.Then {
log().all()
statusCode(201) statusCode(201)
body("data.date", equalTo(reservationRequest.date.toString())) body("data.date", equalTo(reservationRequest.date.toString()))
body("data.status", equalTo(ReservationStatus.CONFIRMED.name)) body("data.status", equalTo(ReservationStatus.CONFIRMED.name))
@ -105,7 +104,6 @@ class ReservationControllerTest(
}.When { }.When {
post("/reservations") post("/reservations")
}.Then { }.Then {
log().all()
statusCode(paymentException.httpStatus.value()) statusCode(paymentException.httpStatus.value())
body("errorType", equalTo(paymentException.errorType.name)) body("errorType", equalTo(paymentException.errorType.name))
} }
@ -143,7 +141,6 @@ class ReservationControllerTest(
}.When { }.When {
post("/reservations") post("/reservations")
}.Then { }.Then {
log().all()
statusCode(expectedException.httpStatus.value()) statusCode(expectedException.httpStatus.value())
body("errorType", equalTo(expectedException.errorType.name)) body("errorType", equalTo(expectedException.errorType.name))
} }
@ -171,7 +168,6 @@ class ReservationControllerTest(
}.When { }.When {
get("/reservations") get("/reservations")
}.Then { }.Then {
log().all()
statusCode(200) statusCode(200)
body("data.reservations.size()", equalTo(reservations.values.sumOf { it.size })) body("data.reservations.size()", equalTo(reservations.values.sumOf { it.size }))
} }
@ -194,7 +190,6 @@ class ReservationControllerTest(
}.When { }.When {
get("/reservations-mine") get("/reservations-mine")
}.Then { }.Then {
log().all()
statusCode(200) statusCode(200)
body("data.reservations.size()", equalTo(expectedReservations)) body("data.reservations.size()", equalTo(expectedReservations))
} }
@ -216,7 +211,6 @@ class ReservationControllerTest(
}.When { }.When {
get("/reservations/search") get("/reservations/search")
}.Then { }.Then {
log().all()
header(HttpHeaders.CONTENT_TYPE, containsString(MediaType.TEXT_HTML_VALUE)) header(HttpHeaders.CONTENT_TYPE, containsString(MediaType.TEXT_HTML_VALUE))
} }
} }
@ -230,7 +224,6 @@ class ReservationControllerTest(
}.When { }.When {
get("/reservations/search") get("/reservations/search")
}.Then { }.Then {
log().all()
statusCode(200) statusCode(200)
body("data.reservations.size()", equalTo(reservations.values.sumOf { it.size })) body("data.reservations.size()", equalTo(reservations.values.sumOf { it.size }))
} }
@ -250,7 +243,6 @@ class ReservationControllerTest(
}.When { }.When {
get("/reservations/search") get("/reservations/search")
}.Then { }.Then {
log().all()
statusCode(HttpStatus.BAD_REQUEST.value()) statusCode(HttpStatus.BAD_REQUEST.value())
body("errorType", equalTo(ErrorType.INVALID_DATE_RANGE.name)) body("errorType", equalTo(ErrorType.INVALID_DATE_RANGE.name))
} }
@ -267,7 +259,6 @@ class ReservationControllerTest(
}.When { }.When {
get("/reservations/search") get("/reservations/search")
}.Then { }.Then {
log().all()
statusCode(200) statusCode(200)
body("data.reservations.size()", equalTo(reservations[member]?.size ?: 0)) body("data.reservations.size()", equalTo(reservations[member]?.size ?: 0))
} }
@ -285,7 +276,6 @@ class ReservationControllerTest(
}.When { }.When {
get("/reservations/search") get("/reservations/search")
}.Then { }.Then {
log().all()
statusCode(200) statusCode(200)
body("data.reservations.size()", equalTo(themes.filter { it.id == requestThemeId }.size)) body("data.reservations.size()", equalTo(themes.filter { it.id == requestThemeId }.size))
} }
@ -304,7 +294,6 @@ class ReservationControllerTest(
}.When { }.When {
get("/reservations/search") get("/reservations/search")
}.Then { }.Then {
log().all()
statusCode(200) statusCode(200)
body("data.reservations.size()", equalTo(reservations.values.sumOf { it.size })) body("data.reservations.size()", equalTo(reservations.values.sumOf { it.size }))
} }
@ -326,7 +315,6 @@ class ReservationControllerTest(
}.When { }.When {
delete("/reservations/${reservation.id}") delete("/reservations/${reservation.id}")
}.Then { }.Then {
log().all()
statusCode(302) statusCode(302)
header(HttpHeaders.LOCATION, containsString("/login")) header(HttpHeaders.LOCATION, containsString("/login"))
} }
@ -352,7 +340,6 @@ class ReservationControllerTest(
}.When { }.When {
delete("/reservations/$reservationId") delete("/reservations/$reservationId")
}.Then { }.Then {
log().all()
statusCode(HttpStatus.NO_CONTENT.value()) statusCode(HttpStatus.NO_CONTENT.value())
} }
@ -393,7 +380,6 @@ class ReservationControllerTest(
}.When { }.When {
delete("/reservations/${reservation.id}") delete("/reservations/${reservation.id}")
}.Then { }.Then {
log().all()
statusCode(HttpStatus.NO_CONTENT.value()) statusCode(HttpStatus.NO_CONTENT.value())
} }
@ -425,7 +411,6 @@ class ReservationControllerTest(
}.When { }.When {
post("/reservations/admin") post("/reservations/admin")
}.Then { }.Then {
log().all()
statusCode(201) statusCode(201)
body("data.status", equalTo(ReservationStatus.CONFIRMED_PAYMENT_REQUIRED.name)) body("data.status", equalTo(ReservationStatus.CONFIRMED_PAYMENT_REQUIRED.name))
} }
@ -447,7 +432,6 @@ class ReservationControllerTest(
}.When { }.When {
get("/reservations/waiting") get("/reservations/waiting")
}.Then { }.Then {
log().all()
header(HttpHeaders.CONTENT_TYPE, containsString(MediaType.TEXT_HTML_VALUE)) header(HttpHeaders.CONTENT_TYPE, containsString(MediaType.TEXT_HTML_VALUE))
} }
} }
@ -463,7 +447,6 @@ class ReservationControllerTest(
}.When { }.When {
get("/reservations/waiting") get("/reservations/waiting")
}.Then { }.Then {
log().all()
statusCode(200) statusCode(200)
body("data.reservations.size()", equalTo(expected)) body("data.reservations.size()", equalTo(expected))
} }
@ -488,7 +471,6 @@ class ReservationControllerTest(
}.When { }.When {
post("/reservations/waiting") post("/reservations/waiting")
}.Then { }.Then {
log().all()
statusCode(201) statusCode(201)
body("data.member.id", equalTo(member.id!!.toInt())) body("data.member.id", equalTo(member.id!!.toInt()))
body("data.status", equalTo(ReservationStatus.WAITING.name)) body("data.status", equalTo(ReservationStatus.WAITING.name))
@ -526,7 +508,6 @@ class ReservationControllerTest(
}.When { }.When {
post("/reservations/waiting") post("/reservations/waiting")
}.Then { }.Then {
log().all()
statusCode(HttpStatus.BAD_REQUEST.value()) statusCode(HttpStatus.BAD_REQUEST.value())
body("errorType", equalTo(ErrorType.HAS_RESERVATION_OR_WAITING.name)) body("errorType", equalTo(ErrorType.HAS_RESERVATION_OR_WAITING.name))
} }
@ -551,7 +532,6 @@ class ReservationControllerTest(
}.When { }.When {
delete("/reservations/waiting/${waiting.id}") delete("/reservations/waiting/${waiting.id}")
}.Then { }.Then {
log().all()
statusCode(HttpStatus.NO_CONTENT.value()) statusCode(HttpStatus.NO_CONTENT.value())
} }
@ -575,7 +555,6 @@ class ReservationControllerTest(
}.When { }.When {
delete("/reservations/waiting/{id}", reservation.id) delete("/reservations/waiting/{id}", reservation.id)
}.Then { }.Then {
log().all()
body("errorType", equalTo(ErrorType.RESERVATION_NOT_FOUND.name)) body("errorType", equalTo(ErrorType.RESERVATION_NOT_FOUND.name))
statusCode(HttpStatus.NOT_FOUND.value()) statusCode(HttpStatus.NOT_FOUND.value())
} }
@ -591,7 +570,6 @@ class ReservationControllerTest(
}.When { }.When {
post("/reservations/waiting/1/approve") post("/reservations/waiting/1/approve")
}.Then { }.Then {
log().all()
statusCode(302) statusCode(302)
header(HttpHeaders.LOCATION, containsString("/login")) header(HttpHeaders.LOCATION, containsString("/login"))
} }
@ -609,7 +587,6 @@ class ReservationControllerTest(
}.When { }.When {
post("/reservations/waiting/${reservation.id!!}/approve") post("/reservations/waiting/${reservation.id!!}/approve")
}.Then { }.Then {
log().all()
statusCode(200) statusCode(200)
} }
@ -633,7 +610,6 @@ class ReservationControllerTest(
}.When { }.When {
post("/reservations/waiting/1/deny") post("/reservations/waiting/1/deny")
}.Then { }.Then {
log().all()
statusCode(302) statusCode(302)
header(HttpHeaders.LOCATION, containsString("/login")) header(HttpHeaders.LOCATION, containsString("/login"))
} }
@ -651,7 +627,6 @@ class ReservationControllerTest(
}.When { }.When {
post("/reservations/waiting/${reservation.id!!}/deny") post("/reservations/waiting/${reservation.id!!}/deny")
}.Then { }.Then {
log().all()
statusCode(204) statusCode(204)
} }

View File

@ -59,7 +59,6 @@ class TimeControllerTest(
runGetTest( runGetTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
log = true
) { ) {
status { isOk() } status { isOk() }
content { content {
@ -78,7 +77,6 @@ class TimeControllerTest(
runGetTest( runGetTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
log = true
) { ) {
status { is3xxRedirection() } status { is3xxRedirection() }
header { string("Location", "/login") } header { string("Location", "/login") }
@ -106,7 +104,6 @@ class TimeControllerTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
body = it, body = it,
log = true
) { ) {
status { isBadRequest() } status { isBadRequest() }
} }
@ -122,7 +119,6 @@ class TimeControllerTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
body = request, body = request,
log = true
) { ) {
status { isCreated() } status { isCreated() }
content { content {
@ -142,7 +138,6 @@ class TimeControllerTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
body = request, body = request,
log = true
) { ) {
status { isConflict() } status { isConflict() }
content { content {
@ -161,7 +156,6 @@ class TimeControllerTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
body = TimeFixture.create(), body = TimeFixture.create(),
log = true
) { ) {
status { is3xxRedirection() } status { is3xxRedirection() }
header { string("Location", "/login") } header { string("Location", "/login") }
@ -186,7 +180,6 @@ class TimeControllerTest(
runDeleteTest( runDeleteTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
log = true
) { ) {
status { isNoContent() } status { isNoContent() }
} }
@ -201,7 +194,6 @@ class TimeControllerTest(
runDeleteTest( runDeleteTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = "/times/$id", endpoint = "/times/$id",
log = true
) { ) {
status { isBadRequest() } status { isBadRequest() }
content { content {
@ -224,7 +216,6 @@ class TimeControllerTest(
runDeleteTest( runDeleteTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = "/times/$id", endpoint = "/times/$id",
log = true
) { ) {
status { isConflict() } status { isConflict() }
content { content {
@ -242,7 +233,6 @@ class TimeControllerTest(
runDeleteTest( runDeleteTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
log = true
) { ) {
status { is3xxRedirection() } status { is3xxRedirection() }
header { string("Location", "/login") } header { string("Location", "/login") }
@ -283,7 +273,6 @@ class TimeControllerTest(
val response = runGetTest( val response = runGetTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = "/times/filter?date=$date&themeId=$themeId", endpoint = "/times/filter?date=$date&themeId=$themeId",
log = true
) { ) {
status { isOk() } status { isOk() }
content { content {

View File

@ -36,7 +36,6 @@ class ThemeControllerTest(mockMvc: MockMvc) : RoomescapeApiTest() {
runGetTest( runGetTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
log = true
) { ) {
status { is3xxRedirection() } status { is3xxRedirection() }
header { header {
@ -61,7 +60,6 @@ class ThemeControllerTest(mockMvc: MockMvc) : RoomescapeApiTest() {
val response: ThemesResponse = runGetTest( val response: ThemesResponse = runGetTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
log = true
) { ) {
status { isOk() } status { isOk() }
content { content {
@ -92,7 +90,6 @@ class ThemeControllerTest(mockMvc: MockMvc) : RoomescapeApiTest() {
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
body = request, body = request,
log = true
) { ) {
status { is3xxRedirection() } status { is3xxRedirection() }
header { header {
@ -109,7 +106,6 @@ class ThemeControllerTest(mockMvc: MockMvc) : RoomescapeApiTest() {
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
body = request, body = request,
log = true
) { ) {
status { is3xxRedirection() } status { is3xxRedirection() }
jsonPath("$.errorType") { value("PERMISSION_DOES_NOT_EXIST") } jsonPath("$.errorType") { value("PERMISSION_DOES_NOT_EXIST") }
@ -129,7 +125,6 @@ class ThemeControllerTest(mockMvc: MockMvc) : RoomescapeApiTest() {
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
body = request, body = request,
log = true
) { ) {
status { isConflict() } status { isConflict() }
jsonPath("$.errorType") { value("THEME_DUPLICATED") } jsonPath("$.errorType") { value("THEME_DUPLICATED") }
@ -153,7 +148,6 @@ class ThemeControllerTest(mockMvc: MockMvc) : RoomescapeApiTest() {
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
body = request, body = request,
log = true
) { ) {
status { isBadRequest() } status { isBadRequest() }
} }
@ -214,7 +208,6 @@ class ThemeControllerTest(mockMvc: MockMvc) : RoomescapeApiTest() {
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
body = request, body = request,
log = true
) { ) {
status { isCreated() } status { isCreated() }
header { header {
@ -239,7 +232,6 @@ class ThemeControllerTest(mockMvc: MockMvc) : RoomescapeApiTest() {
runDeleteTest( runDeleteTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
log = true
) { ) {
status { is3xxRedirection() } status { is3xxRedirection() }
header { header {
@ -255,7 +247,6 @@ class ThemeControllerTest(mockMvc: MockMvc) : RoomescapeApiTest() {
runDeleteTest( runDeleteTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
log = true
) { ) {
status { is3xxRedirection() } status { is3xxRedirection() }
jsonPath("$.errorType") { value("PERMISSION_DOES_NOT_EXIST") } jsonPath("$.errorType") { value("PERMISSION_DOES_NOT_EXIST") }
@ -274,7 +265,6 @@ class ThemeControllerTest(mockMvc: MockMvc) : RoomescapeApiTest() {
runDeleteTest( runDeleteTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
log = true
) { ) {
status { isConflict() } status { isConflict() }
jsonPath("$.errorType") { value("THEME_IS_USED_CONFLICT") } jsonPath("$.errorType") { value("THEME_IS_USED_CONFLICT") }
@ -297,7 +287,6 @@ class ThemeControllerTest(mockMvc: MockMvc) : RoomescapeApiTest() {
runDeleteTest( runDeleteTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = endpoint, endpoint = endpoint,
log = true
) { ) {
status { isNoContent() } status { isNoContent() }
} }

View File

@ -24,7 +24,6 @@ class PageControllerTest(
runGetTest( runGetTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = it, endpoint = it,
log = true
) { ) {
status { isOk() } status { isOk() }
} }
@ -36,7 +35,6 @@ class PageControllerTest(
runGetTest( runGetTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = it, endpoint = it,
log = true
) { ) {
status { isOk() } status { isOk() }
} }
@ -48,7 +46,6 @@ class PageControllerTest(
runGetTest( runGetTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = it, endpoint = it,
log = true
) { ) {
status { isOk() } status { isOk() }
} }
@ -66,7 +63,6 @@ class PageControllerTest(
runGetTest( runGetTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = it, endpoint = it,
log = true
) { ) {
status { isOk() } status { isOk() }
} }
@ -80,7 +76,6 @@ class PageControllerTest(
runGetTest( runGetTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = it, endpoint = it,
log = true
) { ) {
status { is3xxRedirection() } status { is3xxRedirection() }
header { header {
@ -101,7 +96,6 @@ class PageControllerTest(
runGetTest( runGetTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = it, endpoint = it,
log = true
) { ) {
status { isOk() } status { isOk() }
} }
@ -112,7 +106,6 @@ class PageControllerTest(
runGetTest( runGetTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = it, endpoint = it,
log = true
) { ) {
status { isOk() } status { isOk() }
} }
@ -126,7 +119,6 @@ class PageControllerTest(
runGetTest( runGetTest(
mockMvc = mockMvc, mockMvc = mockMvc,
endpoint = it, endpoint = it,
log = true
) { ) {
status { is3xxRedirection() } status { is3xxRedirection() }
header { header {