Skip to content

Commit fdcc97e

Browse files
committed
test: MyBarControllerTest에 변경된 MyBarItemResponseDto 필드 반영
- 테스트의 `MyBarItemResponseDto` 목(Mock) 객체에 `cocktailNameKo` 및 `alcoholStrength` 필드를 추가 - 응답 데이터 직렬화 및 형식 검증을 위해 JSON 응답 검증(`jsonPath`) 로직에 새로운 필드 검증을 추가
1 parent cf4dd96 commit fdcc97e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/test/java/com/back/domain/mybar/controller/MyBarControllerTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.back.domain.mybar.controller;
22

3+
import com.back.domain.cocktail.enums.AlcoholStrength;
34
import com.back.domain.mybar.dto.MyBarItemResponseDto;
45
import com.back.domain.mybar.dto.MyBarListResponseDto;
56
import com.back.domain.mybar.service.MyBarService;
@@ -105,6 +106,8 @@ void getMyBarList_withoutCursor() throws Exception {
105106
.id(3L)
106107
.cocktailId(10L)
107108
.cocktailName("Margarita")
109+
.cocktailNameKo("留덇?由ы?")
110+
.alcoholStrength(AlcoholStrength.LIGHT)
108111
.imageUrl("https://example.com/margarita.jpg")
109112
.createdAt(createdAt)
110113
.keptAt(keptAt)
@@ -133,6 +136,8 @@ void getMyBarList_withoutCursor() throws Exception {
133136
.andExpect(jsonPath("$.data.items[0].id").value(3L))
134137
.andExpect(jsonPath("$.data.items[0].cocktailId").value(10L))
135138
.andExpect(jsonPath("$.data.items[0].cocktailName").value("Margarita"))
139+
.andExpect(jsonPath("$.data.items[0].cocktailNameKo").value("留덇?由ы?"))
140+
.andExpect(jsonPath("$.data.items[0].alcoholStrength").value("LIGHT"))
136141
.andExpect(jsonPath("$.data.items[0].imageUrl").value("https://example.com/margarita.jpg"))
137142
.andExpect(jsonPath("$.data.items[0].createdAt").value(ISO_WITH_SECONDS.format(createdAt)))
138143
.andExpect(jsonPath("$.data.items[0].keptAt").value(ISO_WITH_SECONDS.format(keptAt)))
@@ -160,6 +165,8 @@ void getMyBarList_withCursor() throws Exception {
160165
.id(20L)
161166
.cocktailId(33L)
162167
.cocktailName("Negroni")
168+
.cocktailNameKo("?ㅺ렇濡쒕땲")
169+
.alcoholStrength(AlcoholStrength.STRONG)
163170
.imageUrl("https://example.com/negroni.jpg")
164171
.createdAt(itemCreatedAt)
165172
.keptAt(itemKeptAt)
@@ -190,6 +197,8 @@ void getMyBarList_withCursor() throws Exception {
190197
.andExpect(jsonPath("$.message").value("success"))
191198
.andExpect(jsonPath("$.data.items[0].id").value(20L))
192199
.andExpect(jsonPath("$.data.items[0].cocktailName").value("Negroni"))
200+
.andExpect(jsonPath("$.data.items[0].cocktailNameKo").value("?ㅺ렇濡쒕땲"))
201+
.andExpect(jsonPath("$.data.items[0].alcoholStrength").value("STRONG"))
193202
.andExpect(jsonPath("$.data.hasNext").value(false))
194203
.andExpect(jsonPath("$.data.nextKeptAt").doesNotExist());
195204

0 commit comments

Comments
 (0)