Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] 피드백 키워드 추가(#766) #767

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/src/main/java/corea/ContextInitializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,8 @@ private void matchingAndReviewComplete(List<Participation> participations, Room
}

private void reviewSocialAndDevelopFeedback(MatchResult matchResult) {
socialFeedbackRepository.save(new SocialFeedback(matchResult.getRoomId(), matchResult.getReviewee(), matchResult.getReviewer(), 5, List.of(KIND, GOOD_AT_EXPLAINING), "너무 맘에 드는 말투이고, 설명이 친절했어요! 기회가 된다면 한번 더 리뷰 받고 싶어요~"));
developFeedbackRepository.save(new DevelopFeedback(matchResult.getRoomId(), matchResult.getReviewer(), matchResult.getReviewee(), 5, List.of(EASY_TO_UNDERSTAND_THE_CODE, MAKE_CODE_FOR_THE_PURPOSE), "코드를 이해하기 쉬워 리뷰하기 편했어요!~", 3));
socialFeedbackRepository.save(new SocialFeedback(matchResult.getRoomId(), matchResult.getReviewee(), matchResult.getReviewer(), 5, List.of(POSITIVE_SOCIAL_FEEDBACK_1, POSITIVE_SOCIAL_FEEDBACK_2), "너무 맘에 드는 말투이고, 설명이 친절했어요! 기회가 된다면 한번 더 리뷰 받고 싶어요~"));
developFeedbackRepository.save(new DevelopFeedback(matchResult.getRoomId(), matchResult.getReviewer(), matchResult.getReviewee(), 5, List.of(POSITIVE_DEVELOP_FEEDBACK_1, POSITIVE_DEVELOP_FEEDBACK_2), "코드를 이해하기 쉬워 리뷰하기 편했어요!~", 3));
matchResult.reviewComplete();
matchResult.reviewerCompleteFeedback();
matchResult.revieweeCompleteFeedback();
Expand Down
115 changes: 90 additions & 25 deletions backend/src/main/java/corea/feedback/domain/FeedbackKeyword.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,96 @@
@Getter
public enum FeedbackKeyword {

MAKE_CODE_FOR_THE_PURPOSE("방의 목적에 맞게 코드를 잘 작성했어요", Evaluation.POSITIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
EASY_TO_UNDERSTAND_THE_CODE("코드를 이해하기 쉬웠어요", Evaluation.POSITIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
RESPONSE_FAST("응답 속도가 빨랐어요", Evaluation.POSITIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),

MAKE_CODE_FOR_THE_LITTLE_PURPOSE("방의 목적에 놓친 부분이 있어요", Evaluation.NORMAL, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NORMAL_TO_UNDERSTAND_THE_CODE("코드를 이해는 했어요", Evaluation.NORMAL, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
RESPONSE_NORMAL("응답 속도가 적당했어요", Evaluation.NORMAL, KeywordType.DEVELOP_FEEDBACK_KEYWORD),

NOT_MAKE_CODE_FOR_THE_PURPOSE("방의 목적에 맞게 코드를 작성하지 않았어요", Evaluation.NEGATIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
HARD_TO_UNDERSTAND_THE_CODE("코드를 이해하기 어려웠어요", Evaluation.NEGATIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
RESPONSE_SLOW("응답 속도가 느렸어요", Evaluation.NEGATIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),

KIND("친절했어요", Evaluation.POSITIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
GOOD_AT_EXPLAINING("설명이 이해가 잘 되었어요", Evaluation.POSITIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
HELPFUL("매우 도움이 되었어요", Evaluation.POSITIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
REVIEW_FAST("리뷰 속도가 빨랐어요", Evaluation.POSITIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),

NORMAL_AT_EXPLAINING("설명이 이해가 잘 되지 않았어요", Evaluation.NORMAL, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NORMALFUL("도움이 되었어요", Evaluation.NORMAL, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
REVIEW_NORMAL("리뷰 속도가 적당했어요", Evaluation.NORMAL, KeywordType.SOCIAL_FEEDBACK_KEYWORD),

UNKIND("불친절했어요", Evaluation.NEGATIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
BAD_AT_EXPLAINING("설명이 부족해요", Evaluation.NEGATIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NOT_HELPFUL("도움이 되지 않았어요", Evaluation.NEGATIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
REVIEW_SLOW("리뷰 속도가 느렸어요", Evaluation.NEGATIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
POSITIVE_DEVELOP_FEEDBACK_1("코드를 이해하기 쉬웠어요", Evaluation.POSITIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
POSITIVE_DEVELOP_FEEDBACK_2("코드의 가독성이 뛰어나요", Evaluation.POSITIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
POSITIVE_DEVELOP_FEEDBACK_3("코드가 일관성 있게 작성되어 있어요", Evaluation.POSITIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
POSITIVE_DEVELOP_FEEDBACK_4("변수 이름이 명확하고 직관적이에요", Evaluation.POSITIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
POSITIVE_DEVELOP_FEEDBACK_5("메서드 및 클래스 이름이 명확해요", Evaluation.POSITIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
POSITIVE_DEVELOP_FEEDBACK_6("기능이 명확하게 잘 구현되어 있어요", Evaluation.POSITIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
POSITIVE_DEVELOP_FEEDBACK_7("코드의 구조가 논리적이에요", Evaluation.POSITIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
POSITIVE_DEVELOP_FEEDBACK_8("코드 재사용성이 높아요", Evaluation.POSITIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
POSITIVE_DEVELOP_FEEDBACK_9("예외 처리가 잘 되어 있어 안정적이에요", Evaluation.POSITIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
POSITIVE_DEVELOP_FEEDBACK_10("문서화가 잘 되어 있어요", Evaluation.POSITIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
POSITIVE_DEVELOP_FEEDBACK_11("테스트가 잘 작성되어 있어요", Evaluation.POSITIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
POSITIVE_DEVELOP_FEEDBACK_12("코드가 잘 최적화되어 성능이 좋아요", Evaluation.POSITIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
POSITIVE_DEVELOP_FEEDBACK_13("다양한 에지 케이스를 고려한 코드에요", Evaluation.POSITIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
POSITIVE_DEVELOP_FEEDBACK_14("응답 속도가 빨랐어요", Evaluation.POSITIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),

NORMAL_DEVELOP_FEEDBACK_1("코드가 다소 복잡하게 느껴져요", Evaluation.NORMAL, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NORMAL_DEVELOP_FEEDBACK_2("가독성을 높이기 위한 리팩토링이 필요해요", Evaluation.NORMAL, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NORMAL_DEVELOP_FEEDBACK_3("기능은 잘 작동하지만 코드가 길어요", Evaluation.NORMAL, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NORMAL_DEVELOP_FEEDBACK_4("코드의 일부가 중복되어 있어요", Evaluation.NORMAL, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NORMAL_DEVELOP_FEEDBACK_5("기능이 제한적이어서 확장성이 떨어져요", Evaluation.NORMAL, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NORMAL_DEVELOP_FEEDBACK_6("테스트 케이스가 몇 개 더 필요해요", Evaluation.NORMAL, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NORMAL_DEVELOP_FEEDBACK_7("예외 처리 부분이 부족해 보여요", Evaluation.NORMAL, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NORMAL_DEVELOP_FEEDBACK_8("성능 개선이 필요한 부분이 있어요", Evaluation.NORMAL, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NORMAL_DEVELOP_FEEDBACK_9("문서화가 부족한 부분이 있어요", Evaluation.NORMAL, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NORMAL_DEVELOP_FEEDBACK_10("코드가 기본적인 구조는 갖추고 있어요", Evaluation.NORMAL, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NORMAL_DEVELOP_FEEDBACK_11("코드의 일관성이 조금 부족한 것 같아요", Evaluation.NORMAL, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NORMAL_DEVELOP_FEEDBACK_12("에러 메시지가 부족해요", Evaluation.NORMAL, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NORMAL_DEVELOP_FEEDBACK_13("응답 속도가 적당했어요", Evaluation.NORMAL, KeywordType.DEVELOP_FEEDBACK_KEYWORD),

NEGATIVE_DEVELOP_FEEDBACK_1("코드를 이해하기 어려웠어요", Evaluation.NEGATIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NEGATIVE_DEVELOP_FEEDBACK_2("코드의 가독성이 떨어져요", Evaluation.NEGATIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NEGATIVE_DEVELOP_FEEDBACK_4("코드가 일관성 있게 작성되지 않았어요", Evaluation.NEGATIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NEGATIVE_DEVELOP_FEEDBACK_3("변수 이름이 불명확하고 직관적이지 않아요", Evaluation.NEGATIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NEGATIVE_DEVELOP_FEEDBACK_5("메서드 및 클래스 이름이 명확하지 않아요", Evaluation.NEGATIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NEGATIVE_DEVELOP_FEEDBACK_6("기능이 명확하게 구현되지 않았어요", Evaluation.NEGATIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NEGATIVE_DEVELOP_FEEDBACK_7("코드의 구조가 비논리적이에요", Evaluation.NEGATIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NEGATIVE_DEVELOP_FEEDBACK_8("코드 재사용성이 낮아요", Evaluation.NEGATIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NEGATIVE_DEVELOP_FEEDBACK_9("예외 처리가 부족해 불안정해요", Evaluation.NEGATIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NEGATIVE_DEVELOP_FEEDBACK_10("문서화가 부족해요", Evaluation.NEGATIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NEGATIVE_DEVELOP_FEEDBACK_11("테스트가 부족해요", Evaluation.NEGATIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NEGATIVE_DEVELOP_FEEDBACK_12("코드가 최적화되지 않아 성능이 떨어져요", Evaluation.NEGATIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NEGATIVE_DEVELOP_FEEDBACK_13("다양한 에지 케이스를 고려하지 않은 코드에요", Evaluation.NEGATIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),
NEGATIVE_DEVELOP_FEEDBACK_14("응답 속도가 느렸어요", Evaluation.NEGATIVE, KeywordType.DEVELOP_FEEDBACK_KEYWORD),

POSITIVE_SOCIAL_FEEDBACK_1("친절했어요", Evaluation.POSITIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
POSITIVE_SOCIAL_FEEDBACK_2("설명이 이해가 잘 되었어요", Evaluation.POSITIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
POSITIVE_SOCIAL_FEEDBACK_3("매우 도움이 되었어요", Evaluation.POSITIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
POSITIVE_SOCIAL_FEEDBACK_4("리뷰 속도가 빨랐어요", Evaluation.POSITIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
POSITIVE_SOCIAL_FEEDBACK_5("리뷰 내용이 매우 유익했어요", Evaluation.POSITIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
POSITIVE_SOCIAL_FEEDBACK_6("피드백이 구체적이었어요", Evaluation.POSITIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
POSITIVE_SOCIAL_FEEDBACK_7("상황을 잘 이해해주셨어요", Evaluation.POSITIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
POSITIVE_SOCIAL_FEEDBACK_8("질문에 잘 답변해주셨어요", Evaluation.POSITIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
POSITIVE_SOCIAL_FEEDBACK_9("전반적으로 긍정적인 경험이었어요", Evaluation.POSITIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
POSITIVE_SOCIAL_FEEDBACK_10("피드백이 명확했어요", Evaluation.POSITIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
POSITIVE_SOCIAL_FEEDBACK_11("유익한 조언을 주셨어요", Evaluation.POSITIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
POSITIVE_SOCIAL_FEEDBACK_12("리뷰가 체계적이었어요", Evaluation.POSITIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
POSITIVE_SOCIAL_FEEDBACK_13("긍정적인 태도를 유지해주셨어요", Evaluation.POSITIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
POSITIVE_SOCIAL_FEEDBACK_14("의사소통이 원활했어요", Evaluation.POSITIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
POSITIVE_SOCIAL_FEEDBACK_15("상황에 대한 이해도가 높으셨어요", Evaluation.POSITIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),

NORMAL_SOCIAL_FEEDBACK_1("설명이 이해가 잘 되지 않았어요", Evaluation.NORMAL, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NORMAL_SOCIAL_FEEDBACK_2("도움이 되었어요", Evaluation.NORMAL, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NORMAL_SOCIAL_FEEDBACK_3("리뷰 속도가 적당했어요", Evaluation.NORMAL, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NORMAL_SOCIAL_FEEDBACK_4("조금 더 구체적이면 좋겠어요", Evaluation.NORMAL, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NORMAL_SOCIAL_FEEDBACK_5("질문에 대한 답변이 조금 부족했어요", Evaluation.NORMAL, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NORMAL_SOCIAL_FEEDBACK_6("리뷰를 통해 배운 점이 있었어요", Evaluation.NORMAL, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NORMAL_SOCIAL_FEEDBACK_7("리뷰가 다소 길었어요", Evaluation.NORMAL, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NORMAL_SOCIAL_FEEDBACK_8("피드백이 유용했지만 개선이 필요해요", Evaluation.NORMAL, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NORMAL_SOCIAL_FEEDBACK_9("전반적으로 괜찮았어요", Evaluation.NORMAL, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NORMAL_SOCIAL_FEEDBACK_10("리뷰 내용이 명확하지 않았어요", Evaluation.NORMAL, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NORMAL_SOCIAL_FEEDBACK_11("조금 더 친절한 말투였으면 좋겠어요", Evaluation.NORMAL, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NORMAL_SOCIAL_FEEDBACK_12("리뷰의 내용이 조금 부족했어요", Evaluation.NORMAL, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NORMAL_SOCIAL_FEEDBACK_13("도움이 필요할 것 같아요", Evaluation.NORMAL, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NORMAL_SOCIAL_FEEDBACK_14("리뷰가 약간 혼란스러웠어요", Evaluation.NORMAL, KeywordType.SOCIAL_FEEDBACK_KEYWORD),

NEGATIVE_SOCIAL_FEEDBACK_1("불친절했어요", Evaluation.NEGATIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NEGATIVE_SOCIAL_FEEDBACK_2("설명이 부족해요", Evaluation.NEGATIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NEGATIVE_SOCIAL_FEEDBACK_3("도움이 되지 않았어요", Evaluation.NEGATIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NEGATIVE_SOCIAL_FEEDBACK_4("리뷰 속도가 느렸어요", Evaluation.NEGATIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NEGATIVE_SOCIAL_FEEDBACK_5("리뷰 내용이 매우 유익하지 않았어요", Evaluation.NEGATIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NEGATIVE_SOCIAL_FEEDBACK_6("피드백이 모호했어요", Evaluation.NEGATIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NEGATIVE_SOCIAL_FEEDBACK_7("상황을 잘 이해하지 못하셨어요", Evaluation.NEGATIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NEGATIVE_SOCIAL_FEEDBACK_8("질문에 대한 답변이 불충분했어요", Evaluation.NEGATIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NEGATIVE_SOCIAL_FEEDBACK_9("전반적으로 부정적인 경험이었어요", Evaluation.NEGATIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NEGATIVE_SOCIAL_FEEDBACK_10("피드백이 불명확했어요", Evaluation.NEGATIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NEGATIVE_SOCIAL_FEEDBACK_11("유익한 조언이 없었어요", Evaluation.NEGATIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NEGATIVE_SOCIAL_FEEDBACK_12("리뷰가 비체계적이었어요", Evaluation.NEGATIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NEGATIVE_SOCIAL_FEEDBACK_13("부정적인 태도를 보였어요", Evaluation.NEGATIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NEGATIVE_SOCIAL_FEEDBACK_14("의사소통이 원활하지 않았어요", Evaluation.NEGATIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
NEGATIVE_SOCIAL_FEEDBACK_15("상황에 대한 이해도가 낮으셨어요", Evaluation.NEGATIVE, KeywordType.SOCIAL_FEEDBACK_KEYWORD),
;

private static final Map<String, FeedbackKeyword> CLASSIFIER = Arrays.stream(FeedbackKeyword.values())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,30 @@ class ReceivedFeedbacksTest {
@DisplayName("가장 많이 받은 긍정적인 피드백을 알 수 있다.")
void findTopFeedbackKeywords1() {
List<List<FeedbackKeyword>> developFeedbackKeywords = List.of(
List.of(FeedbackKeyword.KIND, FeedbackKeyword.HELPFUL, FeedbackKeyword.REVIEW_FAST),
List.of(FeedbackKeyword.KIND, FeedbackKeyword.HELPFUL, FeedbackKeyword.REVIEW_FAST),
List.of(FeedbackKeyword.KIND, FeedbackKeyword.HELPFUL),
List.of(FeedbackKeyword.KIND)
List.of(FeedbackKeyword.POSITIVE_DEVELOP_FEEDBACK_1, FeedbackKeyword.POSITIVE_DEVELOP_FEEDBACK_2, FeedbackKeyword.POSITIVE_DEVELOP_FEEDBACK_3),
List.of(FeedbackKeyword.POSITIVE_DEVELOP_FEEDBACK_1, FeedbackKeyword.POSITIVE_DEVELOP_FEEDBACK_2, FeedbackKeyword.POSITIVE_DEVELOP_FEEDBACK_3),
List.of(FeedbackKeyword.POSITIVE_DEVELOP_FEEDBACK_1, FeedbackKeyword.POSITIVE_DEVELOP_FEEDBACK_2),
List.of(FeedbackKeyword.POSITIVE_DEVELOP_FEEDBACK_1)
);
List<List<FeedbackKeyword>> socialFeedbackKeywords = List.of(
List.of(FeedbackKeyword.MAKE_CODE_FOR_THE_PURPOSE, FeedbackKeyword.EASY_TO_UNDERSTAND_THE_CODE),
List.of(FeedbackKeyword.RESPONSE_FAST)
List.of(FeedbackKeyword.POSITIVE_SOCIAL_FEEDBACK_1, FeedbackKeyword.POSITIVE_SOCIAL_FEEDBACK_2),
List.of(FeedbackKeyword.POSITIVE_SOCIAL_FEEDBACK_3)
);
ReceivedFeedbacks receivedFeedbacks = new ReceivedFeedbacks(developFeedbackKeywords, socialFeedbackKeywords);

List<String> result = receivedFeedbacks.findTopFeedbackKeywords(3);

assertThat(result).containsExactly("친절했어요", "매우 도움이 되었어요", "리뷰 속도가 빨랐어요");
assertThat(result).containsExactly("코드를 이해하기 쉬웠어요", "코드의 가독성이 뛰어나요", "코드가 일관성 있게 작성되어 있어요");
}

@Test
@DisplayName("가장 많이 받은 긍정적인 피드백을 알 수 있다.")
void findTopFeedbackKeywords2() {
List<List<FeedbackKeyword>> developFeedbackKeywords = List.of(
List.of(FeedbackKeyword.KIND)
List.of(FeedbackKeyword.NEGATIVE_DEVELOP_FEEDBACK_1)
);
List<List<FeedbackKeyword>> socialFeedbackKeywords = List.of(
List.of(FeedbackKeyword.RESPONSE_SLOW, FeedbackKeyword.HARD_TO_UNDERSTAND_THE_CODE)
List.of(FeedbackKeyword.POSITIVE_SOCIAL_FEEDBACK_1)
);
ReceivedFeedbacks receivedFeedbacks = new ReceivedFeedbacks(developFeedbackKeywords, socialFeedbackKeywords);

Expand All @@ -49,10 +49,10 @@ void findTopFeedbackKeywords2() {
@DisplayName("긍정적인 피드백이 없다면 아무런 피드백도 반환하지 않는다.")
void findTopFeedbackKeywords3() {
List<List<FeedbackKeyword>> developFeedbackKeywords = List.of(
List.of(FeedbackKeyword.UNKIND, FeedbackKeyword.BAD_AT_EXPLAINING)
List.of(FeedbackKeyword.NEGATIVE_DEVELOP_FEEDBACK_1, FeedbackKeyword.NEGATIVE_DEVELOP_FEEDBACK_2)
);
List<List<FeedbackKeyword>> socialFeedbackKeywords = List.of(
List.of(FeedbackKeyword.NOT_MAKE_CODE_FOR_THE_PURPOSE, FeedbackKeyword.RESPONSE_SLOW)
List.of(FeedbackKeyword.NORMAL_SOCIAL_FEEDBACK_1, FeedbackKeyword.NEGATIVE_SOCIAL_FEEDBACK_2)
);
ReceivedFeedbacks receivedFeedbacks = new ReceivedFeedbacks(developFeedbackKeywords, socialFeedbackKeywords);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void findAllKeywordsByReceiverId() {

Member deliver = memberRepository.save(MemberFixture.MEMBER_PORORO());
Member receiver = memberRepository.save(MemberFixture.MEMBER_MOVIN());
List<FeedbackKeyword> feedbackKeywords = List.of(FeedbackKeyword.MAKE_CODE_FOR_THE_PURPOSE, FeedbackKeyword.RESPONSE_FAST);
List<FeedbackKeyword> feedbackKeywords = List.of(FeedbackKeyword.POSITIVE_DEVELOP_FEEDBACK_1, FeedbackKeyword.POSITIVE_DEVELOP_FEEDBACK_2);
DevelopFeedback feedback = new DevelopFeedback(room.getId(), deliver, receiver, 3, feedbackKeywords, "", 3);
developFeedbackRepository.save(feedback);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void findAllKeywordsByReceiverId() {

Member deliver = memberRepository.save(MemberFixture.MEMBER_PORORO());
Member receiver = memberRepository.save(MemberFixture.MEMBER_MOVIN());
List<FeedbackKeyword> feedbackKeywords = List.of(FeedbackKeyword.KIND, FeedbackKeyword.HELPFUL);
List<FeedbackKeyword> feedbackKeywords = List.of(FeedbackKeyword.POSITIVE_SOCIAL_FEEDBACK_1, FeedbackKeyword.POSITIVE_SOCIAL_FEEDBACK_2);
SocialFeedback feedback = new SocialFeedback(room.getId(), deliver, receiver, 3, feedbackKeywords, "");
socialFeedbackRepository.save(feedback);

Expand Down
Loading
Loading