Skip to content

Commit

Permalink
#92 refactor: 객실 조회 정보에 '숙소 주소' 추가되도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jo0oy committed Dec 6, 2023
1 parent 1f489af commit 81b17d7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ public record RoomWithProductResponseDto(
Long productId,
String productName,
String productThumbnail,
String productAddress,
Long roomId,
String roomName,
Integer standard,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public List<RoomWithProductResponseDto> findAllInRoomIdsResponseDto(List<Long> r
product.id.as("productId"),
product.name.as("productName"),
product.thumbnail.as("productThumbnail"),
product.address.as("productAddress"),
room.id.as("roomId"),
room.name.as("roomName"),
room.standard,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ void getRoomsWithProductInfo() throws Exception {
GetRoomListWithProductInfoRequestDto requestDto = new GetRoomListWithProductInfoRequestDto(roomIds);

List<RoomWithProductResponseDto> rooms = List.of(
new RoomWithProductResponseDto(1L, "호텔1", "호텔1 썸네일 이미지 url", 1L,
"객실1", 2, 4, "14:00", "12:00", 100000),
new RoomWithProductResponseDto(2L, "호텔2", "호텔2 썸네일 이미지 url", 3L,
"객실3", 3, 5, "14:00", "11:30", 120000),
new RoomWithProductResponseDto(3L, "호텔3", "호텔3 썸네일 이미지 url", 4L,
"객실4", 2, 4, "13:00", "11:00", 95000)
new RoomWithProductResponseDto(1L, "호텔1", "호텔1 썸네일 이미지 url", "호텔1 주소",
1L, "객실1", 2, 4, "14:00", "12:00", 100000),
new RoomWithProductResponseDto(2L, "호텔2", "호텔2 썸네일 이미지 url", "호텔2 주소",
3L, "객실3", 3, 5, "14:00", "11:30", 120000),
new RoomWithProductResponseDto(3L, "호텔3", "호텔3 썸네일 이미지 url", "호텔3 주소",
4L, "객실4", 2, 4, "13:00", "11:00", 95000)
);

given(roomService.getRoomsWithProductInfo(roomIds))
Expand All @@ -73,6 +73,7 @@ void getRoomsWithProductInfo() throws Exception {
fieldWithPath("data.rooms[].productId").type(JsonFieldType.NUMBER).description("숙소 식별자"),
fieldWithPath("data.rooms[].productName").type(JsonFieldType.STRING).description("숙소명"),
fieldWithPath("data.rooms[].productThumbnail").type(JsonFieldType.STRING).description("숙소 썸네일 이미지 URL"),
fieldWithPath("data.rooms[].productAddress").type(JsonFieldType.STRING).description("숙소 주소"),
fieldWithPath("data.rooms[].roomId").type(JsonFieldType.NUMBER).description("객실 식별자"),
fieldWithPath("data.rooms[].roomName").type(JsonFieldType.STRING).description("객실명"),
fieldWithPath("data.rooms[].standard").type(JsonFieldType.NUMBER).description("기준 인원"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ void getRoomsWithProductInfo_api_test() throws Exception {
GetRoomListWithProductInfoRequestDto requestDto = new GetRoomListWithProductInfoRequestDto(roomIds);

List<RoomWithProductResponseDto> rooms = List.of(
new RoomWithProductResponseDto(1L, "호텔1", "호텔1 썸네일", 1L,
"객실1", 2, 4, "14:00", "12:00", 100000),
new RoomWithProductResponseDto(2L, "호텔2", "호텔2 썸네일", 3L,
"객실3", 2, 4, "14:00", "11:30", 120000),
new RoomWithProductResponseDto(3L, "호텔3", "호텔3 썸네일", 4L,
"객실4", 2, 4, "13:00", "11:00", 95000)
new RoomWithProductResponseDto(1L, "호텔1", "호텔1 썸네일", "호텔1 주소",
1L, "객실1", 2, 4, "14:00", "12:00", 100000),
new RoomWithProductResponseDto(2L, "호텔2", "호텔2 썸네일", "호텔2 주소",
3L, "객실3", 2, 4, "14:00", "11:30", 120000),
new RoomWithProductResponseDto(3L, "호텔3", "호텔3 썸네일", "호텔3 주소",
4L, "객실4", 2, 4, "13:00", "11:00", 95000)
);

given(roomService.getRoomsWithProductInfo(roomIds))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ void getRoomsWithProductInfo_test() {
List<Long> roomIds = List.of(1L, 3L, 4L);

List<RoomWithProductResponseDto> rooms = List.of(
new RoomWithProductResponseDto(1L, "호텔1", "호텔1 썸네일", 1L,
"객실1", 2, 4, "14:00", "12:00", 100000),
new RoomWithProductResponseDto(2L, "호텔2", "호텔2 썸네일", 3L,
"객실3", 2, 4, "14:00", "11:30", 120000),
new RoomWithProductResponseDto(3L, "호텔3", "호텔3 썸네일", 4L,
"객실4", 2, 4, "13:00", "11:00", 95000)
new RoomWithProductResponseDto(1L, "호텔1", "호텔1 썸네일", "호텔1 주소",
1L, "객실1", 2, 4, "14:00", "12:00", 100000),
new RoomWithProductResponseDto(2L, "호텔2", "호텔2 썸네일", "호텔2 주소",
3L, "객실3", 2, 4, "14:00", "11:30", 120000),
new RoomWithProductResponseDto(3L, "호텔3", "호텔3 썸네일", "호텔3 주소",
4L, "객실4", 2, 4, "13:00", "11:00", 95000)
);

given(roomRepository.findAllInRoomIdsResponseDto(roomIds))
Expand Down

0 comments on commit 81b17d7

Please sign in to comment.