From d8cd5e55fdbd72bb52984b87c5605466ea6901ed Mon Sep 17 00:00:00 2001 From: hyeonjilee Date: Thu, 25 Jul 2024 08:26:33 +0900 Subject: [PATCH 01/15] =?UTF-8?q?test:=20QuestionTestFixture=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/reviewme/fixture/QuestionFixure.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 backend/src/test/java/reviewme/fixture/QuestionFixure.java diff --git a/backend/src/test/java/reviewme/fixture/QuestionFixure.java b/backend/src/test/java/reviewme/fixture/QuestionFixure.java new file mode 100644 index 000000000..cc3dc64a1 --- /dev/null +++ b/backend/src/test/java/reviewme/fixture/QuestionFixure.java @@ -0,0 +1,17 @@ +package reviewme.fixture; + +import reviewme.review.domain.Question; + +public enum QuestionFixure { + 소프트스킬이_어떤가요, + 기술역량이_어떤가요, + ; + + public Question create() { + return new Question(replaceUnderscores()); + } + + private String replaceUnderscores() { + return name().replace("_", " "); + } +} From f1bde507026f9ed3173068404724e3496ce9d822 Mon Sep 17 00:00:00 2001 From: hyeonjilee Date: Thu, 25 Jul 2024 08:27:41 +0900 Subject: [PATCH 02/15] =?UTF-8?q?feat:=20=EB=AA=A8=EB=93=A0=20=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=AC=B8=ED=95=AD=EC=9D=84=20=EC=A1=B0=ED=9A=8C?= =?UTF-8?q?=ED=95=98=EB=8A=94=20=EA=B8=B0=EB=8A=A5=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../review/dto/response/QuestionResponse.java | 14 ++++++++ .../review/repository/QuestionRepository.java | 9 +++++ .../review/service/QuestionService.java | 21 ++++++++++++ .../review/service/QuestionServiceTest.java | 34 +++++++++++++++++++ 4 files changed, 78 insertions(+) create mode 100644 backend/src/main/java/reviewme/review/dto/response/QuestionResponse.java create mode 100644 backend/src/main/java/reviewme/review/repository/QuestionRepository.java create mode 100644 backend/src/main/java/reviewme/review/service/QuestionService.java create mode 100644 backend/src/test/java/reviewme/review/service/QuestionServiceTest.java diff --git a/backend/src/main/java/reviewme/review/dto/response/QuestionResponse.java b/backend/src/main/java/reviewme/review/dto/response/QuestionResponse.java new file mode 100644 index 000000000..57a801643 --- /dev/null +++ b/backend/src/main/java/reviewme/review/dto/response/QuestionResponse.java @@ -0,0 +1,14 @@ +package reviewme.review.dto.response; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(description = "리뷰 문항 응답") +public record QuestionResponse( + + @Schema(description = "리뷰 문항 ID") + long id, + + @Schema(description = "리뷰 문항") + String content +) { +} diff --git a/backend/src/main/java/reviewme/review/repository/QuestionRepository.java b/backend/src/main/java/reviewme/review/repository/QuestionRepository.java new file mode 100644 index 000000000..59d586db0 --- /dev/null +++ b/backend/src/main/java/reviewme/review/repository/QuestionRepository.java @@ -0,0 +1,9 @@ +package reviewme.review.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; +import reviewme.review.domain.Question; + +@Repository +public interface QuestionRepository extends JpaRepository { +} diff --git a/backend/src/main/java/reviewme/review/service/QuestionService.java b/backend/src/main/java/reviewme/review/service/QuestionService.java new file mode 100644 index 000000000..67a1ea2ee --- /dev/null +++ b/backend/src/main/java/reviewme/review/service/QuestionService.java @@ -0,0 +1,21 @@ +package reviewme.review.service; + +import java.util.List; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import reviewme.review.dto.response.QuestionResponse; +import reviewme.review.repository.QuestionRepository; + +@Service +@RequiredArgsConstructor +public class QuestionService { + + private final QuestionRepository questionRepository; + + public List findAllQuestions() { + return questionRepository.findAll() + .stream() + .map(question -> new QuestionResponse(question.getId(), question.getContent())) + .toList(); + } +} diff --git a/backend/src/test/java/reviewme/review/service/QuestionServiceTest.java b/backend/src/test/java/reviewme/review/service/QuestionServiceTest.java new file mode 100644 index 000000000..c9c1c372d --- /dev/null +++ b/backend/src/test/java/reviewme/review/service/QuestionServiceTest.java @@ -0,0 +1,34 @@ +package reviewme.review.service; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.List; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import reviewme.fixture.QuestionFixure; +import reviewme.review.dto.response.QuestionResponse; +import reviewme.review.repository.QuestionRepository; + +@SpringBootTest(webEnvironment = WebEnvironment.NONE) +class QuestionServiceTest { + + @Autowired + QuestionService questionService; + + @Autowired + QuestionRepository questionRepository; + + @Test + void 모든_리뷰_문항을_조회한다() { + // given + questionRepository.save(QuestionFixure.소프트스킬이_어떤가요.create()); + + // when + List questions = questionService.findAllQuestions(); + + // then + assertThat(questions).hasSize(1); + } +} From 274418b6e122c9363c0e31c38893251e887bd363 Mon Sep 17 00:00:00 2001 From: hyeonjilee Date: Thu, 25 Jul 2024 08:28:14 +0900 Subject: [PATCH 03/15] =?UTF-8?q?feat:=20=EB=AA=A8=EB=93=A0=20=ED=82=A4?= =?UTF-8?q?=EC=9B=8C=EB=93=9C=EB=A5=BC=20=EC=A1=B0=ED=9A=8C=ED=95=98?= =?UTF-8?q?=EB=8A=94=20=EA=B8=B0=EB=8A=A5=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../keyword/service/KeywordService.java | 6 ++-- .../keyword/service/KeywordServiceTest.java | 35 +++++++++++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 backend/src/test/java/reviewme/keyword/service/KeywordServiceTest.java diff --git a/backend/src/main/java/reviewme/keyword/service/KeywordService.java b/backend/src/main/java/reviewme/keyword/service/KeywordService.java index 9341d0b6a..a6ee42b7f 100644 --- a/backend/src/main/java/reviewme/keyword/service/KeywordService.java +++ b/backend/src/main/java/reviewme/keyword/service/KeywordService.java @@ -4,7 +4,6 @@ import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import reviewme.keyword.dto.response.KeywordResponse; -import reviewme.keyword.dto.response.KeywordsResponse; import reviewme.keyword.repository.KeywordRepository; @Service @@ -13,11 +12,10 @@ public class KeywordService { private final KeywordRepository keywordRepository; - public KeywordsResponse findAllKeywords() { - List responses = keywordRepository.findAll() + public List findAllKeywords() { + return keywordRepository.findAll() .stream() .map(keyword -> new KeywordResponse(keyword.getId(), keyword.getContent())) .toList(); - return new KeywordsResponse(responses); } } diff --git a/backend/src/test/java/reviewme/keyword/service/KeywordServiceTest.java b/backend/src/test/java/reviewme/keyword/service/KeywordServiceTest.java new file mode 100644 index 000000000..cfd8021fa --- /dev/null +++ b/backend/src/test/java/reviewme/keyword/service/KeywordServiceTest.java @@ -0,0 +1,35 @@ +package reviewme.keyword.service; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.*; + +import java.util.List; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import reviewme.fixture.KeywordFixture; +import reviewme.keyword.dto.response.KeywordResponse; +import reviewme.keyword.repository.KeywordRepository; + +@SpringBootTest(webEnvironment = WebEnvironment.NONE) +class KeywordServiceTest { + + @Autowired + KeywordService keywordService; + + @Autowired + KeywordRepository keywordRepository; + + @Test + void 모든_키워드를_조회한다() { + // given + keywordRepository.save(KeywordFixture.회의를_이끌어요.create()); + + // when + List keywords = keywordService.findAllKeywords(); + + // then + assertThat(keywords).hasSize(1); + } +} From 1bb6831d9541ce7d4a7205e9541c7c79db43fd3c Mon Sep 17 00:00:00 2001 From: hyeonjilee Date: Thu, 25 Jul 2024 08:28:40 +0900 Subject: [PATCH 04/15] =?UTF-8?q?test:=20ReviewerGroupFixture=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fixture/ReviewerGroupFixture.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 backend/src/test/java/reviewme/fixture/ReviewerGroupFixture.java diff --git a/backend/src/test/java/reviewme/fixture/ReviewerGroupFixture.java b/backend/src/test/java/reviewme/fixture/ReviewerGroupFixture.java new file mode 100644 index 000000000..6d1dab1c5 --- /dev/null +++ b/backend/src/test/java/reviewme/fixture/ReviewerGroupFixture.java @@ -0,0 +1,23 @@ +package reviewme.fixture; + +import java.time.LocalDateTime; +import java.util.List; +import lombok.RequiredArgsConstructor; +import reviewme.member.domain.GithubId; +import reviewme.member.domain.Member; +import reviewme.member.domain.ReviewerGroup; + +@RequiredArgsConstructor +public enum ReviewerGroupFixture { + + 리뷰_그룹("리뷰 그룹", "그룹 설명", LocalDateTime.of(2024, 1, 1, 12, 0)), + ; + + private final String groupName; + private final String description; + private final LocalDateTime deadline; + + public ReviewerGroup create(Member reviewee, List reviewerGithubIds) { + return new ReviewerGroup(reviewee, reviewerGithubIds, groupName, description, deadline); + } +} From 92098cbf2049e526d336a2de849134dd9941447b Mon Sep 17 00:00:00 2001 From: hyeonjilee Date: Thu, 25 Jul 2024 08:31:06 +0900 Subject: [PATCH 05/15] =?UTF-8?q?feat:=20=EB=A6=AC=EB=B7=B0=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=EC=8B=9C=20=ED=95=84=EC=9A=94=ED=95=9C=20=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=EC=96=B4=20=EA=B7=B8=EB=A3=B9=20=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=EB=A5=BC=20=EC=A1=B0=ED=9A=8C=ED=95=98=EB=8A=94=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReviewCreationReviewerGroupResponse.java | 27 +++++++++++ .../member/service/ReviewerGroupService.java | 14 ++++++ .../service/ReviewerGroupServiceTest.java | 48 +++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 backend/src/main/java/reviewme/member/dto/response/ReviewCreationReviewerGroupResponse.java create mode 100644 backend/src/test/java/reviewme/member/service/ReviewerGroupServiceTest.java diff --git a/backend/src/main/java/reviewme/member/dto/response/ReviewCreationReviewerGroupResponse.java b/backend/src/main/java/reviewme/member/dto/response/ReviewCreationReviewerGroupResponse.java new file mode 100644 index 000000000..624508344 --- /dev/null +++ b/backend/src/main/java/reviewme/member/dto/response/ReviewCreationReviewerGroupResponse.java @@ -0,0 +1,27 @@ +package reviewme.member.dto.response; + +import io.swagger.v3.oas.annotations.media.Schema; +import java.time.LocalDate; + +@Schema(description = "리뷰 생성 시 필요한 리뷰어 그룹 응답") +public record ReviewCreationReviewerGroupResponse( + + @Schema(description = "리뷰어 그룹 아이디") + long id, + + @Schema(description = "리뷰 그룹 이름 (레포지토리명)") + String name, + + @Schema(description = "그룹 소개") + String description, + + @Schema(description = "리뷰 작성 기한") + LocalDate deadline, + + @Schema(description = "썸네일 URL") + String thumbnailUrl, + + @Schema(description = "리뷰이") + MemberResponse reviewee +) { +} diff --git a/backend/src/main/java/reviewme/member/service/ReviewerGroupService.java b/backend/src/main/java/reviewme/member/service/ReviewerGroupService.java index 10ec31a97..f174d80f6 100644 --- a/backend/src/main/java/reviewme/member/service/ReviewerGroupService.java +++ b/backend/src/main/java/reviewme/member/service/ReviewerGroupService.java @@ -7,6 +7,7 @@ import reviewme.member.dto.response.MemberResponse; import reviewme.member.dto.response.ReviewerGroupResponse; import reviewme.member.repository.ReviewerGroupRepository; +import reviewme.member.dto.response.ReviewCreationReviewerGroupResponse; @Service @RequiredArgsConstructor @@ -24,4 +25,17 @@ public ReviewerGroupResponse findReviewerGroup(long reviewerGroupId) { new MemberResponse(reviewee.getId(), reviewee.getName()) ); } + + public ReviewCreationReviewerGroupResponse findReviewCreationReviewerGroup(long reviewerGroupId) { + ReviewerGroup reviewerGroup = reviewerGroupRepository.getReviewerGroupById(reviewerGroupId); + Member reviewee = reviewerGroup.getReviewee(); + return new ReviewCreationReviewerGroupResponse( + reviewerGroup.getId(), + reviewerGroup.getGroupName(), + reviewerGroup.getDescription(), + reviewerGroup.getDeadline().toLocalDate(), + reviewerGroup.getThumbnailUrl(), + new MemberResponse(reviewee.getId(), reviewee.getName()) + ); + } } diff --git a/backend/src/test/java/reviewme/member/service/ReviewerGroupServiceTest.java b/backend/src/test/java/reviewme/member/service/ReviewerGroupServiceTest.java new file mode 100644 index 000000000..88c1bee69 --- /dev/null +++ b/backend/src/test/java/reviewme/member/service/ReviewerGroupServiceTest.java @@ -0,0 +1,48 @@ +package reviewme.member.service; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertAll; +import static reviewme.fixture.ReviewerGroupFixture.리뷰_그룹; + +import java.util.List; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import reviewme.member.domain.GithubId; +import reviewme.member.domain.Member; +import reviewme.member.domain.ReviewerGroup; +import reviewme.member.dto.response.ReviewCreationReviewerGroupResponse; +import reviewme.member.repository.MemberRepository; +import reviewme.member.repository.ReviewerGroupRepository; + +@SpringBootTest(webEnvironment = WebEnvironment.NONE) +class ReviewerGroupServiceTest { + + @Autowired + ReviewerGroupService reviewerGroupService; + + @Autowired + ReviewerGroupRepository reviewerGroupRepository; + + @Autowired + MemberRepository memberRepository; + + @Test + void 리뷰_생성_시_필요한_리뷰어_그룹_정보를_조회한다() { + // given + Member reviewee = memberRepository.save(new Member("산초", 1)); + List reviewergithubIds = List.of(new GithubId(2), new GithubId(3)); + ReviewerGroup reviewerGroup = reviewerGroupRepository.save(리뷰_그룹.create(reviewee, reviewergithubIds)); + + // when + ReviewCreationReviewerGroupResponse actual = reviewerGroupService.findReviewCreationReviewerGroup( + reviewerGroup.getId()); + + // then + assertAll( + () -> assertThat(actual.id()).isEqualTo(reviewerGroup.getId()), + () -> assertThat(actual.reviewee().id()).isEqualTo(reviewee.getId()) + ); + } +} From bda20e107301901886d219aeaf99058e30a49640 Mon Sep 17 00:00:00 2001 From: hyeonjilee Date: Thu, 25 Jul 2024 08:33:25 +0900 Subject: [PATCH 06/15] =?UTF-8?q?feat:=20=EB=A6=AC=EB=B7=B0=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=EC=8B=9C=20=ED=95=84=EC=9A=94=ED=95=9C=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=EB=A5=BC=20=EC=A1=B0=ED=9A=8C=ED=95=98=EB=8A=94=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../review/controller/ReviewController.java | 7 +++++++ .../review/dto/ReviewCreationResponse.java | 21 +++++++++++++++++++ .../review/service/ReviewService.java | 18 ++++++++++++++-- 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 backend/src/main/java/reviewme/review/dto/ReviewCreationResponse.java diff --git a/backend/src/main/java/reviewme/review/controller/ReviewController.java b/backend/src/main/java/reviewme/review/controller/ReviewController.java index 955492d8c..fb9ddf191 100644 --- a/backend/src/main/java/reviewme/review/controller/ReviewController.java +++ b/backend/src/main/java/reviewme/review/controller/ReviewController.java @@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import reviewme.review.dto.ReviewCreationResponse; import reviewme.review.dto.request.CreateReviewRequest; import reviewme.review.dto.response.ReviewDetailResponse; import reviewme.review.service.ReviewService; @@ -32,4 +33,10 @@ public ResponseEntity findReview(@PathVariable long id, ReviewDetailResponse response = reviewService.findReview(id, memberId); return ResponseEntity.ok(response); } + + @GetMapping("/reviews/write") + public ResponseEntity findReviewCreationSetup(@RequestParam long reviewerGroupId) { + ReviewCreationResponse response = reviewService.findReviewCreationSetup(reviewerGroupId); + return ResponseEntity.ok(response); + } } diff --git a/backend/src/main/java/reviewme/review/dto/ReviewCreationResponse.java b/backend/src/main/java/reviewme/review/dto/ReviewCreationResponse.java new file mode 100644 index 000000000..037d331b1 --- /dev/null +++ b/backend/src/main/java/reviewme/review/dto/ReviewCreationResponse.java @@ -0,0 +1,21 @@ +package reviewme.review.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.List; +import reviewme.keyword.dto.response.KeywordResponse; +import reviewme.member.dto.response.ReviewCreationReviewerGroupResponse; +import reviewme.review.dto.response.QuestionResponse; + +@Schema(description = "리뷰 생성 시 필요한 정보 응답") +public record ReviewCreationResponse( + + @Schema(description = "리뷰어 그룹") + ReviewCreationReviewerGroupResponse reviewerGroup, + + @Schema(description = "리뷰 문항 목록") + List questions, + + @Schema(description = "키워드 목록") + List keywords +) { +} diff --git a/backend/src/main/java/reviewme/review/service/ReviewService.java b/backend/src/main/java/reviewme/review/service/ReviewService.java index 38614f6a6..6a84099fc 100644 --- a/backend/src/main/java/reviewme/review/service/ReviewService.java +++ b/backend/src/main/java/reviewme/review/service/ReviewService.java @@ -6,13 +6,18 @@ import org.springframework.transaction.annotation.Transactional; import reviewme.keyword.domain.Keyword; import reviewme.keyword.domain.Keywords; +import reviewme.keyword.dto.response.KeywordResponse; import reviewme.keyword.repository.KeywordRepository; +import reviewme.keyword.service.KeywordService; import reviewme.member.domain.Member; import reviewme.member.domain.ReviewerGroup; import reviewme.member.repository.MemberRepository; -import reviewme.member.repository.ReviewerGroupRepository; +import reviewme.member.service.ReviewerGroupService; import reviewme.review.domain.Review; import reviewme.review.domain.ReviewContent; +import reviewme.review.dto.ReviewCreationResponse; +import reviewme.review.dto.response.QuestionResponse; +import reviewme.member.dto.response.ReviewCreationReviewerGroupResponse; import reviewme.review.dto.request.CreateReviewRequest; import reviewme.review.dto.response.ReviewDetailResponse; import reviewme.review.dto.response.ReviewDetailReviewContentResponse; @@ -25,9 +30,11 @@ @RequiredArgsConstructor public class ReviewService { + private final ReviewerGroupService reviewerGroupService; + private final KeywordService keywordService; + private final QuestionService questionService; private final ReviewRepository reviewRepository; private final MemberRepository memberRepository; - private final ReviewerGroupRepository reviewerGroupRepository; private final ReviewContentRepository reviewContentRepository; private final KeywordRepository keywordRepository; @@ -75,4 +82,11 @@ public ReviewDetailResponse findReview(long reviewId, long memberId) { keywordContents ); } + + public ReviewCreationResponse findReviewCreationSetup(long reviewerGroupId) { + ReviewCreationReviewerGroupResponse reviewerGroup = reviewerGroupService.findReviewCreationReviewerGroup(reviewerGroupId); + List questions = questionService.findAllQuestions(); + List keywords = keywordService.findAllKeywords(); + return new ReviewCreationResponse(reviewerGroup, questions, keywords); + } } From 12e23b447aa3228a6b7d77914220bba32695709b Mon Sep 17 00:00:00 2001 From: hyeonjilee Date: Thu, 25 Jul 2024 10:12:13 +0900 Subject: [PATCH 07/15] =?UTF-8?q?refactor:=20@ServiceTest=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/reviewme/keyword/service/KeywordServiceTest.java | 6 ++---- .../reviewme/member/service/ReviewerGroupServiceTest.java | 5 ++--- .../java/reviewme/review/service/QuestionServiceTest.java | 5 ++--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/backend/src/test/java/reviewme/keyword/service/KeywordServiceTest.java b/backend/src/test/java/reviewme/keyword/service/KeywordServiceTest.java index cfd8021fa..55f1e9417 100644 --- a/backend/src/test/java/reviewme/keyword/service/KeywordServiceTest.java +++ b/backend/src/test/java/reviewme/keyword/service/KeywordServiceTest.java @@ -1,18 +1,16 @@ package reviewme.keyword.service; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.*; import java.util.List; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import reviewme.fixture.KeywordFixture; import reviewme.keyword.dto.response.KeywordResponse; import reviewme.keyword.repository.KeywordRepository; +import reviewme.support.ServiceTest; -@SpringBootTest(webEnvironment = WebEnvironment.NONE) +@ServiceTest class KeywordServiceTest { @Autowired diff --git a/backend/src/test/java/reviewme/member/service/ReviewerGroupServiceTest.java b/backend/src/test/java/reviewme/member/service/ReviewerGroupServiceTest.java index 88c1bee69..4b3dfbe8b 100644 --- a/backend/src/test/java/reviewme/member/service/ReviewerGroupServiceTest.java +++ b/backend/src/test/java/reviewme/member/service/ReviewerGroupServiceTest.java @@ -7,16 +7,15 @@ import java.util.List; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import reviewme.member.domain.GithubId; import reviewme.member.domain.Member; import reviewme.member.domain.ReviewerGroup; import reviewme.member.dto.response.ReviewCreationReviewerGroupResponse; import reviewme.member.repository.MemberRepository; import reviewme.member.repository.ReviewerGroupRepository; +import reviewme.support.ServiceTest; -@SpringBootTest(webEnvironment = WebEnvironment.NONE) +@ServiceTest class ReviewerGroupServiceTest { @Autowired diff --git a/backend/src/test/java/reviewme/review/service/QuestionServiceTest.java b/backend/src/test/java/reviewme/review/service/QuestionServiceTest.java index c9c1c372d..6bb0a6451 100644 --- a/backend/src/test/java/reviewme/review/service/QuestionServiceTest.java +++ b/backend/src/test/java/reviewme/review/service/QuestionServiceTest.java @@ -5,13 +5,12 @@ import java.util.List; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import reviewme.fixture.QuestionFixure; import reviewme.review.dto.response.QuestionResponse; import reviewme.review.repository.QuestionRepository; +import reviewme.support.ServiceTest; -@SpringBootTest(webEnvironment = WebEnvironment.NONE) +@ServiceTest class QuestionServiceTest { @Autowired From 4708c690f2f51a9be9679d92f9cc629e7c127751 Mon Sep 17 00:00:00 2001 From: hyeonjilee Date: Thu, 25 Jul 2024 14:41:36 +0900 Subject: [PATCH 08/15] =?UTF-8?q?refactor:=20swagger=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/reviewme/review/controller/ReviewApi.java | 10 +++++++++- .../reviewme/review/controller/ReviewController.java | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/reviewme/review/controller/ReviewApi.java b/backend/src/main/java/reviewme/review/controller/ReviewApi.java index ea992c334..b1cb3d3bf 100644 --- a/backend/src/main/java/reviewme/review/controller/ReviewApi.java +++ b/backend/src/main/java/reviewme/review/controller/ReviewApi.java @@ -6,6 +6,8 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; +import reviewme.review.dto.ReviewCreationResponse; import reviewme.review.dto.request.CreateReviewRequest; import reviewme.review.dto.response.ReviewDetailResponse; @@ -23,5 +25,11 @@ public interface ReviewApi { summary = "리뷰 조회", description = "단일 리뷰를 조회한다." ) - ResponseEntity findReview(@PathVariable long id); + ResponseEntity findReview(@PathVariable long id, @RequestParam long memberId); + + @Operation( + summary = "리뷰 생성 시 필요한 정보 조회", + description = "리뷰 생성 시 필요한 정보를 조회한다." + ) + ResponseEntity findReviewCreationSetup(@RequestParam long reviewerGroupId); } diff --git a/backend/src/main/java/reviewme/review/controller/ReviewController.java b/backend/src/main/java/reviewme/review/controller/ReviewController.java index fb9ddf191..a8ea5b8b0 100644 --- a/backend/src/main/java/reviewme/review/controller/ReviewController.java +++ b/backend/src/main/java/reviewme/review/controller/ReviewController.java @@ -17,7 +17,7 @@ @RestController @RequiredArgsConstructor -public class ReviewController { +public class ReviewController implements ReviewApi{ private final ReviewService reviewService; From 9697ff0ee121bd64f925f1df2fc0c202f2ab9113 Mon Sep 17 00:00:00 2001 From: hyeonjilee Date: Thu, 25 Jul 2024 14:53:32 +0900 Subject: [PATCH 09/15] =?UTF-8?q?refactor:=20=ED=95=84=EB=93=9C=EB=AA=85?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/reviewme/keyword/dto/response/KeywordResponse.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/java/reviewme/keyword/dto/response/KeywordResponse.java b/backend/src/main/java/reviewme/keyword/dto/response/KeywordResponse.java index 09b72a1d1..6e75a1268 100644 --- a/backend/src/main/java/reviewme/keyword/dto/response/KeywordResponse.java +++ b/backend/src/main/java/reviewme/keyword/dto/response/KeywordResponse.java @@ -9,6 +9,6 @@ public record KeywordResponse( long id, @Schema(description = "키워드명") - String detail + String content ) { } From 57dbb5eecaf40597b7c48c50c04db38266cdacdc Mon Sep 17 00:00:00 2001 From: hyeonjilee Date: Thu, 25 Jul 2024 14:53:44 +0900 Subject: [PATCH 10/15] =?UTF-8?q?style:=20=EA=B0=9C=ED=96=89=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/test/java/reviewme/fixture/QuestionFixure.java | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/src/test/java/reviewme/fixture/QuestionFixure.java b/backend/src/test/java/reviewme/fixture/QuestionFixure.java index cc3dc64a1..cfcba7b27 100644 --- a/backend/src/test/java/reviewme/fixture/QuestionFixure.java +++ b/backend/src/test/java/reviewme/fixture/QuestionFixure.java @@ -3,6 +3,7 @@ import reviewme.review.domain.Question; public enum QuestionFixure { + 소프트스킬이_어떤가요, 기술역량이_어떤가요, ; From 6577359ea367408fb8c2f9903c333760dff16c22 Mon Sep 17 00:00:00 2001 From: hyeonjilee Date: Thu, 25 Jul 2024 14:54:29 +0900 Subject: [PATCH 11/15] =?UTF-8?q?refactor:=20=EB=82=A0=EC=A7=9C=20?= =?UTF-8?q?=ED=98=95=EC=8B=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/response/ReviewCreationReviewerGroupResponse.java | 4 ++-- .../java/reviewme/member/service/ReviewerGroupService.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/reviewme/member/dto/response/ReviewCreationReviewerGroupResponse.java b/backend/src/main/java/reviewme/member/dto/response/ReviewCreationReviewerGroupResponse.java index 624508344..7c902532a 100644 --- a/backend/src/main/java/reviewme/member/dto/response/ReviewCreationReviewerGroupResponse.java +++ b/backend/src/main/java/reviewme/member/dto/response/ReviewCreationReviewerGroupResponse.java @@ -1,7 +1,7 @@ package reviewme.member.dto.response; import io.swagger.v3.oas.annotations.media.Schema; -import java.time.LocalDate; +import java.time.LocalDateTime; @Schema(description = "리뷰 생성 시 필요한 리뷰어 그룹 응답") public record ReviewCreationReviewerGroupResponse( @@ -16,7 +16,7 @@ public record ReviewCreationReviewerGroupResponse( String description, @Schema(description = "리뷰 작성 기한") - LocalDate deadline, + LocalDateTime deadline, @Schema(description = "썸네일 URL") String thumbnailUrl, diff --git a/backend/src/main/java/reviewme/member/service/ReviewerGroupService.java b/backend/src/main/java/reviewme/member/service/ReviewerGroupService.java index f174d80f6..75ea4ee9a 100644 --- a/backend/src/main/java/reviewme/member/service/ReviewerGroupService.java +++ b/backend/src/main/java/reviewme/member/service/ReviewerGroupService.java @@ -33,7 +33,7 @@ public ReviewCreationReviewerGroupResponse findReviewCreationReviewerGroup(long reviewerGroup.getId(), reviewerGroup.getGroupName(), reviewerGroup.getDescription(), - reviewerGroup.getDeadline().toLocalDate(), + reviewerGroup.getDeadline(), reviewerGroup.getThumbnailUrl(), new MemberResponse(reviewee.getId(), reviewee.getName()) ); From 2da7521ffa4e5d7a02487b14e267e5de84757a32 Mon Sep 17 00:00:00 2001 From: hyeonjilee Date: Thu, 25 Jul 2024 14:54:47 +0900 Subject: [PATCH 12/15] =?UTF-8?q?test:=20import=EB=AC=B8=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/reviewme/review/service/QuestionServiceTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/test/java/reviewme/review/service/QuestionServiceTest.java b/backend/src/test/java/reviewme/review/service/QuestionServiceTest.java index 6bb0a6451..a9c056a4b 100644 --- a/backend/src/test/java/reviewme/review/service/QuestionServiceTest.java +++ b/backend/src/test/java/reviewme/review/service/QuestionServiceTest.java @@ -1,11 +1,11 @@ package reviewme.review.service; import static org.assertj.core.api.Assertions.assertThat; +import static reviewme.fixture.QuestionFixure.소프트스킬이_어떤가요; import java.util.List; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import reviewme.fixture.QuestionFixure; import reviewme.review.dto.response.QuestionResponse; import reviewme.review.repository.QuestionRepository; import reviewme.support.ServiceTest; @@ -22,7 +22,7 @@ class QuestionServiceTest { @Test void 모든_리뷰_문항을_조회한다() { // given - questionRepository.save(QuestionFixure.소프트스킬이_어떤가요.create()); + questionRepository.save(소프트스킬이_어떤가요.create()); // when List questions = questionService.findAllQuestions(); From 5c0e0d8e0a4b5c209a9ce413836bfb494dbc89f3 Mon Sep 17 00:00:00 2001 From: hyeonjilee Date: Thu, 25 Jul 2024 15:37:30 +0900 Subject: [PATCH 13/15] =?UTF-8?q?refactor:=20ReviewCreationResponse=20?= =?UTF-8?q?=ED=8C=A8=ED=82=A4=EC=A7=80=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/reviewme/review/controller/ReviewApi.java | 2 +- .../main/java/reviewme/review/controller/ReviewController.java | 2 +- .../review/dto/{ => response}/ReviewCreationResponse.java | 3 +-- .../src/main/java/reviewme/review/service/ReviewService.java | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) rename backend/src/main/java/reviewme/review/dto/{ => response}/ReviewCreationResponse.java (88%) diff --git a/backend/src/main/java/reviewme/review/controller/ReviewApi.java b/backend/src/main/java/reviewme/review/controller/ReviewApi.java index b1cb3d3bf..1acfa9bf3 100644 --- a/backend/src/main/java/reviewme/review/controller/ReviewApi.java +++ b/backend/src/main/java/reviewme/review/controller/ReviewApi.java @@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; -import reviewme.review.dto.ReviewCreationResponse; +import reviewme.review.dto.response.ReviewCreationResponse; import reviewme.review.dto.request.CreateReviewRequest; import reviewme.review.dto.response.ReviewDetailResponse; diff --git a/backend/src/main/java/reviewme/review/controller/ReviewController.java b/backend/src/main/java/reviewme/review/controller/ReviewController.java index a8ea5b8b0..77685df1c 100644 --- a/backend/src/main/java/reviewme/review/controller/ReviewController.java +++ b/backend/src/main/java/reviewme/review/controller/ReviewController.java @@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import reviewme.review.dto.ReviewCreationResponse; +import reviewme.review.dto.response.ReviewCreationResponse; import reviewme.review.dto.request.CreateReviewRequest; import reviewme.review.dto.response.ReviewDetailResponse; import reviewme.review.service.ReviewService; diff --git a/backend/src/main/java/reviewme/review/dto/ReviewCreationResponse.java b/backend/src/main/java/reviewme/review/dto/response/ReviewCreationResponse.java similarity index 88% rename from backend/src/main/java/reviewme/review/dto/ReviewCreationResponse.java rename to backend/src/main/java/reviewme/review/dto/response/ReviewCreationResponse.java index 037d331b1..cba063dfd 100644 --- a/backend/src/main/java/reviewme/review/dto/ReviewCreationResponse.java +++ b/backend/src/main/java/reviewme/review/dto/response/ReviewCreationResponse.java @@ -1,10 +1,9 @@ -package reviewme.review.dto; +package reviewme.review.dto.response; import io.swagger.v3.oas.annotations.media.Schema; import java.util.List; import reviewme.keyword.dto.response.KeywordResponse; import reviewme.member.dto.response.ReviewCreationReviewerGroupResponse; -import reviewme.review.dto.response.QuestionResponse; @Schema(description = "리뷰 생성 시 필요한 정보 응답") public record ReviewCreationResponse( diff --git a/backend/src/main/java/reviewme/review/service/ReviewService.java b/backend/src/main/java/reviewme/review/service/ReviewService.java index 6a84099fc..5c372ba39 100644 --- a/backend/src/main/java/reviewme/review/service/ReviewService.java +++ b/backend/src/main/java/reviewme/review/service/ReviewService.java @@ -15,7 +15,7 @@ import reviewme.member.service.ReviewerGroupService; import reviewme.review.domain.Review; import reviewme.review.domain.ReviewContent; -import reviewme.review.dto.ReviewCreationResponse; +import reviewme.review.dto.response.ReviewCreationResponse; import reviewme.review.dto.response.QuestionResponse; import reviewme.member.dto.response.ReviewCreationReviewerGroupResponse; import reviewme.review.dto.request.CreateReviewRequest; From e6b6b6eafabbf84a21052fd02ada985d14db80a0 Mon Sep 17 00:00:00 2001 From: hyeonjilee Date: Thu, 25 Jul 2024 15:38:04 +0900 Subject: [PATCH 14/15] =?UTF-8?q?refactor:=20readOnly=20=ED=8A=B8=EB=9E=9C?= =?UTF-8?q?=EC=9E=AD=EC=85=98=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/reviewme/keyword/service/KeywordService.java | 2 ++ .../main/java/reviewme/member/service/ReviewerGroupService.java | 2 ++ .../src/main/java/reviewme/review/service/QuestionService.java | 2 ++ .../src/main/java/reviewme/review/service/ReviewService.java | 1 + 4 files changed, 7 insertions(+) diff --git a/backend/src/main/java/reviewme/keyword/service/KeywordService.java b/backend/src/main/java/reviewme/keyword/service/KeywordService.java index a6ee42b7f..f971f5127 100644 --- a/backend/src/main/java/reviewme/keyword/service/KeywordService.java +++ b/backend/src/main/java/reviewme/keyword/service/KeywordService.java @@ -3,6 +3,7 @@ import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import reviewme.keyword.dto.response.KeywordResponse; import reviewme.keyword.repository.KeywordRepository; @@ -12,6 +13,7 @@ public class KeywordService { private final KeywordRepository keywordRepository; + @Transactional(readOnly = true) public List findAllKeywords() { return keywordRepository.findAll() .stream() diff --git a/backend/src/main/java/reviewme/member/service/ReviewerGroupService.java b/backend/src/main/java/reviewme/member/service/ReviewerGroupService.java index 75ea4ee9a..ff848a75b 100644 --- a/backend/src/main/java/reviewme/member/service/ReviewerGroupService.java +++ b/backend/src/main/java/reviewme/member/service/ReviewerGroupService.java @@ -2,6 +2,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import reviewme.member.domain.Member; import reviewme.member.domain.ReviewerGroup; import reviewme.member.dto.response.MemberResponse; @@ -26,6 +27,7 @@ public ReviewerGroupResponse findReviewerGroup(long reviewerGroupId) { ); } + @Transactional(readOnly = true) public ReviewCreationReviewerGroupResponse findReviewCreationReviewerGroup(long reviewerGroupId) { ReviewerGroup reviewerGroup = reviewerGroupRepository.getReviewerGroupById(reviewerGroupId); Member reviewee = reviewerGroup.getReviewee(); diff --git a/backend/src/main/java/reviewme/review/service/QuestionService.java b/backend/src/main/java/reviewme/review/service/QuestionService.java index 67a1ea2ee..41d482ee7 100644 --- a/backend/src/main/java/reviewme/review/service/QuestionService.java +++ b/backend/src/main/java/reviewme/review/service/QuestionService.java @@ -3,6 +3,7 @@ import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import reviewme.review.dto.response.QuestionResponse; import reviewme.review.repository.QuestionRepository; @@ -12,6 +13,7 @@ public class QuestionService { private final QuestionRepository questionRepository; + @Transactional(readOnly = true) public List findAllQuestions() { return questionRepository.findAll() .stream() diff --git a/backend/src/main/java/reviewme/review/service/ReviewService.java b/backend/src/main/java/reviewme/review/service/ReviewService.java index 5c372ba39..5be7f22ef 100644 --- a/backend/src/main/java/reviewme/review/service/ReviewService.java +++ b/backend/src/main/java/reviewme/review/service/ReviewService.java @@ -83,6 +83,7 @@ public ReviewDetailResponse findReview(long reviewId, long memberId) { ); } + @Transactional(readOnly = true) public ReviewCreationResponse findReviewCreationSetup(long reviewerGroupId) { ReviewCreationReviewerGroupResponse reviewerGroup = reviewerGroupService.findReviewCreationReviewerGroup(reviewerGroupId); List questions = questionService.findAllQuestions(); From b201d3aa66d67338f430db01a94cf08b0af00321 Mon Sep 17 00:00:00 2001 From: hyeonjilee Date: Thu, 25 Jul 2024 16:52:06 +0900 Subject: [PATCH 15/15] =?UTF-8?q?fix:=20=EB=A6=AC=EB=B7=B0=EC=96=B4=20?= =?UTF-8?q?=EC=A4=91=EB=B3=B5=20=EA=B2=80=EC=A6=9D=20=EC=9E=84=EC=8B=9C=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reviewme/member/domain/ReviewerGroup.java | 2 + .../member/domain/ReviewerGroupGithubIds.java | 9 +-- .../member/domain/ReviewerGroupTest.java | 65 +++++++++---------- 3 files changed, 39 insertions(+), 37 deletions(-) diff --git a/backend/src/main/java/reviewme/member/domain/ReviewerGroup.java b/backend/src/main/java/reviewme/member/domain/ReviewerGroup.java index 60207d593..b1fcb948e 100644 --- a/backend/src/main/java/reviewme/member/domain/ReviewerGroup.java +++ b/backend/src/main/java/reviewme/member/domain/ReviewerGroup.java @@ -15,6 +15,7 @@ import java.util.ArrayList; import java.util.List; import lombok.AccessLevel; +import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NoArgsConstructor; import reviewme.member.domain.exception.InvalidDescriptionLengthException; @@ -29,6 +30,7 @@ @Entity @Table(name = "reviewer_group") @NoArgsConstructor(access = AccessLevel.PROTECTED) +@EqualsAndHashCode(of = "id") @Getter public class ReviewerGroup { diff --git a/backend/src/main/java/reviewme/member/domain/ReviewerGroupGithubIds.java b/backend/src/main/java/reviewme/member/domain/ReviewerGroupGithubIds.java index e61919614..fe073e850 100644 --- a/backend/src/main/java/reviewme/member/domain/ReviewerGroupGithubIds.java +++ b/backend/src/main/java/reviewme/member/domain/ReviewerGroupGithubIds.java @@ -1,5 +1,6 @@ package reviewme.member.domain; +import jakarta.persistence.CascadeType; import jakarta.persistence.Embeddable; import jakarta.persistence.OneToMany; import java.util.List; @@ -14,7 +15,7 @@ @NoArgsConstructor(access = AccessLevel.PROTECTED) public class ReviewerGroupGithubIds { - @OneToMany(mappedBy = "reviewerGroup") + @OneToMany(mappedBy = "reviewerGroup", cascade = CascadeType.ALL) private Set reviewerGithubIds; public ReviewerGroupGithubIds(ReviewerGroup reviewerGroup, List githubIds) { @@ -24,9 +25,9 @@ public ReviewerGroupGithubIds(ReviewerGroup reviewerGroup, List github Set reviewers = githubIds.stream() .map(githubId -> new GithubIdReviewerGroup(githubId, reviewerGroup)) .collect(Collectors.toSet()); - if (reviewers.size() != githubIds.size()) { - throw new DuplicateReviewerException(); - } +// if (reviewers.size() != githubIds.size()) { +// throw new DuplicateReviewerException(); +// } this.reviewerGithubIds = reviewers; } diff --git a/backend/src/test/java/reviewme/member/domain/ReviewerGroupTest.java b/backend/src/test/java/reviewme/member/domain/ReviewerGroupTest.java index 006e39cf5..e26e865b0 100644 --- a/backend/src/test/java/reviewme/member/domain/ReviewerGroupTest.java +++ b/backend/src/test/java/reviewme/member/domain/ReviewerGroupTest.java @@ -10,7 +10,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -import reviewme.member.domain.exception.DuplicateReviewerException; import reviewme.member.domain.exception.EmptyReviewerException; import reviewme.member.domain.exception.InvalidDescriptionLengthException; import reviewme.member.domain.exception.InvalidGroupNameLengthException; @@ -88,36 +87,36 @@ class ReviewerGroupTest { .isInstanceOf(EmptyReviewerException.class); } - @Test - void 리뷰어를_중복으로_가지게_그룹을_생성할_수_없다() { - // given - Member reviewer = 회원_산초.create(); - Member reviewee = 회원_커비.create(); - String groupName = "Group"; - String description = "Description"; - LocalDateTime deadline = LocalDateTime.now().plusDays(1); - List reviewerGithubIds = List.of(reviewer.getGithubId(), reviewer.getGithubId()); - - // when, then - assertThatThrownBy(() -> new ReviewerGroup(reviewee, reviewerGithubIds, groupName, description, deadline)) - .isInstanceOf(DuplicateReviewerException.class); - } - - @Test - void 리뷰어를_중복으로_추가할_수_없다() { - // given - Member reviewer = 회원_커비.create(); - Member reviewee = 회원_산초.create(); - - String groupName = "Group"; - String description = "Description"; - LocalDateTime deadline = LocalDateTime.now().plusDays(1); - List reviewerGithubIds = List.of(reviewer.getGithubId()); - ReviewerGroup reviewerGroup = new ReviewerGroup(reviewee, reviewerGithubIds, groupName, description, deadline); - GithubIdReviewerGroup githubIdReviewerGroup = new GithubIdReviewerGroup(reviewee.getGithubId(), reviewerGroup); - - // when, then - assertThatThrownBy(() -> reviewerGroup.addReviewerGithubId(githubIdReviewerGroup)) - .isInstanceOf(DuplicateReviewerException.class); - } +// @Test +// void 리뷰어를_중복으로_가지게_그룹을_생성할_수_없다() { +// // given +// Member reviewer = 회원_산초.create(); +// Member reviewee = 회원_커비.create(); +// String groupName = "Group"; +// String description = "Description"; +// LocalDateTime deadline = LocalDateTime.now().plusDays(1); +// List reviewerGithubIds = List.of(reviewer.getGithubId(), reviewer.getGithubId()); +// +// // when, then +// assertThatThrownBy(() -> new ReviewerGroup(reviewee, reviewerGithubIds, groupName, description, deadline)) +// .isInstanceOf(DuplicateReviewerException.class); +// } + +// @Test +// void 리뷰어를_중복으로_추가할_수_없다() { +// // given +// Member reviewer = 회원_커비.create(); +// Member reviewee = 회원_산초.create(); +// +// String groupName = "Group"; +// String description = "Description"; +// LocalDateTime deadline = LocalDateTime.now().plusDays(1); +// List reviewerGithubIds = List.of(reviewer.getGithubId()); +// ReviewerGroup reviewerGroup = new ReviewerGroup(reviewee, reviewerGithubIds, groupName, description, deadline); +// GithubIdReviewerGroup githubIdReviewerGroup = new GithubIdReviewerGroup(reviewee.getGithubId(), reviewerGroup); +// +// // when, then +// assertThatThrownBy(() -> reviewerGroup.addReviewerGithubId(githubIdReviewerGroup)) +// .isInstanceOf(DuplicateReviewerException.class); +// } }