HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
🤩
개발
/Kotlin/
Kotest

Kotest

[ Kotlin Docs ] Quick Start , Spring
[ Baeldung ] How to write a Spring Boot Test Using Kotest
  • intellij에서 Kotest 테스트를 실행시키기 위해서는 Intellij Plugin Kotest를 설치해야 함 [ 참고 ]
코테스트는 크게 3가지 서브프로젝트로 구성되어 있음
  • Test framework
  • Assertions library
  • Property testing

Testing Styles

[ Kotest docs ] Testing Styles
코틀린은 10가지의 다른 종류의 테스트 레이아웃을 제공해줌
  • Lifecycle hook
 

사용

[ Kotest Docs ] Spring
Kotest에서 Spring Framework를 사용하는 코드를 적용하려면 Spring Extension 이 활성화 되어 있어야 함
@DataJpaTest class ItemRepositoryTest @Autowired constructor( private val itemRepository: ItemRepository, private val entityManager: EntityManager ) : DescribeSpec() { override fun extensions() = listOf(SpringExtension) // extension 활성화 }