diff --git a/src/main/java/com/dduru/gildongmu/common/exception/ErrorCode.java b/src/main/java/com/dduru/gildongmu/common/exception/ErrorCode.java index 96a8b1f..bd3135b 100644 --- a/src/main/java/com/dduru/gildongmu/common/exception/ErrorCode.java +++ b/src/main/java/com/dduru/gildongmu/common/exception/ErrorCode.java @@ -63,6 +63,7 @@ public enum ErrorCode { // 설문 (SURVEY) SURVEY_RESULT_NOT_FOUND(HttpStatus.NOT_FOUND, "설문 결과를 찾을 수 없습니다."), + AVATAR_PROFILE_NOT_FOUND(HttpStatus.NOT_FOUND, "아바타 프로필을 찾을 수 없습니다."), // 휴대폰 인증 (VERIFICATION) SMS_SEND_FAILED(HttpStatus.INTERNAL_SERVER_ERROR, "SMS 발송에 실패했습니다."), diff --git a/src/main/java/com/dduru/gildongmu/config/CacheConfig.java b/src/main/java/com/dduru/gildongmu/config/CacheConfig.java new file mode 100644 index 0000000..c77354f --- /dev/null +++ b/src/main/java/com/dduru/gildongmu/config/CacheConfig.java @@ -0,0 +1,32 @@ +package com.dduru.gildongmu.config; + +import org.springframework.cache.CacheManager; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.cache.RedisCacheConfiguration; +import org.springframework.data.redis.cache.RedisCacheManager; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.RedisSerializationContext; +import org.springframework.data.redis.serializer.StringRedisSerializer; + +import java.time.Duration; + +@Configuration +@EnableCaching +public class CacheConfig { + + @Bean + public CacheManager cacheManager(RedisConnectionFactory redisConnectionFactory) { + RedisCacheConfiguration defaultConfig = RedisCacheConfiguration.defaultCacheConfig() + .entryTtl(Duration.ofHours(1)) + .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer())) + .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericJackson2JsonRedisSerializer())) + .disableCachingNullValues(); + + return RedisCacheManager.builder(redisConnectionFactory) + .cacheDefaults(defaultConfig) + .build(); + } +} diff --git a/src/main/java/com/dduru/gildongmu/config/WebMvcConfig.java b/src/main/java/com/dduru/gildongmu/config/WebMvcConfig.java index f96ed6b..151cb26 100644 --- a/src/main/java/com/dduru/gildongmu/config/WebMvcConfig.java +++ b/src/main/java/com/dduru/gildongmu/config/WebMvcConfig.java @@ -3,9 +3,12 @@ import com.dduru.gildongmu.common.resolver.CurrentUserArgumentResolver; import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Configuration; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.StringHttpMessageConverter; import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import java.nio.charset.StandardCharsets; import java.util.List; @Configuration @@ -18,4 +21,14 @@ public class WebMvcConfig implements WebMvcConfigurer { public void addArgumentResolvers(List resolvers) { resolvers.add(currentUserArgumentResolver); } + + @Override + public void extendMessageConverters(List> converters) { + converters.stream() + .filter(converter -> converter instanceof StringHttpMessageConverter) + .forEach(converter -> { + StringHttpMessageConverter stringConverter = (StringHttpMessageConverter) converter; + stringConverter.setDefaultCharset(StandardCharsets.UTF_8); + }); + } } diff --git a/src/main/java/com/dduru/gildongmu/survey/domain/AvatarProfile.java b/src/main/java/com/dduru/gildongmu/survey/domain/AvatarProfile.java new file mode 100644 index 0000000..d505e8c --- /dev/null +++ b/src/main/java/com/dduru/gildongmu/survey/domain/AvatarProfile.java @@ -0,0 +1,49 @@ +package com.dduru.gildongmu.survey.domain; + +import com.dduru.gildongmu.common.entity.BaseTimeEntity; +import com.dduru.gildongmu.survey.domain.enums.AvatarType; +import jakarta.persistence.*; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Entity +@Table(name = "avatar_profiles") +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class AvatarProfile extends BaseTimeEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Enumerated(EnumType.STRING) + @Column(name = "avatar_type", nullable = false, unique = true) + private AvatarType avatarType; + + @Column(nullable = false, length = 200) + private String description; + + @Column(nullable = false, columnDefinition = "TEXT") + private String personality; + + @Column(nullable = false, columnDefinition = "TEXT") + private String strength; + + @Column(nullable = false, columnDefinition = "TEXT") + private String tip; + + @Column(nullable = false, columnDefinition = "JSON") + private String tags; + + @Builder + public AvatarProfile(AvatarType avatarType, String description, String personality, String strength, String tip, String tags) { + this.avatarType = avatarType; + this.description = description; + this.personality = personality; + this.strength = strength; + this.tip = tip; + this.tags = tags; + } +} diff --git a/src/main/java/com/dduru/gildongmu/survey/domain/enums/AvatarType.java b/src/main/java/com/dduru/gildongmu/survey/domain/enums/AvatarType.java index 9c90fe2..c4be9d2 100644 --- a/src/main/java/com/dduru/gildongmu/survey/domain/enums/AvatarType.java +++ b/src/main/java/com/dduru/gildongmu/survey/domain/enums/AvatarType.java @@ -26,17 +26,4 @@ public int getCode() { public String getText() { return text; } - - public String getDescription() { - return switch (this) { - case TTUR_POGUNI -> "안정형 가성비 조용러 (내 페이스대로 차분히)"; - case TTUR_MOOD -> "안정형 플랙스 감성러 (분위기와 여유로운 힐링)"; - case TTUR_MALLANGI -> "안정형 가성비 배려러 (함께 가며 챙겨주는 다정함)"; - case TTUR_SWEET -> "안정형 플랙스 미식 힐링러 (다같이 맛있는 미식 힐링)"; - case TTUR_POPO -> "모험형 가성비 실속러 (알뜰하고 영리한 실속 탐험)"; - case TTUR_SPARKLE -> "모험형 플랙스 경험러 (즉흥적이고 화려한 경험)"; - case TTUR_GLIMMING -> "모험형 가성비 미식 모험러 (북적이는 로컬 맛집 탐방)"; - case TTUR_PADO -> "모험형 플랙스 인싸러 (에너지 넘치는 즉흥 끝판왕)"; - }; - } } diff --git a/src/main/java/com/dduru/gildongmu/survey/dto/AvatarProfileResponse.java b/src/main/java/com/dduru/gildongmu/survey/dto/AvatarProfileResponse.java new file mode 100644 index 0000000..f8eb818 --- /dev/null +++ b/src/main/java/com/dduru/gildongmu/survey/dto/AvatarProfileResponse.java @@ -0,0 +1,12 @@ +package com.dduru.gildongmu.survey.dto; + +import java.util.List; + +public record AvatarProfileResponse( + String description, + String personality, + String strength, + String tip, + List tags +) { +} diff --git a/src/main/java/com/dduru/gildongmu/survey/dto/SurveyResponse.java b/src/main/java/com/dduru/gildongmu/survey/dto/SurveyResponse.java index 0e7e807..09dd79a 100644 --- a/src/main/java/com/dduru/gildongmu/survey/dto/SurveyResponse.java +++ b/src/main/java/com/dduru/gildongmu/survey/dto/SurveyResponse.java @@ -2,7 +2,7 @@ import com.dduru.gildongmu.survey.domain.TravelTendency; import com.dduru.gildongmu.survey.domain.enums.AvatarType; -import com.dduru.gildongmu.survey.service.AvatarProfileProvider; +import com.dduru.gildongmu.survey.service.AvatarProfileService; import java.util.List; @@ -20,9 +20,9 @@ public record SurveyResponse( String tip, List tags ) { - public static SurveyResponse from(TravelTendency travelTendency, AvatarProfileProvider avatarProfileProvider) { + public static SurveyResponse from(TravelTendency travelTendency, AvatarProfileService avatarProfileService) { AvatarType avatarType = travelTendency.getAvatarType(); - AvatarProfileProvider.AvatarProfile profile = avatarProfileProvider.getProfile(avatarType); + AvatarProfileResponse profile = avatarProfileService.getProfile(avatarType); return new SurveyResponse( travelTendency.getR().doubleValue(), @@ -32,7 +32,7 @@ public static SurveyResponse from(TravelTendency travelTendency, AvatarProfilePr avatarType.getCode(), avatarType.name(), avatarType.getText(), - avatarType.getDescription(), + profile.description(), profile.personality(), profile.strength(), profile.tip(), @@ -43,14 +43,14 @@ public static SurveyResponse from(TravelTendency travelTendency, AvatarProfilePr public static SurveyResponse of( double r, double w, double s, double p, AvatarType avatarType, - AvatarProfileProvider.AvatarProfile profile + AvatarProfileResponse profile ) { return new SurveyResponse( r, w, s, p, avatarType.getCode(), avatarType.name(), avatarType.getText(), - avatarType.getDescription(), + profile.description(), profile.personality(), profile.strength(), profile.tip(), diff --git a/src/main/java/com/dduru/gildongmu/survey/exception/AvatarProfileNotFoundException.java b/src/main/java/com/dduru/gildongmu/survey/exception/AvatarProfileNotFoundException.java new file mode 100644 index 0000000..c8c414e --- /dev/null +++ b/src/main/java/com/dduru/gildongmu/survey/exception/AvatarProfileNotFoundException.java @@ -0,0 +1,19 @@ +package com.dduru.gildongmu.survey.exception; + +import com.dduru.gildongmu.common.exception.BusinessException; +import com.dduru.gildongmu.common.exception.ErrorCode; +import com.dduru.gildongmu.survey.domain.enums.AvatarType; + +public class AvatarProfileNotFoundException extends BusinessException { + public AvatarProfileNotFoundException() { + super(ErrorCode.AVATAR_PROFILE_NOT_FOUND, "아바타 프로필을 찾을 수 없습니다"); + } + + public AvatarProfileNotFoundException(String message) { + super(ErrorCode.AVATAR_PROFILE_NOT_FOUND, message); + } + + public static AvatarProfileNotFoundException of(AvatarType avatarType) { + return new AvatarProfileNotFoundException("아바타 프로필을 찾을 수 없습니다. avatarType=" + avatarType); + } +} diff --git a/src/main/java/com/dduru/gildongmu/survey/repository/AvatarProfileRepository.java b/src/main/java/com/dduru/gildongmu/survey/repository/AvatarProfileRepository.java new file mode 100644 index 0000000..96ac13e --- /dev/null +++ b/src/main/java/com/dduru/gildongmu/survey/repository/AvatarProfileRepository.java @@ -0,0 +1,11 @@ +package com.dduru.gildongmu.survey.repository; + +import com.dduru.gildongmu.survey.domain.AvatarProfile; +import com.dduru.gildongmu.survey.domain.enums.AvatarType; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.Optional; + +public interface AvatarProfileRepository extends JpaRepository { + Optional findByAvatarType(AvatarType avatarType); +} diff --git a/src/main/java/com/dduru/gildongmu/survey/service/AvatarProfileProvider.java b/src/main/java/com/dduru/gildongmu/survey/service/AvatarProfileProvider.java deleted file mode 100644 index 09d0d75..0000000 --- a/src/main/java/com/dduru/gildongmu/survey/service/AvatarProfileProvider.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.dduru.gildongmu.survey.service; - -import com.dduru.gildongmu.survey.domain.enums.AvatarType; -import org.springframework.stereotype.Component; - -import java.util.List; -import java.util.Map; - -@Component -public class AvatarProfileProvider { - - private static final Map PROFILES = Map.of( - AvatarType.TTUR_POGUNI, new AvatarProfile( - "느긋하고 신중한 스타일. 계획은 최소한으로 세우되 자신의 리듬은 확실히 지킴.", - "조용한 명소 찾기, 가성비 좋은 맛집 발굴, 일정 중 여유 시간 확보.", - "일정에 자유시간을 조금만 넣어도 만족도가 올라가요.", - List.of("안정", "독립", "가성비") - ), - AvatarType.TTUR_MOOD, new AvatarProfile( - "카페, 전경, 감성 스팟을 선호하며 여행의 '분위기'를 가장 중요하게 생각함.", - "예쁜 코스 및 뷰 포인트 찾기, 사진 찍기 좋은 장소 안내.", - "기록에 집중하느라 현재를 놓치지 않도록 '5분 기록, 5분 즐기기' 규칙을 세워보세요.", - List.of("안정", "독립", "플랙스") - ), - AvatarType.TTUR_MALLANGI, new AvatarProfile( - "여행 중 동행자의 분위기를 살피고 잘 맞춰주는 따뜻한 스타일. 검소한 여행 선호.", - "인원 조율 및 감정 관리, 합리적인 식당 및 코스 추천.", - "너무 배려만 하지 말고 '하루 한 번은 내 선택!' 규칙을 실천해 보세요.", - List.of("안정", "사교", "가성비") - ), - AvatarType.TTUR_SWEET, new AvatarProfile( - "사람을 편안하게 해주며, 맛있는 것과 좋은 분위기만 있다면 행복한 미식 힐링러.", - "단체 일정 코디, 실패 없는 맛집 픽, 여행 중 쉼표 만들어주기.", - "활동적인 친구와 여행할 때는 '식사 후 자유시간'으로 완급을 조절하세요.", - List.of("안정", "사교", "플랙스") - ), - AvatarType.TTUR_POPO, new AvatarProfile( - "새로움을 추구하지만 위험은 피하는 실속파. 효율과 재미의 밸런스를 잘 잡음.", - "정보 탐색 및 길 찾기 능력 우수, 혼자서도 뛰어난 문제 해결 능력.", - "하루 한 번 정도는 예산을 신경 쓰지 않는 '플랙스 타임'을 가져보세요.", - List.of("모험", "독립", "가성비") - ), - AvatarType.TTUR_SPARKLE, new AvatarProfile( - "즉흥적으로 떠나는 것을 즐기며 비용보다 긍정적인 경험의 가치를 높게 평가함.", - "숨겨진 스팟 개척, 급격한 일정 변경에도 빠른 적응.", - "예산 관리가 어려울 수 있으니 알뜰한 친구와 일정을 미리 의논해 보세요.", - List.of("모험", "독립", "플랙스") - ), - AvatarType.TTUR_GLIMMING, new AvatarProfile( - "새로운 자극과 인생샷에 진심인 미식 모험가. 즉흥적인 계획도 긍정적으로 수용.", - "현지인 추천 코스 실행력, 인생샷 스팟 캐치, 북적이는 에너지 유지.", - "일정이 사람 중심으로 흐를 수 있으니 하루 30분은 온전한 개인 시간을 가져보세요.", - List.of("모험", "사교", "가성비") - ), - AvatarType.TTUR_PADO, new AvatarProfile( - "어디서든 사람들과 잘 어울리며 분위기를 살리는 흥부자. 지출에 쿨한 인싸 유형.", - "현지 액티비티 빠른 예약, SNS 기록 담당, 높은 여행 에너지 유지.", - "체력과 예산 소모가 클 수 있으니 하루 1~2개의 핵심 활동에 집중해 보세요.", - List.of("모험", "사교", "플랙스") - ) - ); - - public AvatarProfile getProfile(AvatarType avatarType) { - return PROFILES.get(avatarType); - } - - public record AvatarProfile(String personality, String strength, String tip, List tags) { - } -} diff --git a/src/main/java/com/dduru/gildongmu/survey/service/AvatarProfileService.java b/src/main/java/com/dduru/gildongmu/survey/service/AvatarProfileService.java new file mode 100644 index 0000000..7be2748 --- /dev/null +++ b/src/main/java/com/dduru/gildongmu/survey/service/AvatarProfileService.java @@ -0,0 +1,47 @@ +package com.dduru.gildongmu.survey.service; + +import com.dduru.gildongmu.common.util.JsonConverter; +import com.dduru.gildongmu.survey.domain.AvatarProfile; +import com.dduru.gildongmu.survey.domain.enums.AvatarType; +import com.dduru.gildongmu.survey.dto.AvatarProfileResponse; +import com.dduru.gildongmu.survey.exception.AvatarProfileNotFoundException; +import com.dduru.gildongmu.survey.repository.AvatarProfileRepository; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +@Slf4j +@Service +@RequiredArgsConstructor +@Transactional(readOnly = true) +public class AvatarProfileService { + + private final AvatarProfileRepository avatarProfileRepository; + private final JsonConverter jsonConverter; + + @Cacheable(value = "avatarProfiles", key = "#avatarType.name()") + public AvatarProfileResponse getProfile(AvatarType avatarType) { + log.info("아바타 프로필 조회 - avatarType: {}", avatarType); + + AvatarProfile profile = avatarProfileRepository.findByAvatarType(avatarType) + .orElseThrow(() -> { + log.error("아바타 프로필을 찾을 수 없음 - avatarType: {}", avatarType); + return AvatarProfileNotFoundException.of(avatarType); + }); + + List tags = jsonConverter.convertJsonToList(profile.getTags()); + + log.info("아바타 프로필 조회 완료 - avatarType: {}", avatarType); + return new AvatarProfileResponse( + profile.getDescription(), + profile.getPersonality(), + profile.getStrength(), + profile.getTip(), + tags + ); + } +} diff --git a/src/main/java/com/dduru/gildongmu/survey/service/SurveyService.java b/src/main/java/com/dduru/gildongmu/survey/service/SurveyService.java index d89ad23..339032d 100644 --- a/src/main/java/com/dduru/gildongmu/survey/service/SurveyService.java +++ b/src/main/java/com/dduru/gildongmu/survey/service/SurveyService.java @@ -4,6 +4,7 @@ import com.dduru.gildongmu.survey.domain.Survey; import com.dduru.gildongmu.survey.domain.TravelTendency; import com.dduru.gildongmu.survey.domain.enums.AvatarType; +import com.dduru.gildongmu.survey.dto.AvatarProfileResponse; import com.dduru.gildongmu.survey.dto.SurveyRequest; import com.dduru.gildongmu.survey.dto.SurveyResponse; import com.dduru.gildongmu.survey.exception.SurveyResultNotFoundException; @@ -30,7 +31,7 @@ public class SurveyService { private final SurveyConverter surveyConverter; private final TravelTendencyCalculator tendencyCalculator; private final AvatarMatcher avatarMatcher; - private final AvatarProfileProvider avatarProfileProvider; + private final AvatarProfileService avatarProfileService; private final UserRepository userRepository; public SurveyResponse submitSurvey(Long userId, SurveyRequest request) { @@ -44,7 +45,7 @@ public SurveyResponse submitSurvey(Long userId, SurveyRequest request) { saveOrUpdateTravelTendency(user, scores, avatarType); - AvatarProfileProvider.AvatarProfile profile = avatarProfileProvider.getProfile(avatarType); + AvatarProfileResponse profile = avatarProfileService.getProfile(avatarType); log.info("설문조사 제출 완료 - userId: {}, avatarType: {}, 점수: R={}, W={}, S={}, P={}", userId, avatarType, scores.r(), scores.w(), scores.s(), scores.p()); @@ -60,7 +61,7 @@ public SurveyResponse getMySurveyResult(Long userId) { .orElseThrow(SurveyResultNotFoundException::of); log.info("설문 결과 조회 완료 - userId: {}, avatarType: {}", userId, travelTendency.getAvatarType()); - return SurveyResponse.from(travelTendency, avatarProfileProvider); + return SurveyResponse.from(travelTendency, avatarProfileService); } private Survey saveOrUpdateSurvey(User user, SurveyRequest request) { diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 4c40e61..a69fa52 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -3,7 +3,7 @@ spring: activate: on-profile: dev datasource: - url: jdbc:mysql://localhost:3307/dduru + url: jdbc:mysql://localhost:3307/dduru?characterEncoding=UTF-8&useUnicode=true&serverTimezone=Asia/Seoul username: root password: root driver-class-name: com.mysql.cj.jdbc.Driver diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 1e3b426..24bd146 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -52,5 +52,5 @@ springdoc: tags-sorter: alpha disable-swagger-default-url: true validator-url: none - default-consumes-media-type: application/json - default-produces-media-type: application/json + default-consumes-media-type: application/json;charset=UTF-8 + default-produces-media-type: application/json;charset=UTF-8 diff --git a/src/test/java/com/dduru/gildongmu/survey/service/SurveyServiceTest.java b/src/test/java/com/dduru/gildongmu/survey/service/SurveyServiceTest.java index bb5db99..2d8c375 100644 --- a/src/test/java/com/dduru/gildongmu/survey/service/SurveyServiceTest.java +++ b/src/test/java/com/dduru/gildongmu/survey/service/SurveyServiceTest.java @@ -5,6 +5,7 @@ import com.dduru.gildongmu.survey.domain.Survey; import com.dduru.gildongmu.survey.domain.TravelTendency; import com.dduru.gildongmu.survey.domain.enums.*; +import com.dduru.gildongmu.survey.dto.AvatarProfileResponse; import com.dduru.gildongmu.survey.dto.SurveyRequest; import com.dduru.gildongmu.survey.dto.SurveyResponse; import com.dduru.gildongmu.survey.exception.SurveyResultNotFoundException; @@ -44,7 +45,7 @@ class SurveyServiceTest { @Mock private AvatarMatcher avatarMatcher; @Mock - private AvatarProfileProvider avatarProfileProvider; + private AvatarProfileService avatarProfileService; @Mock private UserRepository userRepository; @@ -115,10 +116,10 @@ void setUp() { when(tendencyCalculator.calculate(testSurvey)).thenReturn(scores); when(avatarMatcher.match(scores.r(), scores.w(), scores.s())).thenReturn(AvatarType.TTUR_SWEET); - AvatarProfileProvider.AvatarProfile profile = new AvatarProfileProvider.AvatarProfile( - "성격", "강점", "팁", List.of("태그1", "태그2", "태그3") + AvatarProfileResponse profile = new AvatarProfileResponse( + "설명", "성격", "강점", "팁", List.of("태그1", "태그2", "태그3") ); - when(avatarProfileProvider.getProfile(AvatarType.TTUR_SWEET)).thenReturn(profile); + when(avatarProfileService.getProfile(AvatarType.TTUR_SWEET)).thenReturn(profile); when(travelTendencyRepository.findByUser(testUser)).thenReturn(Optional.empty()); when(travelTendencyRepository.save(any(TravelTendency.class))).thenAnswer(invocation -> invocation.getArgument(0)); @@ -182,10 +183,10 @@ void setUp() { when(tendencyCalculator.calculate(existingSurvey)).thenReturn(scores); when(avatarMatcher.match(scores.r(), scores.w(), scores.s())).thenReturn(AvatarType.TTUR_PADO); - AvatarProfileProvider.AvatarProfile profile = new AvatarProfileProvider.AvatarProfile( - "성격2", "강점2", "팁2", List.of("태그1", "태그2", "태그3") + AvatarProfileResponse profile = new AvatarProfileResponse( + "설명2", "성격2", "강점2", "팁2", List.of("태그1", "태그2", "태그3") ); - when(avatarProfileProvider.getProfile(AvatarType.TTUR_PADO)).thenReturn(profile); + when(avatarProfileService.getProfile(AvatarType.TTUR_PADO)).thenReturn(profile); TravelTendency existingTendency = TravelTendency.create( testUser, @@ -235,10 +236,10 @@ void setUp() { when(userRepository.getByIdOrThrow(1L)).thenReturn(testUser); when(travelTendencyRepository.findByUser(testUser)).thenReturn(Optional.of(travelTendency)); - AvatarProfileProvider.AvatarProfile profile = new AvatarProfileProvider.AvatarProfile( - "성격", "강점", "팁", List.of("태그1", "태그2", "태그3") + AvatarProfileResponse profile = new AvatarProfileResponse( + "설명", "성격", "강점", "팁", List.of("태그1", "태그2", "태그3") ); - when(avatarProfileProvider.getProfile(AvatarType.TTUR_SWEET)).thenReturn(profile); + when(avatarProfileService.getProfile(AvatarType.TTUR_SWEET)).thenReturn(profile); // when SurveyResponse response = surveyService.getMySurveyResult(1L);