From e44bcc0ce61768e2c345a94e91a9b1d556916d6c Mon Sep 17 00:00:00 2001 From: Eunsol Kim <61370551+Cyma-s@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:08:16 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EB=A9=A4=EB=B2=84=20=ED=8C=8C?= =?UTF-8?q?=ED=8A=B8=20=EC=9D=91=EB=8B=B5=20=EC=86=8D=EC=84=B1=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../song/application/dto/MemberPartResponse.java | 2 +- .../shook/song/application/SongServiceTest.java | 12 ++++++------ .../shook/shook/song/ui/SongSwipeControllerTest.java | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/src/main/java/shook/shook/song/application/dto/MemberPartResponse.java b/backend/src/main/java/shook/shook/song/application/dto/MemberPartResponse.java index ef664a95..5a1869d0 100644 --- a/backend/src/main/java/shook/shook/song/application/dto/MemberPartResponse.java +++ b/backend/src/main/java/shook/shook/song/application/dto/MemberPartResponse.java @@ -12,7 +12,7 @@ public class MemberPartResponse { @Schema(description = "멤버 파트 id", example = "1") - private final Long partId; + private final Long id; @Schema(description = "멤버 파트 시작 초", example = "30") private final int start; diff --git a/backend/src/test/java/shook/shook/song/application/SongServiceTest.java b/backend/src/test/java/shook/shook/song/application/SongServiceTest.java index 85b07bd4..dd74f083 100644 --- a/backend/src/test/java/shook/shook/song/application/SongServiceTest.java +++ b/backend/src/test/java/shook/shook/song/application/SongServiceTest.java @@ -136,7 +136,7 @@ void findById_exist_login_member() { song.getLikeCountSortedKillingParts().get(2).getId()) .hasFieldOrPropertyWithValue("rank", 3) .hasFieldOrPropertyWithValue("likeStatus", true), - () -> assertThat(response.getCurrentSong().getMemberPart().getPartId()).isNotNull() + () -> assertThat(response.getCurrentSong().getMemberPart().getId()).isNotNull() ); } @@ -314,12 +314,12 @@ void firstFindByMember() { .toList()).usingRecursiveComparison().isEqualTo(List.of(2L, 1L)), () -> assertThat(result.getCurrentSong().getMemberPart()).isNull(), () -> assertThat(result.getPrevSongs().stream() - .map(songResponse -> songResponse.getMemberPart().getPartId()) + .map(songResponse -> songResponse.getMemberPart().getId()) .toList()) .usingRecursiveComparison() .isEqualTo(List.of(4L, 3L)), () -> assertThat(result.getNextSongs().stream() - .map(songResponse -> songResponse.getMemberPart().getPartId()) + .map(songResponse -> songResponse.getMemberPart().getId()) .toList()) .usingRecursiveComparison() .isEqualTo(List.of(2L, 1L)) @@ -389,7 +389,7 @@ void findSongByIdForBeforeSwipe() { .toList()).usingRecursiveComparison().isEqualTo(List.of(2L, 4L, 1L, 5L)); assertThat(beforeResponses.stream() .map(SongResponse::getMemberPart) - .map(MemberPartResponse::getPartId) + .map(MemberPartResponse::getId) .toList()).usingRecursiveComparison().isEqualTo(List.of(2L, 4L, 1L, 5L)); } @@ -433,7 +433,7 @@ void findSongByIdForAfterSwipe() { .toList()).usingRecursiveComparison().isEqualTo(List.of(1L, 5L, 3L)); assertThat(afterResponses.stream() .map(SongResponse::getMemberPart) - .map(MemberPartResponse::getPartId) + .map(MemberPartResponse::getId) .toList()).usingRecursiveComparison().isEqualTo(List.of(1L, 5L, 3L)); } } @@ -518,7 +518,7 @@ void findSongById() { song.getLikeCountSortedKillingParts().get(2).getId()) .hasFieldOrPropertyWithValue("rank", 3) .hasFieldOrPropertyWithValue("likeStatus", true), - () -> assertThat(response.getMemberPart().getPartId()).isNotNull() + () -> assertThat(response.getMemberPart().getId()).isNotNull() ); } } diff --git a/backend/src/test/java/shook/shook/song/ui/SongSwipeControllerTest.java b/backend/src/test/java/shook/shook/song/ui/SongSwipeControllerTest.java index 28469e8b..5a6a165a 100644 --- a/backend/src/test/java/shook/shook/song/ui/SongSwipeControllerTest.java +++ b/backend/src/test/java/shook/shook/song/ui/SongSwipeControllerTest.java @@ -120,7 +120,7 @@ void showSongsBeforeSongWithId() { assertThat(response.stream() .map(SongResponse::getId).toList()) .containsExactly(1L, 4L, 3L); - assertThat(response.get(0).getMemberPart().getPartId()).isNotNull(); + assertThat(response.get(0).getMemberPart().getId()).isNotNull(); assertThat(response.get(1).getMemberPart()).isNull(); assertThat(response.get(2).getMemberPart()).isNull(); }