Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Ji-InPark committed May 13, 2024
2 parents c37f4f7 + eed5819 commit affb154
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import org.hibernate.validator.constraints.Length

data class RegisterRequestBody(
@field:NotBlank(message = "아이디는 필수 입력값입니다.")
@field:Length(min = 4, max = 20, message = "아이디는 4자 이상 20자 이하로 입력해주세요.")
val id: String,
@field:NotBlank(message = "비밀번호는 필수 입력값입니다.")
@field:Length(min = 8, max = 20, message = "비밀번호는 8자 이상 20자 이하로 입력해주세요.")
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/db/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ values ('KB국민은행', '004'),
('경남은행', '039'),
('광주은행', '034'),
('기업은행', '003'),
('농협', '011'),
('NH농협은행', '011'),
('대구은행', '031'),
('부산은행', '032'),
('산업은행', '002'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ package com.kioschool.kioschoolapi.order.controller

import com.kioschool.kioschoolapi.factory.AuthenticationSample
import com.kioschool.kioschoolapi.factory.SampleEntity
import com.kioschool.kioschoolapi.order.dto.CancelOrderRequestBody
import com.kioschool.kioschoolapi.order.dto.PayOrderRequestBody
import com.kioschool.kioschoolapi.order.dto.ServeOrderRequestBody
import com.kioschool.kioschoolapi.order.dto.ChangeOrderStatusRequestBody
import com.kioschool.kioschoolapi.order.service.OrderService
import io.kotest.core.spec.style.DescribeSpec
import io.kotest.matchers.shouldBe
Expand Down Expand Up @@ -37,66 +35,24 @@ class AdminOrderControllerTest : DescribeSpec({
}
}

describe("cancelOrder") {
it("should call orderService.cancelOrder") {
describe("changeOrderStatus") {
it("should call orderService.changeOrderStatus") {
val authentication = SecurityContextHolder.getContext().authentication
every {
service.cancelOrder(
service.changeOrderStatus(
"test",
workspaceId,
1
1,
"status"
)
} returns SampleEntity.order

val result = sut.cancelOrder(
val result = sut.changeOrderStatus(
authentication,
CancelOrderRequestBody(
ChangeOrderStatusRequestBody(
workspaceId,
1
)
)
result shouldBe SampleEntity.order
}
}

describe("serveOrder") {
it("should call orderService.serveOrder") {
val authentication = SecurityContextHolder.getContext().authentication
every {
service.serveOrder(
"test",
workspaceId,
1
)
} returns SampleEntity.order

val result = sut.serveOrder(
authentication,
ServeOrderRequestBody(
workspaceId,
1
)
)
result shouldBe SampleEntity.order
}
}

describe("payOrder") {
it("should call orderService.payOrder") {
val authentication = SecurityContextHolder.getContext().authentication
every {
service.payOrder(
"test",
workspaceId,
1
)
} returns SampleEntity.order

val result = sut.payOrder(
authentication,
PayOrderRequestBody(
workspaceId,
1
1,
"status"
)
)
result shouldBe SampleEntity.order
Expand Down

0 comments on commit affb154

Please sign in to comment.