-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBalanceQuestionControllerTest.java
34 lines (27 loc) · 1.22 KB
/
BalanceQuestionControllerTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package ddangkong.controller.question;
import static org.assertj.core.api.Assertions.assertThat;
import ddangkong.controller.BaseControllerTest;
import ddangkong.controller.option.dto.BalanceOptionResponse;
import ddangkong.controller.question.dto.BalanceQuestionResponse;
import ddangkong.domain.question.Category;
import io.restassured.RestAssured;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
class BalanceQuestionControllerTest extends BaseControllerTest {
private static final BalanceQuestionResponse EXPECTED_RESPONSE = new BalanceQuestionResponse(
1L, Category.EXAMPLE, "민초 vs 반민초",
new BalanceOptionResponse(1L, "민초"),
new BalanceOptionResponse(2L, "반민초"));
@Nested
class 방의_질문_조회 {
@Test
void 현재_방의_질문을_조회할_수_있다() {
BalanceQuestionResponse actual = RestAssured.given().log().all()
.when().get("/api/balances/rooms/1/question")
.then().log().all()
.statusCode(200)
.extract().as(BalanceQuestionResponse.class);
assertThat(actual).isEqualTo(EXPECTED_RESPONSE);
}
}
}