diff --git a/server/src/main/java/server/haengdong/presentation/response/CurrentMemberResponse.java b/server/src/main/java/server/haengdong/presentation/response/CurrentMemberResponse.java deleted file mode 100644 index 4308c7d17..000000000 --- a/server/src/main/java/server/haengdong/presentation/response/CurrentMemberResponse.java +++ /dev/null @@ -1,10 +0,0 @@ -package server.haengdong.presentation.response; - -import server.haengdong.application.response.CurrentMemberAppResponse; - -public record CurrentMemberResponse(String name) { - - public static CurrentMemberResponse of(CurrentMemberAppResponse response) { - return new CurrentMemberResponse(response.name()); - } -} diff --git a/server/src/main/java/server/haengdong/presentation/response/CurrentMembersResponse.java b/server/src/main/java/server/haengdong/presentation/response/CurrentMembersResponse.java index 4eb915dd4..289cca4fa 100644 --- a/server/src/main/java/server/haengdong/presentation/response/CurrentMembersResponse.java +++ b/server/src/main/java/server/haengdong/presentation/response/CurrentMembersResponse.java @@ -3,11 +3,11 @@ import java.util.List; import server.haengdong.application.response.CurrentMemberAppResponse; -public record CurrentMembersResponse(List members) { +public record CurrentMembersResponse(List memberNames) { public static CurrentMembersResponse of(List currentMembers) { - List responses = currentMembers.stream() - .map(CurrentMemberResponse::of) + List responses = currentMembers.stream() + .map(CurrentMemberAppResponse::name) .toList(); return new CurrentMembersResponse(responses); diff --git a/server/src/test/java/server/haengdong/docs/MemberActionControllerDocsTest.java b/server/src/test/java/server/haengdong/docs/MemberActionControllerDocsTest.java index 3105eb2c4..afd766c8f 100644 --- a/server/src/test/java/server/haengdong/docs/MemberActionControllerDocsTest.java +++ b/server/src/test/java/server/haengdong/docs/MemberActionControllerDocsTest.java @@ -88,8 +88,8 @@ void getCurrentMembers() throws Exception { .accept(MediaType.APPLICATION_JSON)) .andDo(print()) .andExpect(status().isOk()) - .andExpect(jsonPath("$.members[0].name").value(equalTo("소하"))) - .andExpect(jsonPath("$.members[1].name").value(equalTo("토다리"))) + .andExpect(jsonPath("$.memberNames[0]").value(equalTo("소하"))) + .andExpect(jsonPath("$.memberNames[1]").value(equalTo("토다리"))) .andDo( document("getCurrentMembers", preprocessRequest(prettyPrint()), @@ -98,10 +98,8 @@ void getCurrentMembers() throws Exception { parameterWithName("eventId").description("행사 ID") ), responseFields( - fieldWithPath("members").type(JsonFieldType.ARRAY) - .description("액션 대상 참여자 목록"), - fieldWithPath("members[0].name").type(JsonFieldType.STRING) - .description("참여자 이름") + fieldWithPath("memberNames").type(JsonFieldType.ARRAY) + .description("현재 탈주 가능한 참여 인원 이름 목록") ) ) ); diff --git a/server/src/test/java/server/haengdong/presentation/MemberActionControllerTest.java b/server/src/test/java/server/haengdong/presentation/MemberActionControllerTest.java index 1e8fa239f..f50c70a17 100644 --- a/server/src/test/java/server/haengdong/presentation/MemberActionControllerTest.java +++ b/server/src/test/java/server/haengdong/presentation/MemberActionControllerTest.java @@ -46,8 +46,8 @@ void getCurrentMembers() throws Exception { .accept(MediaType.APPLICATION_JSON)) .andDo(print()) .andExpect(status().isOk()) - .andExpect(jsonPath("$.members[0].name").value(equalTo("소하"))) - .andExpect(jsonPath("$.members[1].name").value(equalTo("토다리"))); + .andExpect(jsonPath("$.memberNames[0]").value(equalTo("소하"))) + .andExpect(jsonPath("$.memberNames[1]").value(equalTo("토다리"))); } @DisplayName("이벤트에 속한 멤버 액션을 삭제하면 이후에 기록된 해당 참여자의 모든 멤버 액션을 삭제한다.")