Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.back.domain.mybar.dto;

import com.back.domain.cocktail.enums.AlcoholStrength;
import com.back.domain.mybar.entity.MyBar;
import lombok.Builder;
import lombok.Getter;
Expand All @@ -12,6 +13,8 @@ public class MyBarItemResponseDto {
private Long id;
private Long cocktailId;
private String cocktailName;
private String cocktailNameKo; // 칵테일의 한글 표기 이름
private AlcoholStrength alcoholStrength; // 도수 레이블로 쓰이는 알코올 강도
private String imageUrl;
private LocalDateTime createdAt;
private LocalDateTime keptAt;
Expand All @@ -21,6 +24,8 @@ public static MyBarItemResponseDto from(MyBar m) {
.id(m.getId())
.cocktailId(m.getCocktail().getId())
.cocktailName(m.getCocktail().getCocktailName())
.cocktailNameKo(m.getCocktail().getCocktailNameKo())
.alcoholStrength(m.getCocktail().getAlcoholStrength())
.imageUrl(m.getCocktail().getCocktailImgUrl())
.createdAt(m.getCreatedAt())
.keptAt(m.getKeptAt())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.back.domain.mybar.controller;

import com.back.domain.cocktail.enums.AlcoholStrength;
import com.back.domain.mybar.dto.MyBarItemResponseDto;
import com.back.domain.mybar.dto.MyBarListResponseDto;
import com.back.domain.mybar.service.MyBarService;
Expand Down Expand Up @@ -105,6 +106,8 @@ void getMyBarList_withoutCursor() throws Exception {
.id(3L)
.cocktailId(10L)
.cocktailName("Margarita")
.cocktailNameKo("留덇?由ы?")
.alcoholStrength(AlcoholStrength.LIGHT)
.imageUrl("https://example.com/margarita.jpg")
.createdAt(createdAt)
.keptAt(keptAt)
Expand Down Expand Up @@ -133,6 +136,8 @@ void getMyBarList_withoutCursor() throws Exception {
.andExpect(jsonPath("$.data.items[0].id").value(3L))
.andExpect(jsonPath("$.data.items[0].cocktailId").value(10L))
.andExpect(jsonPath("$.data.items[0].cocktailName").value("Margarita"))
.andExpect(jsonPath("$.data.items[0].cocktailNameKo").value("留덇?由ы?"))
.andExpect(jsonPath("$.data.items[0].alcoholStrength").value("LIGHT"))
.andExpect(jsonPath("$.data.items[0].imageUrl").value("https://example.com/margarita.jpg"))
.andExpect(jsonPath("$.data.items[0].createdAt").value(ISO_WITH_SECONDS.format(createdAt)))
.andExpect(jsonPath("$.data.items[0].keptAt").value(ISO_WITH_SECONDS.format(keptAt)))
Expand Down Expand Up @@ -160,6 +165,8 @@ void getMyBarList_withCursor() throws Exception {
.id(20L)
.cocktailId(33L)
.cocktailName("Negroni")
.cocktailNameKo("?ㅺ렇濡쒕땲")
.alcoholStrength(AlcoholStrength.STRONG)
.imageUrl("https://example.com/negroni.jpg")
.createdAt(itemCreatedAt)
.keptAt(itemKeptAt)
Expand Down Expand Up @@ -190,6 +197,8 @@ void getMyBarList_withCursor() throws Exception {
.andExpect(jsonPath("$.message").value("success"))
.andExpect(jsonPath("$.data.items[0].id").value(20L))
.andExpect(jsonPath("$.data.items[0].cocktailName").value("Negroni"))
.andExpect(jsonPath("$.data.items[0].cocktailNameKo").value("?ㅺ렇濡쒕땲"))
.andExpect(jsonPath("$.data.items[0].alcoholStrength").value("STRONG"))
.andExpect(jsonPath("$.data.hasNext").value(false))
.andExpect(jsonPath("$.data.nextKeptAt").doesNotExist());

Expand Down