Skip to content

Commit

Permalink
Test(be): 관계 매핑 테스트 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
devbattery committed Jan 20, 2025
1 parent 6753267 commit 92ffc1c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,8 @@

public class GroupChatroomSteps {

public static ExtractableResponse<Response> 그룹_채팅_생성을_요청한다(String accessToken,
RequestSpecification spec) {
/**
* @NotBlank(message = "채팅방 제목은 항상 존재해야 합니다.")
* private String roomName;
*
* @NotBlank(message = "(개발자 알림) 컨텐츠 유형이 비어 있습니다.")
* private String contentType; // movie, book
*
* @NotNull(message = "컨텐츠의 id가 없습니다.")
* private Long contentId;
*/

public static ExtractableResponse<Response> 그룹_채팅_생성을_요청한다_1(String accessToken,
RequestSpecification spec) {
Map<String, Object> body = new HashMap<>();
body.put("roomName", "해리포터 활동방");
body.put("contentType", "movie");
Expand All @@ -37,6 +26,26 @@ public class GroupChatroomSteps {
return 그룹_채팅을_생성한다(accessToken, spec, body);
}

public static ExtractableResponse<Response> 그룹_채팅_생성을_요청한다_2(String accessToken,
RequestSpecification spec) {
Map<String, Object> body = new HashMap<>();
body.put("roomName", "기타 활동방");
body.put("contentType", "movie");
body.put("contentId", 278L);

return 그룹_채팅을_생성한다(accessToken, spec, body);
}

public static ExtractableResponse<Response> 그룹_채팅_생성을_요청한다_3(String accessToken,
RequestSpecification spec) {
Map<String, Object> body = new HashMap<>();
body.put("roomName", "안녕 활동방");
body.put("contentType", "movie");
body.put("contentId", 315162L);

return 그룹_채팅을_생성한다(accessToken, spec, body);
}

public static ExtractableResponse<Response> 그룹_채팅을_생성한다(String accessToken,
RequestSpecification spec, Map<String, Object> body) {
return RestAssured
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package movlit.be.acceptance.group_chatroom;

import static movlit.be.acceptance.group_chatroom.GroupChatroomSteps.그룹_채팅_생성을_요청한다;
import static movlit.be.acceptance.group_chatroom.GroupChatroomSteps.그룹_채팅을_생성한다;
import static movlit.be.acceptance.group_chatroom.GroupChatroomSteps.그룹_채팅_생성을_요청한다_1;
import static movlit.be.acceptance.group_chatroom.GroupChatroomSteps.그룹_채팅_생성을_요청한다_2;
import static movlit.be.acceptance.group_chatroom.GroupChatroomSteps.그룹_채팅_생성을_요청한다_3;
import static movlit.be.acceptance.group_chatroom.GroupChatroomSteps.상태코드가_200이다;

import movlit.be.acceptance.AcceptanceTest;
Expand All @@ -21,7 +22,9 @@ void when_create_group_chat_then_response_200_and_body() {
String accessToken = 회원_원준_액세스토큰;

// when
var response = 그룹_채팅_생성을_요청한다(accessToken, spec);
그룹_채팅_생성을_요청한다_1(accessToken, spec);
그룹_채팅_생성을_요청한다_2(accessToken, spec);
var response = 그룹_채팅_생성을_요청한다_3(accessToken, spec);

// then
상태코드가_200이다(response);
Expand Down

0 comments on commit 92ffc1c

Please sign in to comment.