From 3b2f7bac996b53b88060537c9b9a9a801a8dcac3 Mon Sep 17 00:00:00 2001 From: whereami0404 Date: Wed, 22 May 2024 02:37:09 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=EC=97=AD=EB=9F=89=20=ED=82=A4?= =?UTF-8?q?=EC=9B=8C=EB=93=9C=20=EB=AF=B8=20=EC=84=A0=ED=83=9D=20=EC=98=88?= =?UTF-8?q?=EC=99=B8=20=EC=B2=98=EB=A6=AC(#137)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/service/ExperienceCreateService.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/service/ExperienceCreateService.kt b/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/service/ExperienceCreateService.kt index f9fc946a..92c87d44 100644 --- a/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/service/ExperienceCreateService.kt +++ b/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/experience/application/service/ExperienceCreateService.kt @@ -20,9 +20,11 @@ class ExperienceCreateService( ExperienceContent.create(it.question, it.answer) } - val newExperienceStrongPoints = request.strongPointIds.map { - ExperienceStrongPoint.create(it) - } + val newExperienceStrongPoints = runCatching { + request.strongPointIds.map { + ExperienceStrongPoint.create(it) + } + }.getOrElse { emptyList() } return experienceAppender.appendExperience( title = request.title, From ad2987ad0f63aa04bfbf181bfe1a2ab0c080c47e Mon Sep 17 00:00:00 2001 From: whereami2048 Date: Wed, 22 May 2024 02:45:08 +0900 Subject: [PATCH 2/2] =?UTF-8?q?test:=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=EC=84=B8=ED=8C=85=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95(#1?= =?UTF-8?q?37)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/ExperienceControllerTest.kt | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/Api-Module/src/test/kotlin/com/bamyanggang/apimodule/domain/experience/presentation/ExperienceControllerTest.kt b/Api-Module/src/test/kotlin/com/bamyanggang/apimodule/domain/experience/presentation/ExperienceControllerTest.kt index c64956df..a365790b 100644 --- a/Api-Module/src/test/kotlin/com/bamyanggang/apimodule/domain/experience/presentation/ExperienceControllerTest.kt +++ b/Api-Module/src/test/kotlin/com/bamyanggang/apimodule/domain/experience/presentation/ExperienceControllerTest.kt @@ -522,10 +522,32 @@ class ExperienceControllerTest : BaseRestDocsTest() { @DisplayName("유저의 경험 내 존재하는 연도들을 중복 제거한 리스트를 반환한다.") fun getExperienceYearsTest() { //given - val years = arrayListOf(2020,2021,2023, 2024, 2025) + val tagDetails = arrayListOf( + ExperienceYear.TagDetail( + UUID.randomUUID(), + "태그 상세 1" + ), + ExperienceYear.TagDetail( + UUID.randomUUID(), + "태그 상세 1" + ) + ) + + val yearTagInfos = arrayListOf( + ExperienceYear.YearTagInfo( + 2023, + tagDetails + ), + ExperienceYear.YearTagInfo( + 2024, + tagDetails + ) + ) + + val years = arrayListOf(2023, 2024) val yearResponse = ExperienceYear.Response( years, - generateFixture() + yearTagInfos ) given(experienceGetService.getAllYearsByExistExperience()).willReturn(yearResponse)