Skip to content

Commit

Permalink
test: KeywordReader 테스트 코드 작성(#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
whereami2048 committed May 23, 2024
1 parent 065c0d7 commit f38ed47
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.bamyanggang.domainmodule.domain.strongpoint.service

import com.bamyanggang.domainmodule.domain.strongpoint.repository.KeywordRepository
import io.kotest.core.spec.style.BehaviorSpec
import io.mockk.mockk
import io.mockk.verify
import java.util.*

class KeywordReaderTest : BehaviorSpec({
val keywordRepository = mockk<KeywordRepository>(relaxed = true)
val keywordReader = KeywordReader(keywordRepository)

Given("기본 역량 키워드 id 배열이 주어졌을 때") {
val defaultStrongPoints = arrayListOf(
UUID.randomUUID(),
UUID.randomUUID(),
UUID.randomUUID()
)

When("KeywordReader.readByIds 함수가 호출되면") {
keywordReader.readByIds(defaultStrongPoints)

Then("keywordRepository.findByIds 함수가 호출된다.") {
verify { keywordRepository.findByIds(defaultStrongPoints) }
}
}
}
})

0 comments on commit f38ed47

Please sign in to comment.