Skip to content

Commit

Permalink
test: 글자수 속성 변경에 따른 테스트 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
skylar1220 committed Aug 20, 2024
1 parent 2d1f85c commit 70ecf6f
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,26 @@ void setUp() {
assertThat(reviewRepository.findAll()).hasSize(1);
assertThat(checkboxAnswerRepository.findAll()).hasSize(1);
}

@Test
void 적정_글자수인_텍스트_응답인_경우_정상_저장된다() {
// given
String expectedTextAnswer = "답".repeat(1000);
Question savedQuestion = questionRepository.save(
new Question(true, QuestionType.TEXT, "질문", "가이드라인", 1)
);
CreateReviewAnswerRequest createReviewAnswerRequest = new CreateReviewAnswerRequest(
savedQuestion.getId(), null, expectedTextAnswer
);
CreateReviewRequest createReviewRequest = new CreateReviewRequest(
reviewRequestCode, List.of(createReviewAnswerRequest)
);

// when
createReviewService.createReview(createReviewRequest);

// then
assertThat(reviewRepository.findAll()).hasSize(1);
assertThat(textAnswerRepository.findAll()).hasSize(1);
}
}

0 comments on commit 70ecf6f

Please sign in to comment.