Skip to content

Commit

Permalink
style: RoomApiTest constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
K-Diger committed Jul 29, 2024
1 parent b64cfbf commit 0a88427
Showing 1 changed file with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,44 @@ import org.springframework.beans.factory.annotation.Autowired
import org.springframework.http.HttpMethod
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.status

class RoomApiTest
class RoomApiTest(
@Autowired
constructor(
mockMvcActor: MockMvcActor,
mockMvcAsserter: MockMvcAsserter,
) : AcceptanceTestHelper(mockMvcActor, mockMvcAsserter) {
@Nested
inner class Success {
@Test
fun `방 생성 성공`() {
// Arrange && Act
val resultActions = act(HttpMethod.POST, BASE_URL, getSaveRequestFixture())
mockMvcActor: MockMvcActor,
@Autowired
mockMvcAsserter: MockMvcAsserter,
) : AcceptanceTestHelper(mockMvcActor, mockMvcAsserter) {
@Nested
inner class Success {
@Test
fun `방 생성 성공`() {
// Arrange && Act
val resultActions = act(HttpMethod.POST, BASE_URL, getSaveRequestFixture())

// Assert
assert(
resultActions = resultActions,
expectedStatus = status().isCreated,
responseDto = getSaveResponseFixture(),
)
}
// Assert
assert(
resultActions = resultActions,
expectedStatus = status().isCreated,
responseDto = getSaveResponseFixture(),
)
}
}

@Nested
inner class Fail {
@Test
fun `방 생성 실패 - 값 범위를 초과함`() {
// Arrange && Act
val resultActions = act(HttpMethod.POST, BASE_URL, getNotValidSaveRequestFixture())
@Nested
inner class Fail {
@Test
fun `방 생성 실패 - 값 범위를 초과함`() {
// Arrange && Act
val resultActions = act(HttpMethod.POST, BASE_URL, getNotValidSaveRequestFixture())

// Assert
assert(
resultActions = resultActions,
expectedStatus = status().is4xxClientError,
)
}
// Assert
assert(
resultActions = resultActions,
expectedStatus = status().is4xxClientError,
)
}
}

companion object {
private const val BASE_URL = "/v1/rooms"
}
companion object {
private const val BASE_URL = "/v1/rooms"
}
}

0 comments on commit 0a88427

Please sign in to comment.