diff --git a/server/src/main/java/server/haengdong/presentation/request/MemberActionSaveRequest.java b/server/src/main/java/server/haengdong/presentation/request/MemberActionSaveRequest.java deleted file mode 100644 index a69c51d41..000000000 --- a/server/src/main/java/server/haengdong/presentation/request/MemberActionSaveRequest.java +++ /dev/null @@ -1,10 +0,0 @@ -package server.haengdong.presentation.request; - -import server.haengdong.application.request.MemberActionSaveAppRequest; - -public record MemberActionSaveRequest(String name, String status) { - - public MemberActionSaveAppRequest toAppRequest() { - return new MemberActionSaveAppRequest(name, status); - } -} diff --git a/server/src/main/java/server/haengdong/presentation/request/MemberActionsSaveRequest.java b/server/src/main/java/server/haengdong/presentation/request/MemberActionsSaveRequest.java index bfe80f0ee..0b3fcebae 100644 --- a/server/src/main/java/server/haengdong/presentation/request/MemberActionsSaveRequest.java +++ b/server/src/main/java/server/haengdong/presentation/request/MemberActionsSaveRequest.java @@ -1,14 +1,20 @@ package server.haengdong.presentation.request; +import jakarta.validation.constraints.NotBlank; import java.util.List; import server.haengdong.application.request.MemberActionSaveAppRequest; import server.haengdong.application.request.MemberActionsSaveAppRequest; -public record MemberActionsSaveRequest(List actions) { +public record MemberActionsSaveRequest( + List members, + + @NotBlank + String status +) { public MemberActionsSaveAppRequest toAppRequest() { - List appRequests = actions.stream() - .map(MemberActionSaveRequest::toAppRequest) + List appRequests = members.stream() + .map(name -> new MemberActionSaveAppRequest(name, status)) .toList(); return new MemberActionsSaveAppRequest(appRequests); diff --git a/server/src/test/java/server/haengdong/presentation/MemberActionControllerTest.java b/server/src/test/java/server/haengdong/presentation/MemberActionControllerTest.java index be8b89182..ad8787cc6 100644 --- a/server/src/test/java/server/haengdong/presentation/MemberActionControllerTest.java +++ b/server/src/test/java/server/haengdong/presentation/MemberActionControllerTest.java @@ -20,7 +20,6 @@ import org.springframework.test.web.servlet.result.MockMvcResultMatchers; import server.haengdong.application.MemberActionService; import server.haengdong.application.response.CurrentMemberAppResponse; -import server.haengdong.presentation.request.MemberActionSaveRequest; import server.haengdong.presentation.request.MemberActionsSaveRequest; @WebMvcTest(MemberActionController.class) @@ -38,11 +37,8 @@ class MemberActionControllerTest { @DisplayName("참여자 행동을 추가한다.") @Test void saveMemberActionTest() throws Exception { - MemberActionsSaveRequest memberActionsSaveRequest = new MemberActionsSaveRequest(List.of( - new MemberActionSaveRequest("웨디", "IN"), - new MemberActionSaveRequest("소하", "IN"), - new MemberActionSaveRequest("토다리", "IN"), - new MemberActionSaveRequest("쿠키", "IN"))); + MemberActionsSaveRequest memberActionsSaveRequest = new MemberActionsSaveRequest( + List.of("웨디", "소하", "토다리", "쿠키"), "IN"); String requestBody = objectMapper.writeValueAsString(memberActionsSaveRequest); @@ -56,7 +52,8 @@ void saveMemberActionTest() throws Exception { @DisplayName("현재 참여 인원을 조회합니다.") @Test void getCurrentMembers() throws Exception { - List currentMemberAppResponses = List.of(new CurrentMemberAppResponse("소하"), new CurrentMemberAppResponse("토다리")); + List currentMemberAppResponses = List.of( + new CurrentMemberAppResponse("소하"), new CurrentMemberAppResponse("토다리")); given(memberActionService.getCurrentMembers(any())).willReturn(currentMemberAppResponses);