Skip to content

Commit 05d78dc

Browse files
committed
test(review): 이미지 관련 로직 제거
1 parent ed9fb32 commit 05d78dc

File tree

3 files changed

+24
-29
lines changed

3 files changed

+24
-29
lines changed

src/test/java/com/somemore/domains/review/service/DeleteReviewServiceTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ void deleteReview() {
2828
UUID volunteerId = UUID.randomUUID();
2929
String title = "리뷰 제목";
3030
String content = "리뷰 내용";
31-
String imgUrl = "리뷰 이미지";
3231

33-
Review review = createReview(volunteerId, title, content, imgUrl);
32+
Review review = createReview(volunteerId, title, content);
3433
reviewRepository.save(review);
3534

3635
// when
@@ -41,7 +40,7 @@ void deleteReview() {
4140
assertThat(findReview).isEmpty();
4241
}
4342

44-
private Review createReview(UUID volunteerId, String title, String content, String imgUrl) {
43+
private Review createReview(UUID volunteerId, String title, String content) {
4544
return Review.builder()
4645
.volunteerApplyId(1L)
4746
.volunteerId(volunteerId)

src/test/java/com/somemore/domains/review/service/ReviewQueryServiceTest.java

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
package com.somemore.domains.review.service;
22

3+
import static com.somemore.domains.recruitboard.domain.VolunteerCategory.COUNSELING;
4+
import static com.somemore.domains.recruitboard.domain.VolunteerCategory.CULTURAL_EVENT;
5+
import static com.somemore.domains.recruitboard.domain.VolunteerCategory.OTHER;
6+
import static com.somemore.domains.volunteerapply.domain.ApplyStatus.APPROVED;
7+
import static com.somemore.global.auth.oauth.domain.OAuthProvider.NAVER;
8+
import static com.somemore.global.exception.ExceptionMessage.NOT_EXISTS_REVIEW;
9+
import static com.somemore.support.fixture.CenterFixture.createCenter;
10+
import static com.somemore.support.fixture.RecruitBoardFixture.createCompletedRecruitBoard;
11+
import static org.assertj.core.api.Assertions.assertThat;
12+
import static org.assertj.core.api.Assertions.assertThatThrownBy;
13+
import static org.assertj.core.api.AssertionsForClassTypes.tuple;
14+
315
import com.somemore.domains.center.domain.Center;
416
import com.somemore.domains.center.repository.center.CenterRepository;
517
import com.somemore.domains.recruitboard.domain.RecruitBoard;
@@ -16,6 +28,8 @@
1628
import com.somemore.domains.volunteerapply.repository.VolunteerApplyRepository;
1729
import com.somemore.global.exception.NoSuchElementException;
1830
import com.somemore.support.IntegrationTestSupport;
31+
import java.util.List;
32+
import java.util.UUID;
1933
import org.junit.jupiter.api.BeforeEach;
2034
import org.junit.jupiter.api.DisplayName;
2135
import org.junit.jupiter.api.Test;
@@ -25,19 +39,6 @@
2539
import org.springframework.data.domain.Pageable;
2640
import org.springframework.data.domain.Sort;
2741

28-
import java.util.List;
29-
import java.util.UUID;
30-
31-
import static com.somemore.domains.recruitboard.domain.VolunteerCategory.*;
32-
import static com.somemore.domains.volunteerapply.domain.ApplyStatus.APPROVED;
33-
import static com.somemore.global.auth.oauth.domain.OAuthProvider.NAVER;
34-
import static com.somemore.global.exception.ExceptionMessage.NOT_EXISTS_REVIEW;
35-
import static com.somemore.support.fixture.CenterFixture.createCenter;
36-
import static com.somemore.support.fixture.RecruitBoardFixture.createCompletedRecruitBoard;
37-
import static org.assertj.core.api.Assertions.assertThat;
38-
import static org.assertj.core.api.Assertions.assertThatThrownBy;
39-
import static org.assertj.core.api.AssertionsForClassTypes.tuple;
40-
4142
class ReviewQueryServiceTest extends IntegrationTestSupport {
4243

4344
@Autowired
@@ -145,11 +146,9 @@ void getReviewsByVolunteerId() {
145146
volunteerApplyRepository.saveAll(List.of(apply1, apply2));
146147

147148
Review review1 = createReview(apply1.getId(), volunteerId, "제 인생 최고의 봉사활동",
148-
"정말 유익했습니다. 더보기..",
149-
"https://image.domain.com/links1");
149+
"정말 유익했습니다. 더보기..");
150150
Review review2 = createReview(apply2.getId(), volunteerId, "보람있는 봉사활동",
151-
"많은 사람들에게 도움을 주었어요.",
152-
"https://image.domain.com/links2");
151+
"많은 사람들에게 도움을 주었어요.");
153152
reviewRepository.saveAll(List.of(review1, review2));
154153

155154
ReviewSearchCondition conditionWithoutCategory = ReviewSearchCondition.builder()
@@ -195,11 +194,9 @@ void getReviewsByCenterId() {
195194
volunteerApplyRepository.saveAll(List.of(apply1, apply2));
196195

197196
Review review1 = createReview(apply1.getId(), volunteer1.getId(), "제 인생 최고의 봉사활동",
198-
"정말 유익했습니다. 더보기..",
199-
"https://image.domain.com/links1");
197+
"정말 유익했습니다. 더보기..");
200198
Review review2 = createReview(apply2.getId(), volunteer2.getId(), "보람있는 봉사활동",
201-
"많은 사람들에게 도움을 주었어요.",
202-
"https://image.domain.com/links2");
199+
"많은 사람들에게 도움을 주었어요.");
203200
reviewRepository.saveAll(List.of(review1, review2));
204201

205202
ReviewSearchCondition condition = ReviewSearchCondition.builder()
@@ -232,8 +229,7 @@ private Review createReview(Long applyId, UUID volunteerId) {
232229
.build();
233230
}
234231

235-
private Review createReview(Long applyId, UUID volunteerId, String title, String content,
236-
String imgUrl) {
232+
private Review createReview(Long applyId, UUID volunteerId, String title, String content) {
237233
return Review.builder()
238234
.volunteerApplyId(applyId)
239235
.volunteerId(volunteerId)

src/test/java/com/somemore/domains/review/service/validator/ReviewValidatorTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ReviewValidatorTest {
1919
void validateWriter() {
2020
// given
2121
UUID volunteerId = UUID.randomUUID();
22-
Review review = createReview(volunteerId, "리뷰 제목", "내용내용", "이미지링크");
22+
Review review = createReview(volunteerId, "리뷰 제목", "내용내용");
2323

2424
// when
2525
// then
@@ -33,7 +33,7 @@ void validateWriter() {
3333
void validateWriterWhenMissMatch() {
3434
// given
3535
UUID wrongVolunteerId = UUID.randomUUID();
36-
Review review = createReview(UUID.randomUUID(), "다른 제목", "다른 내용", "다른 링크");
36+
Review review = createReview(UUID.randomUUID(), "다른 제목", "다른 내용");
3737

3838
// when
3939
// then
@@ -43,7 +43,7 @@ void validateWriterWhenMissMatch() {
4343
.hasMessage(UNAUTHORIZED_REVIEW.getMessage());
4444
}
4545

46-
private Review createReview(UUID volunteerId, String title, String content, String imgUrl) {
46+
private Review createReview(UUID volunteerId, String title, String content) {
4747
return Review.builder()
4848
.volunteerApplyId(1L)
4949
.volunteerId(volunteerId)

0 commit comments

Comments
 (0)