Reputation: 938
I am using Java TestNG annotation:
@Test(groups = ['integration'])
And I would like to create Kotlin annotation like:
@IntegrationTest
Is it doable ?
Upvotes: 1
Views: 348
Reputation: 23115
No, as of now Kotlin language doesn't have builtin tools that enable such use case.
You can resort to the annotation processing technique: write an annotation processor that replaces your custom @IntegrationTest
with @Test
from TestNG.
One drawback of annotation processing is that a processor is a black box to the tooling. For example, IDE won't treat the methods annotated with @IntegrationTest
as tests because it doesn't know that they are going to be post-processed later.
Also annotation processing is a JVM-specific tool, so it isn't supported on other platforms.
Upvotes: 2