kotest 3

kotest 관련 @Transactional rollback 안되는 이슈

test 코드의 상위 패키지 레벨에 아래 설정을 넣어준다. object KotestConfig : AbstractProjectConfig() { // rollback 관련 동작 안해서 아래 설정 추가 override fun extensions() = listOf(SpringTestExtension(SpringTestLifecycleMode.Root)) } https://kotest.io/docs/framework/project-config.html Project Level Config | Kotest Kotest is flexible and has many ways to configure tests, such as configuring the order of tests inside a spec, or h..

kotest 생성자 bean 주입 오류 - Specs must have a public zero-arg constructor

kotest에서 빈을 생성자 주입으로 쓰려고 하면, Specs must have a public zero-arg constructor 오류가 발생 할 수 있다. 이 때에는 kotest-extension-spring 모듈이 필요로 하다. kotest extension spring 라이브러리가 두개가 검색 되곤 하는데, 헷갈리면 안된다. https://kotest.io/docs/extensions/spring.html Spring | Kotest Kotest offers a Spring extension that allows you to test code that uses the Spring framework for dependency injection. kotest.io 실제 docs를 보면, 1.1.3 ..

Kotest 기본만 알아보자

kotest link: https://kotest.io Kotest is a flexible and elegant multi-platform test framework for Kotlin with extensive assertions and integrated property testing. Testing Styles junit 스타일 지원, JS에서 많이 사용하는 jest와 유사한 테스트 스타일 지원, goovy로 작성하는 spock과도 유사한 형태의 behavior test 스타일도 각기 모두 지원한다. 테스트 스타일 종류 Fun Spec(Scala) Describe Spec(JavaScript framework) Should Spec(kotest) String Spec(kotest) Behavior..

반응형