From fbfab9dcb18a4bf1cb697a1e8c4e32772677e782 Mon Sep 17 00:00:00 2001 From: SeYoE Date: Tue, 7 Nov 2023 18:38:45 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=EB=A6=AC=EB=B7=B0=20=ED=95=AD=EB=AA=A9?= =?UTF-8?q?=20=EB=88=84=EB=9D=BD=20=EA=B1=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../review/controller/dto/request/ReviewPostRequest.java | 6 ++++-- .../studayserver/domain/review/model/ReviewType.java | 4 +++- .../domain/review/service/dto/request/ReviewPostParam.java | 3 ++- .../studayserver/domain/like/service/LikeServiceTest.java | 2 +- .../domain/review/controller/ReviewRestControllerTest.java | 3 ++- .../studayserver/testutil/fixture/ReviewFixture.java | 6 +++++- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/guzzing/studayserver/domain/review/controller/dto/request/ReviewPostRequest.java b/src/main/java/org/guzzing/studayserver/domain/review/controller/dto/request/ReviewPostRequest.java index e5d83fab..28d7c781 100644 --- a/src/main/java/org/guzzing/studayserver/domain/review/controller/dto/request/ReviewPostRequest.java +++ b/src/main/java/org/guzzing/studayserver/domain/review/controller/dto/request/ReviewPostRequest.java @@ -9,7 +9,8 @@ public record ReviewPostRequest( boolean cheapFee, boolean goodFacility, boolean goodManagement, - boolean lovelyTeaching + boolean lovelyTeaching, + boolean shuttleAvailability ) { public static ReviewPostParam to(final Long memberId, final ReviewPostRequest request) { @@ -20,7 +21,8 @@ public static ReviewPostParam to(final Long memberId, final ReviewPostRequest re request.cheapFee(), request.goodFacility(), request.goodManagement(), - request.lovelyTeaching() + request.lovelyTeaching(), + request.shuttleAvailability() ); } diff --git a/src/main/java/org/guzzing/studayserver/domain/review/model/ReviewType.java b/src/main/java/org/guzzing/studayserver/domain/review/model/ReviewType.java index 33b56665..1149ba02 100644 --- a/src/main/java/org/guzzing/studayserver/domain/review/model/ReviewType.java +++ b/src/main/java/org/guzzing/studayserver/domain/review/model/ReviewType.java @@ -14,7 +14,8 @@ public enum ReviewType { GOOD_FACILITY, CHEAP_FEE, GOOD_MANAGEMENT, - LOVELY_TEACHING; + LOVELY_TEACHING, + SHUTTLE_AVAILABILITY; private static final int MAX_REVIEW_COUNT = 3; @@ -26,6 +27,7 @@ public static Map getSelectedReviewMap(final ReviewPostPara selectedReviewMap.put(ReviewType.CHEAP_FEE, reviewPostParam.cheapFee()); selectedReviewMap.put(ReviewType.GOOD_MANAGEMENT, reviewPostParam.goodManagement()); selectedReviewMap.put(ReviewType.LOVELY_TEACHING, reviewPostParam.lovelyTeaching()); + selectedReviewMap.put(ReviewType.SHUTTLE_AVAILABILITY, reviewPostParam.shuttleAvailability()); validateThreeReviewLimit(selectedReviewMap); diff --git a/src/main/java/org/guzzing/studayserver/domain/review/service/dto/request/ReviewPostParam.java b/src/main/java/org/guzzing/studayserver/domain/review/service/dto/request/ReviewPostParam.java index a883f7d4..404ddbdb 100644 --- a/src/main/java/org/guzzing/studayserver/domain/review/service/dto/request/ReviewPostParam.java +++ b/src/main/java/org/guzzing/studayserver/domain/review/service/dto/request/ReviewPostParam.java @@ -7,7 +7,8 @@ public record ReviewPostParam( boolean cheapFee, boolean goodFacility, boolean goodManagement, - boolean lovelyTeaching + boolean lovelyTeaching, + boolean shuttleAvailability ) { } diff --git a/src/test/java/org/guzzing/studayserver/domain/like/service/LikeServiceTest.java b/src/test/java/org/guzzing/studayserver/domain/like/service/LikeServiceTest.java index 2ae56f43..fbe5ae46 100644 --- a/src/test/java/org/guzzing/studayserver/domain/like/service/LikeServiceTest.java +++ b/src/test/java/org/guzzing/studayserver/domain/like/service/LikeServiceTest.java @@ -22,7 +22,7 @@ import org.springframework.test.context.ActiveProfiles; import org.springframework.transaction.annotation.Transactional; -@ActiveProfiles(profiles = {"dev", "oauth"}) +@ActiveProfiles(profiles = {"dev", "oauth", "test"}) @SpringBootTest @Transactional class LikeServiceTest { diff --git a/src/test/java/org/guzzing/studayserver/domain/review/controller/ReviewRestControllerTest.java b/src/test/java/org/guzzing/studayserver/domain/review/controller/ReviewRestControllerTest.java index be14ea5c..2576a910 100644 --- a/src/test/java/org/guzzing/studayserver/domain/review/controller/ReviewRestControllerTest.java +++ b/src/test/java/org/guzzing/studayserver/domain/review/controller/ReviewRestControllerTest.java @@ -100,7 +100,8 @@ void registerReview_Success() throws Exception { fieldWithPath("cheapFee").type(BOOLEAN).description("수강료가 싸요 리뷰 선택 여부"), fieldWithPath("goodFacility").type(BOOLEAN).description("시설이 좋아요 리뷰 선택 여부"), fieldWithPath("goodManagement").type(BOOLEAN).description("관리가 좋아요 리뷰 선택 여부"), - fieldWithPath("lovelyTeaching").type(BOOLEAN).description("가르침이 사랑스러워요 리뷰 선택 여부") + fieldWithPath("lovelyTeaching").type(BOOLEAN).description("가르침이 사랑스러워요 리뷰 선택 여부"), + fieldWithPath("shuttleAvailability").type(BOOLEAN).description("셔틀을 운행해요 리뷰 선택 여부") ), responseFields( fieldWithPath("reviewId").type(NUMBER).description("리뷰 아이디"), diff --git a/src/test/java/org/guzzing/studayserver/testutil/fixture/ReviewFixture.java b/src/test/java/org/guzzing/studayserver/testutil/fixture/ReviewFixture.java index 6b9b5ec3..097bae52 100644 --- a/src/test/java/org/guzzing/studayserver/testutil/fixture/ReviewFixture.java +++ b/src/test/java/org/guzzing/studayserver/testutil/fixture/ReviewFixture.java @@ -5,6 +5,7 @@ import static org.guzzing.studayserver.domain.review.model.ReviewType.GOOD_MANAGEMENT; import static org.guzzing.studayserver.domain.review.model.ReviewType.KINDNESS; import static org.guzzing.studayserver.domain.review.model.ReviewType.LOVELY_TEACHING; +import static org.guzzing.studayserver.domain.review.model.ReviewType.SHUTTLE_AVAILABILITY; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -32,7 +33,8 @@ public static ReviewPostRequest makeReviewPostRequest(boolean isValid) { reviewMap.get(CHEAP_FEE), reviewMap.get(GOOD_FACILITY), reviewMap.get(GOOD_MANAGEMENT), - reviewMap.get(LOVELY_TEACHING)); + reviewMap.get(LOVELY_TEACHING), + reviewMap.get(SHUTTLE_AVAILABILITY)); } public static Map makeInvalidReviewMap() { @@ -43,6 +45,7 @@ public static Map makeInvalidReviewMap() { invalidReviewMap.put(GOOD_FACILITY, true); invalidReviewMap.put(GOOD_MANAGEMENT, false); invalidReviewMap.put(LOVELY_TEACHING, true); + invalidReviewMap.put(SHUTTLE_AVAILABILITY, false); return invalidReviewMap; } @@ -55,6 +58,7 @@ public static Map makeValidReviewMap() { validReviewMap.put(GOOD_FACILITY, false); validReviewMap.put(GOOD_MANAGEMENT, false); validReviewMap.put(LOVELY_TEACHING, true); + validReviewMap.put(SHUTTLE_AVAILABILITY, false); return validReviewMap; }