intellij Idea don't run a JUnit5 test annotated of kotlin annotation + @TestTemplate

Answered

Hello:)

I've created the next annotation for repeating tests:

@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.RUNTIME)
@ExtendWith(RetryTestExtension::class)
@TestTemplate
annotation class Retry(val value: Int = 1,
val exceptions: Array<KClass<out Throwable>> = [Throwable::class],
val sleep: Long = 0,
val name: String = SHORT_DISPLAY_NAME
)

This annotation contains @TestTemplate. It can run tests in JUnit5.

But when I'm using it on a test, idea isn't showing the button to run a test:

class ExampleRetryTest{

@Retry
fun test1(){
println("test1")
}
}

If I add @TestTemplate I can run a test

class ExampleRetryTest{

@Retry
@TestTemplate
fun test2(){
println("test1")
}
}

You can see:

If I run a test from maven it works without @TestTemplate:)

What Do I need to do that I can run to tests?

what's wrong?;)

0
4 comments

Please file a bug at https://youtrack.jetbrains.com/issues/KT with a simple project (or .kt file) attached. 

0
Avatar
Permanently deleted user

Same problem with `@Testable` and own test engine

import org.junit.platform.commons.annotation.Testable

@Testable
@Target(AnnotationTarget.CLASS)
annotation class Group
0

@...

Feel free to add your details in the reproted bug: https://youtrack.jetbrains.com/issue/KT-34183

0

Please sign in to leave a comment.