Questions tagged [kotlintest]

KotlinTest is open-source testing framework for Kotlin

Kotest is open-source testing framework for Kotlin: https://github.com/kotest/kotest/

82 questions
0
votes
0 answers

Can I use @WithMockUser with KotlinTest?

I am trying to use an annotation similar to @WithMockUser in KotlinTest. I have added the annotation to my spec, but it does not seem to work. I'm trying to write my own listener as well, but it does not seem to work, as I cannot get any annotation…
user2969329
  • 181
  • 1
  • 2
  • 6
0
votes
1 answer

Kotlintest with Spring Test, @Transactional not working/applied

I have a problem getting Spring Boot 2.0.5 to work nicely with Kotlintest 3.1.10. I made a test project illustrating the problem I have. The project is a Spring Boot 2 application with two entities, ShoppingOrder and OrderLine (to be totally…
0
votes
1 answer

how to mock/match lambda in kotlin method signature

I have some code on the follwing form: @Language("SQL") val someSql = """ SELECT foo FROM bar WHERE foo = :foo """ return session.select(some, mapOf("foo" to foo)) { MyObject( foo = it.string("foo"), …
David Karlsson
  • 9,396
  • 9
  • 58
  • 103
0
votes
0 answers

KotlinTest Multiple Beans

I would like to create Tests for a SpringBoot application. I am reading an example and I cannot understard what should I do when I have multiple MyBean to test. Should I create a new Test file? Should I Autowire all of my beans into one class? What…
LiTTle
  • 1,811
  • 1
  • 20
  • 37
0
votes
0 answers

Tests in kotlin

I am new to kotlin development. In my app I want to write test cases but I am not able to use it. Src/test/kotlin folder is not getting created gradle android { compileSdkVersion 27 defaultConfig { applicationId…
Anuj Mody
  • 505
  • 1
  • 5
  • 6
0
votes
1 answer

how to properly initialize shared resource in kotlintest 2.x (interceptSpec)

I'm trying to do a standard beforeAll/afterAll type setup in the unit tests, but am having some problems. It seems like the interceptSpec functionality is what I want and the documentation explicitly mentions this is good for e.g. cleaning up…
Danny G
  • 581
  • 4
  • 16
-1
votes
1 answer

Excluding duplicated class Tests

I am running tests via Intellij and i have a small problem. My code looks like that and the test code is not neccessary to show i think. MenuBarController.kt: private val logger = KotlinLogging.logger {} class ExampleClass { Now if i run the tests…
Zubty
  • 369
  • 2
  • 18
1 2 3 4 5
6