Ahmed Mourad
11/04/2020, 8:39 AMException in thread "main" java.lang.ClassNotFoundException: io.kotest.engine.launcher.MainKt
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
at com.intellij.rt.execution.CommandLineWrapper.loadMainClassWithCustomLoader(CommandLineWrapper.java:193)
at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:48)
I'm using a DescribeSpec
with no @RunWith
annotations:
class SomeTests : DescribeSpec({ ... })
This's what my build.gradle
looks like:
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
apply plugin: "kotlin-android-extensions"
apply plugin: "kotlin-kapt"
apply plugin: "de.mannodermaus.android-junit5"
...
android {
compileSdkVersion 30
defaultConfig {
minSdkVersion 17
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
...
}
testOptions {
unitTests.all {
useJUnitPlatform()
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
...
androidTestImplementation "androidx.test:runner:1.3.0"
androidTestImplementation "androidx.test:core:1.3.0"
androidTestImplementation "androidx.test.ext:junit:1.1.2"
androidTestImplementation 'io.kotest:kotest-runner-junit5:4.3.1'
androidTestImplementation 'io.kotest:kotest-assertions-core:4.3.1'
androidTestImplementation 'io.kotest:kotest-property:4.3.1'
androidTestImplementation 'io.kotest:kotest-assertions-arrow:4.3.1'
}
and this's what my test configs look like:alexfacciorusso
11/04/2020, 9:07 AM26
because of some dependencies in Kotest not compiling on earlier versions, but that example works for now