Passing Java classes as arguments to annotation

Passing Java classes as arguments to annotation

I tried to create a test suite with Kotlin that runs Java test classes. As far as I see, I followed the Android guides to a T: https://developer.android.com/training/testing/unit-testing/instrumented-unit-tests#test-suites

But for my @ Suite annotation, I am getting the error “An annotation argument must be a compile-time constant” and “Unresolved reference” errors for the test classes even though they are being imported.

@Suite.SuiteClasses( TestA::class, TestB::class, TestC::class, TestD::class )

Is this because they are Java files and they can’t be converted to KClass like this? How can I pass in Java files?

submitted by /u/Due_Profession_7174
[link] [comments]