From 4fe62be3557c64b1ad79a82bc1bc614dc47e142a Mon Sep 17 00:00:00 2001 From: whereami0404 Date: Thu, 23 May 2024 21:41:50 +0900 Subject: [PATCH 1/7] =?UTF-8?q?feat:=20=EA=B2=BD=ED=97=98=20=EC=97=AD?= =?UTF-8?q?=EB=9F=89=20=ED=82=A4=EC=9B=8C=EB=93=9C=20=EC=B5=9C=EC=86=8C=20?= =?UTF-8?q?=EA=B0=9C=EC=88=98=20=EC=A0=9C=ED=95=9C=20=EC=98=88=EC=99=B8=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20=EB=B0=8F=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=B6=94=EA=B0=80(#169)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/experience/aggregate/Experience.kt | 1 + .../experience/aggregate/ExperienceTest.kt | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/aggregate/Experience.kt b/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/aggregate/Experience.kt index f6a2586e..0d77f807 100644 --- a/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/aggregate/Experience.kt +++ b/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/aggregate/Experience.kt @@ -45,6 +45,7 @@ data class Experience( init { require(title.length < 50) { "제목의 글자 수는 50자 제한입니다." } require(startedAt <= endedAt) { "활동 시작일은 종료일보다 빨라야 합니다."} + require(strongPoints.isNotEmpty()) { "최소 1개 이상의 역량 키워드를 선택해야 합니다."} } companion object { diff --git a/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/aggregate/ExperienceTest.kt b/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/aggregate/ExperienceTest.kt index 8a08e59f..be9f1b02 100644 --- a/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/aggregate/ExperienceTest.kt +++ b/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/aggregate/ExperienceTest.kt @@ -98,4 +98,31 @@ class ExperienceTest : FunSpec({ ) } } + + test("역량 키워드 최소 개수 제한 테스트") { + val title = "경험 제목" + val parentTagId: UUID = UUID.randomUUID() + val childTagId: UUID = UUID.randomUUID() + val contents: List = generateFixture() + val userId : UUID = generateFixture() + val startedAt = LocalDateTime.now() + val endedAt = startedAt.minusDays(1) + + val experienceStrongPoints = emptyList() + + val exception = shouldThrow { + Experience.create( + title = title, + userId = userId, + parentTagId = parentTagId, + childTagId = childTagId, + contents = contents, + experienceStrongPoints = experienceStrongPoints, + startedAt = startedAt, + endedAt = endedAt, + ) + } + + assert(exception.message == "최소 1개 이상의 역량 키워드를 선택해야 합니다.") + } }) From 1b178301fb0d8739e9858eb47161f0c886144214 Mon Sep 17 00:00:00 2001 From: whereami0404 Date: Thu, 23 May 2024 21:47:43 +0900 Subject: [PATCH 2/7] =?UTF-8?q?test:=20ExperienceAppender=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=BD=94=EB=93=9C=20=EC=9E=91=EC=84=B1(#1?= =?UTF-8?q?69)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ExperienceAppenderTest.kt | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceAppenderTest.kt diff --git a/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceAppenderTest.kt b/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceAppenderTest.kt new file mode 100644 index 00000000..f2d84364 --- /dev/null +++ b/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceAppenderTest.kt @@ -0,0 +1,60 @@ +package com.bamyanggang.domainmodule.domain.experience.service + +import com.bamyanggang.domainmodule.domain.experience.aggregate.ExperienceContent +import com.bamyanggang.domainmodule.domain.experience.aggregate.ExperienceStrongPoint +import com.bamyanggang.domainmodule.domain.experience.repository.ExperienceRepository +import io.kotest.core.spec.style.BehaviorSpec +import io.mockk.mockk +import io.mockk.verify +import java.time.LocalDateTime +import java.util.* + +class ExperienceAppenderTest : BehaviorSpec({ + val experienceRepository = mockk(relaxed = true) + val experienceAppender = ExperienceAppender(experienceRepository) + + Given("경험 등록 데이터들이 주어졌을 때") { + val title = "경험 제목" + val parentTagId: UUID = UUID.randomUUID() + val childTagId: UUID = UUID.randomUUID() + val contents = arrayListOf( + ExperienceContent( + question = "질문 1", + answer = "대답 1" + ), + ExperienceContent( + question = "질문 2", + answer = "대답 2" + ) + ) + + val experienceStrongPoints: List = arrayListOf( + ExperienceStrongPoint.create( + UUID.randomUUID() + ), + ExperienceStrongPoint.create( + UUID.randomUUID() + ) + ) + val startedAt: LocalDateTime = LocalDateTime.now() + val endedAt: LocalDateTime = startedAt.plusDays(1) + val userId = UUID.randomUUID() + + When("ExperienceAppender.appendExperience를 호출하면") { + val newExperience = experienceAppender.appendExperience( + title = title, + parentTagId = parentTagId, + childTagId = childTagId, + contents = contents, + experienceStrongPoints = experienceStrongPoints, + userId = userId, + startedAt = startedAt, + endedAt = endedAt + ) + + Then("experienceRepository.save가 호출된다.") { + verify { experienceRepository.save(newExperience) } + } + } + } +}) From 99cc096821c397b3aa363c78b1041e5f81b89d75 Mon Sep 17 00:00:00 2001 From: whereami0404 Date: Thu, 23 May 2024 22:01:13 +0900 Subject: [PATCH 3/7] =?UTF-8?q?test:=20ExperienceModifier=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=BD=94=EB=93=9C=20=EC=9E=91=EC=84=B1(#1?= =?UTF-8?q?69)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ExperienceModifierTest.kt | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceModifierTest.kt diff --git a/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceModifierTest.kt b/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceModifierTest.kt new file mode 100644 index 00000000..9965cd52 --- /dev/null +++ b/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceModifierTest.kt @@ -0,0 +1,63 @@ +package com.bamyanggang.domainmodule.domain.experience.service + +import com.bamyanggang.domainmodule.domain.experience.aggregate.ExperienceContent +import com.bamyanggang.domainmodule.domain.experience.aggregate.ExperienceStrongPoint +import com.bamyanggang.domainmodule.domain.experience.repository.ExperienceRepository +import io.kotest.core.spec.style.BehaviorSpec +import io.mockk.mockk +import io.mockk.verify +import java.time.LocalDateTime +import java.util.* + +class ExperienceModifierTest : BehaviorSpec({ + val experienceRepository = mockk(relaxed = true) + val experienceModifier = ExperienceModifier(experienceRepository) + + Given("수정할 경험 등록 데이터들이 주어졌을 때") { + val experienceId = UUID.randomUUID() + val title = "수정한 경험 제목" + val parentTagId: UUID = UUID.randomUUID() + val childTagId: UUID = UUID.randomUUID() + val contents = arrayListOf( + ExperienceContent( + question = "수정한 질문 1", + answer = "수정한 대답 1" + ), + ExperienceContent( + question = "수정한 질문 2", + answer = "수정한 대답 2" + ) + ) + + val experienceStrongPoints: List = arrayListOf( + ExperienceStrongPoint.create( + UUID.randomUUID() + ), + ExperienceStrongPoint.create( + UUID.randomUUID() + ) + ) + val startedAt: LocalDateTime = LocalDateTime.now() + val endedAt: LocalDateTime = startedAt.plusDays(1) + val userId = UUID.randomUUID() + + When("ExperienceModifier.modifyExperience 호출하면") { + val editExperience = experienceModifier.modifyExperience( + experienceId = experienceId, + title = title, + parentTagId = parentTagId, + childTagId = childTagId, + contents = contents, + experienceStrongPoints = experienceStrongPoints, + userId = userId, + startedAt = startedAt, + endedAt = endedAt + ) + + Then("experienceRepository.save가 호출된다.") { + verify { experienceRepository.save(editExperience) } + } + } + } + +}) From 0f975d7b1c6c18e18690cbd7b0d5934d4441669d Mon Sep 17 00:00:00 2001 From: whereami0404 Date: Thu, 23 May 2024 22:06:30 +0900 Subject: [PATCH 4/7] =?UTF-8?q?test:=20Experience=20Modifier,=20Remover=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=BD=94=EB=93=9C=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1(#169)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ExperienceModifierTest.kt | 1 - .../service/ExperienceRemoverTest.kt | 24 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceRemoverTest.kt diff --git a/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceModifierTest.kt b/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceModifierTest.kt index 9965cd52..bdc9ac62 100644 --- a/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceModifierTest.kt +++ b/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceModifierTest.kt @@ -59,5 +59,4 @@ class ExperienceModifierTest : BehaviorSpec({ } } } - }) diff --git a/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceRemoverTest.kt b/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceRemoverTest.kt new file mode 100644 index 00000000..d0c9238f --- /dev/null +++ b/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceRemoverTest.kt @@ -0,0 +1,24 @@ +package com.bamyanggang.domainmodule.domain.experience.service + +import com.bamyanggang.domainmodule.domain.experience.repository.ExperienceRepository +import io.kotest.core.spec.style.BehaviorSpec +import io.mockk.mockk +import io.mockk.verify +import java.util.* + +class ExperienceRemoverTest : BehaviorSpec({ + val experienceRepository = mockk(relaxed = true) + val experienceRemover = ExperienceRemover(experienceRepository) + + Given("삭제할 경험 id가 주어졌을 때") { + val deleteExperienceId = UUID.randomUUID() + + When("ExperienceRemover.remove가 호출되면") { + experienceRemover.remove(deleteExperienceId) + + Then("experienceRepository.deleteByExperienceId가 호출된다.") { + verify { experienceRepository.deleteByExperienceId(deleteExperienceId) } + } + } + } +}) From c550fdfeb950d525cd6ca01ab13d167c811255bf Mon Sep 17 00:00:00 2001 From: whereami0404 Date: Thu, 23 May 2024 22:39:43 +0900 Subject: [PATCH 5/7] =?UTF-8?q?test:=20=EA=B2=BD=ED=97=98=20=EB=82=B4?= =?UTF-8?q?=EC=9A=A9=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=84=B8=ED=8C=85=20?= =?UTF-8?q?generateFixture()=20=EC=A0=9C=EA=B1=B0(#169)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/experience/aggregate/ExperienceTest.kt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/aggregate/ExperienceTest.kt b/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/aggregate/ExperienceTest.kt index be9f1b02..734798b0 100644 --- a/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/aggregate/ExperienceTest.kt +++ b/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/aggregate/ExperienceTest.kt @@ -103,10 +103,19 @@ class ExperienceTest : FunSpec({ val title = "경험 제목" val parentTagId: UUID = UUID.randomUUID() val childTagId: UUID = UUID.randomUUID() - val contents: List = generateFixture() - val userId : UUID = generateFixture() + val contents = arrayListOf( + ExperienceContent( + question = "질문 1", + answer = "대답 1" + ), + ExperienceContent( + question = "질문 2", + answer = "대답 2" + ) + ) + val userId : UUID = UUID.randomUUID() val startedAt = LocalDateTime.now() - val endedAt = startedAt.minusDays(1) + val endedAt = startedAt.plusDays(1) val experienceStrongPoints = emptyList() From dc51425d2f3313ef85c32f5db7a25f532f4769f5 Mon Sep 17 00:00:00 2001 From: whereami0404 Date: Thu, 23 May 2024 22:41:22 +0900 Subject: [PATCH 6/7] =?UTF-8?q?chore:=20readByChildTag=20=ED=95=A8?= =?UTF-8?q?=EC=88=98=EB=AA=85=20=EB=B3=80=EA=B2=BD(#169)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/tag/application/service/TagDeleteService.kt | 2 +- .../domain/experience/service/ExperienceReader.kt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/tag/application/service/TagDeleteService.kt b/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/tag/application/service/TagDeleteService.kt index f99f91de..598eadb6 100644 --- a/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/tag/application/service/TagDeleteService.kt +++ b/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/tag/application/service/TagDeleteService.kt @@ -24,7 +24,7 @@ class TagDeleteService( experienceReader.readByUserIdAndParentTagId(getAuthenticationPrincipal(), deleteTag.id) .forEach { experienceRemover.remove(it.id) } }else { - experienceReader.readByChildTag(tagId).forEach { + experienceReader.readByChildTagId(tagId).forEach { experienceRemover.remove(it.id) } } diff --git a/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceReader.kt b/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceReader.kt index f48b427e..9e8bff50 100644 --- a/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceReader.kt +++ b/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceReader.kt @@ -57,12 +57,13 @@ class ExperienceReader( }.contains(true) }.map { it.id } } + fun readByYear(year: Int): List { return experienceRepository.findByYear(year) } - fun readByChildTag(childTag: UUID): List { - return experienceRepository.findByChildTagId(childTag) + fun readByChildTagId(childTagId: UUID): List { + return experienceRepository.findByChildTagId(childTagId) } fun readIdsByTagIds(tagIds: List) : List { From 1e4350f09e28448c6cc466117e6c78d1df3850ff Mon Sep 17 00:00:00 2001 From: whereami0404 Date: Thu, 23 May 2024 22:41:35 +0900 Subject: [PATCH 7/7] =?UTF-8?q?test:=20ExperienceReader=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=BD=94=EB=93=9C=20=EC=9E=91=EC=84=B1(#1?= =?UTF-8?q?69)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ExperienceReaderTest.kt | 236 ++++++++++++++++++ 1 file changed, 236 insertions(+) create mode 100644 Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceReaderTest.kt diff --git a/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceReaderTest.kt b/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceReaderTest.kt new file mode 100644 index 00000000..bc6a1459 --- /dev/null +++ b/Domain-Module/src/test/kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceReaderTest.kt @@ -0,0 +1,236 @@ +package com.bamyanggang.domainmodule.domain.experience.service + +import com.bamyanggang.domainmodule.domain.experience.repository.ExperienceRepository +import io.kotest.core.spec.style.BehaviorSpec +import io.mockk.mockk +import io.mockk.verify +import java.time.LocalDate +import java.util.* + +class ExperienceReaderTest : BehaviorSpec({ + val experienceRepository = mockk(relaxed = true) + val experienceReader = ExperienceReader(experienceRepository) + + Given("단건 조회할 경험 id가 주어졌을 때") { + val experienceId = UUID.randomUUID() + + When("ExperienceReader.readExperience 가 호출되면") { + experienceReader.readExperience(experienceId) + + Then("experienceRepository.findByExperienceId 가 호출된다.") { + verify { experienceRepository.findByExperienceId(experienceId) } + } + } + } + + Given("userId가 주어졌을 때") { + val userId = UUID.randomUUID() + + When("ExperienceReader.readAllYearsByExistExperience 가 호출되면") { + experienceReader.readAllYearsByExistExperience(userId) + + Then("ExperienceReader.readAllByUserId 가 호출된다.") { + verify { experienceReader.readAllByUserId(userId) } + } + } + + When("ExperienceReader.readAllByUserId 가 호출되면") { + experienceReader.readAllByUserId(userId) + + Then("experienceRepository.findAllByUserId 가 호출된다.") { + verify { experienceRepository.findAllByUserId(userId) } + } + } + } + + Given("userId와 year가 주어졌을 때") { + val userId = UUID.randomUUID() + val year = LocalDate.now().year + + When("ExperienceReader.readByUserIdAndYearDesc 가 호출되면") { + experienceReader.readByUserIdAndYearDesc( + year = year, + userId = userId) + + Then("experienceRepository.findByUserIdAndYearDesc 가 호출된다.") { + verify { experienceRepository.findByUserIdAndYearDesc( + year = year, + userId = userId) + } + } + } + } + + Given("year와 parentTagId가 주어졌을 때") { + val parentTagId = UUID.randomUUID() + val year = LocalDate.now().year + + When("ExperienceReader.readByYearAndParentTagId 가 호출되면") { + experienceReader.readByYearAndParentTagId( + year = year, + parentTagId = parentTagId + ) + + Then("experienceRepository.findByYearAndParentTagId 가 호출된다.") { + verify { experienceRepository.findByYearAndParentTagId( + year = year, + parentTagId = parentTagId) + } + } + } + } + + Given("userId와 parentTagId가 주어졌을 때") { + val parentTagId = UUID.randomUUID() + val userId = UUID.randomUUID() + + When("ExperienceReader.readByUserIdAndParentTagId 가 호출되면") { + experienceReader.readByUserIdAndParentTagId( + userId = userId, + parentTagId = parentTagId + ) + + Then("experienceRepository.findByYearAndParentTagId 가 호출된다.") { + verify { experienceRepository.findByUserIdAndParentTagId( + userId = userId, + parentTagId = parentTagId) + } + } + } + } + + Given("year와 childTagId가 주어졌을 때") { + val childTagId = UUID.randomUUID() + val year = LocalDate.now().year + + When("ExperienceReader.readByChildTagIdAndYear 가 호출되면") { + experienceReader.readByChildTagIdAndYear( + childTagId = childTagId, + year = year + ) + + Then("experienceRepository.findByYearAndChildTagId 가 호출된다.") { + verify { experienceRepository.findByYearAndChildTagId( + childTagId = childTagId, + year = year) + } + } + } + } + + Given("조회할 experienceId 배열이 주어졌을 때") { + val experienceIds = arrayListOf( + UUID.randomUUID(), + UUID.randomUUID(), + UUID.randomUUID() + ) + + When("ExperienceReader.readByIds 가 호출되면") { + experienceReader.readByIds(experienceIds) + + Then("experienceRepository.findByIds 가 호출된다.") { + verify { experienceRepository.findByIds(experienceIds) } + } + } + } + + Given("userId, search(경험 제목 검색) 문자열이 주어졌을 때") { + val userId = UUID.randomUUID() + val search = "제목 검색 문자열" + + When("ExperienceReader.readIdsByUserIdAndTitleContains 가 호출되면") { + experienceReader.readIdsByUserIdAndTitleContains( + userId = userId, + search = search + ) + + Then("experienceRepository.findByUserIdAndTitleContains 가 호출된다.") { + verify { experienceRepository.findByUserIdAndTitleContains( + userId = userId, + search = search) + } + } + } + } + + Given("userId, search(경험 내용 검색) 검색 문자열이 주어졌을 때") { + val userId = UUID.randomUUID() + val search = "내용 검색 문자열" + + When("ExperienceReader.readIdsByContentsContains 가 호출되면") { + experienceReader.readIdsByContentsContains( + userId = userId, + search = search + ) + + Then("experienceRepository.findAllByUserId 가 호출된다.") { + verify { experienceRepository.findAllByUserId(userId = userId) + } + } + } + } + + Given("year(경험 검색 연도)이 주어졌을 때") { + val year = LocalDate.now().year + + When("ExperienceReader.readByYear 가 호출되면") { + experienceReader.readByYear(year) + + Then("experienceRepository.findByYear 가 호출된다.") { + verify { experienceRepository.findByYear(year) + } + } + } + } + + Given("childTagId가 주어졌을 때") { + val childTagId = UUID.randomUUID() + + When("ExperienceReader.readByChildTag 가 호출되면") { + experienceReader.readByChildTagId(childTagId) + + Then("experienceRepository.findByChildTagId 가 호출된다.") { + verify { experienceRepository.findByChildTagId(childTagId) + } + } + } + } + + Given("태그 id 배열(상, 하위 상관 X)가 주어졌을 때") { + val tagIds = arrayListOf( + UUID.randomUUID(), + UUID.randomUUID(), + UUID.randomUUID() + ) + + When("ExperienceReader.readIdsByTagIds 가 호출되면") { + experienceReader.readIdsByTagIds(tagIds) + + Then("experienceRepository.findByTagIds 가 호출된다.") { + verify { experienceRepository.findByTagIds(tagIds) + } + } + } + } + + Given("유저 id, 역량 키워드 id 배열이 주어졌을 때") { + val userId = UUID.randomUUID() + val strongPointIds = arrayListOf( + UUID.randomUUID(), + UUID.randomUUID(), + UUID.randomUUID() + ) + + When("ExperienceReader.readIdsByStrongPointIds 가 호출되면") { + experienceReader.readIdsByStrongPointIds( + userId = userId, + strongPointIds = strongPointIds + ) + + Then("experienceRepository.findByTagIds 가 호출된다.") { + verify { experienceRepository.findAllByUserId(userId) + } + } + } + } +})