1

I am using Java TestNG annotation:

@Test(groups = ['integration'])

And I would like to create Kotlin annotation like:

@IntegrationTest

Is it doable ?

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.