I am trying to use the gradle JVM test suite plugin to perform integration test for my Kotlin project. Some of the classes and apis are internal
visibility.
I followed the sample code to create new test suite integrationTest
:
testing {
suites {
val integrationTest by registering(JvmTestSuite::class) {
dependencies {
implementation(project)
}
...
}
}
}
But the source code under src/integrationTest/kotlin
could not see internal
classes in project main. I understand that the test suite of integrationTest
is not in the same module with project main.
My questions are:
- why this behavior is not consistent with the default test suite
test
which can access internal classes in project main? - If this is by design, how can I workaround this to make internal classes visible to test suite of
integrationTest
?