Cucumber kotlin : IllegalStateException when launching test via Intellij

Viewed 408

I am trying to launch a cucumber (written in kotlin) via intellij.

I have a step definition class described as followed :

enter image description here

When I launch the test from Intellij, I have this Exception on the "Given" method: java.lang.IllegalStateException: Could resolve the return type of the lambda at BusinessEventSteps.kt:19

enter image description here

When using "mvn clean install" from a command line, the test runs fine.

My environment:

  • MacOS
  • Coretto 11.0.11
  • Intellij 2021.1.1
  • Kotlin 1.4.10
  • cucumber 6.10.4
1 Answers

Found a workaround. It seems that the issue has something to do with the native Intellij compiler. Editing the Run/Debug Configurations and replacing the default "Build" step by a maven goal, everything works fine.

Hope this will help others !

enter image description here

Related