diff --git a/src/main/java/com/moabam/api/application/room/SearchService.java b/src/main/java/com/moabam/api/application/room/SearchService.java index c4c37f6b..9e62b9d0 100644 --- a/src/main/java/com/moabam/api/application/room/SearchService.java +++ b/src/main/java/com/moabam/api/application/room/SearchService.java @@ -1,9 +1,8 @@ package com.moabam.api.application.room; -import static com.moabam.global.common.util.GlobalConstant.NOT_COMPLETED_RANK; -import static com.moabam.global.common.util.GlobalConstant.ROOM_FIXED_SEARCH_SIZE; +import static com.moabam.global.common.util.GlobalConstant.*; import static com.moabam.global.error.model.ErrorMessage.*; -import static org.apache.commons.lang3.StringUtils.isEmpty; +import static org.apache.commons.lang3.StringUtils.*; import java.time.LocalDate; import java.time.Period; @@ -195,7 +194,7 @@ public UnJoinedRoomDetailsResponse getUnJoinedRoomDetails(Long roomId) { List sortedDailyMemberCertifications = certificationsSearchRepository.findSortedDailyMemberCertifications(roomId, clockHolder.date()); List memberIds = sortedDailyMemberCertifications.stream() - .map(DailyMemberCertification::getId) + .map(DailyMemberCertification::getMemberId) .toList(); List members = memberService.getRoomMembers(memberIds); List inventories = inventorySearchRepository.findDefaultInventories(memberIds, diff --git a/src/test/java/com/moabam/api/presentation/RoomControllerTest.java b/src/test/java/com/moabam/api/presentation/RoomControllerTest.java index ad5d3a2c..ebfbfd16 100644 --- a/src/test/java/com/moabam/api/presentation/RoomControllerTest.java +++ b/src/test/java/com/moabam/api/presentation/RoomControllerTest.java @@ -993,22 +993,25 @@ void get_un_joined_room_details() throws Exception { Room room = RoomFixture.room("테스트 방", NIGHT, 21); Room savedRoom = roomRepository.save(room); + Member member1 = MemberFixture.member("901010", "testtest"); + member1 = memberRepository.save(member1); + Item item = ItemFixture.nightMageSkin(); - Inventory inventory = InventoryFixture.inventory(1L, item); + Inventory inventory = InventoryFixture.inventory(member1.getId(), item); inventory.select(); itemRepository.save(item); inventoryRepository.save(inventory); - Participant participant = RoomFixture.participant(savedRoom, member.getId()); + Participant participant = RoomFixture.participant(savedRoom, member1.getId()); participantRepository.save(participant); Routine routine1 = RoomFixture.routine(savedRoom, "물 마시기"); Routine routine2 = RoomFixture.routine(savedRoom, "커피 마시기"); routineRepository.saveAll(List.of(routine1, routine2)); - DailyMemberCertification dailyMemberCertification = RoomFixture.dailyMemberCertification(member.getId(), + DailyMemberCertification dailyMemberCertification = RoomFixture.dailyMemberCertification(member1.getId(), savedRoom.getId(), participant); dailyMemberCertificationRepository.save(dailyMemberCertification);