Can anyone explain why am i getting this error while running below code ? get same error with other annotations also (e.g. @MethodSource , @CsvSource)
class TestRunningOnJUnit5 {
@ParameterizedTest
@CsvSource("test,TEST", "tEst,TEST", "Java,JAVA")
fun toUpperCase_ShouldGenerateTheExpectedUppercaseValue(
input: String,
expected: String?
) {
val actualValue = input.toUpperCase()
assertEquals(expected, actualValue)
}
}
here is my build.gradle file and also attached screenshot of error. i do not have reference of junit 4 in build.gradle why it is throwing error for AndridjUnit4ClassRunner
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0
implementation 'androidx.test.espresso:espresso-idling-resource:3.2.0'
// Android Testing Support Libraries's runner and rules
androidTestUtil 'androidx.test:orchestrator:1.3.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
// Espresso UI Testing
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
// Android Instrumentation Tests wth JUnit 5
testImplementation "org.junit.jupiter:junit-jupiter-api:5.7.0"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.7.0"
testImplementation "org.junit.jupiter:junit-jupiter-params:5.7.0"
androidTestImplementation "org.junit.jupiter:junit-jupiter-api:5.7.0"
androidTestImplementation "org.junit.jupiter:junit-jupiter-engine:5.7.0"
androidTestImplementation "org.junit.jupiter:junit-jupiter-params:5.7.0"
androidTestImplementation "de.mannodermaus.junit5:android-test-core:1.2.0"
androidTestRuntimeOnly "de.mannodermaus.junit5:android-test-runner:1.2.0"