Reports JUnit test member declarations that are malformed and are likely not recognized by the JUnit test framework. The following problems are reported by this inspection: Note that in Kotlin, suspending functions do have arguments and a non-void return type. Therefore, they also will not be executed by the JUnit test runner. This inspection will also report about this problem.

Malformed @Before method example (Java):

@Before private int foo(int arg) { ... } 

After the quick-fix is applied:

@Before public void foo() { ... } 

Missing method source example (Kotlin):


  class Example {
    @MethodSource("parameters")
    @ParameterizedTest
    fun foo(param: String) { ... }
  }

After the quick-fix is applied:


  class Example {
    @MethodSource("parameters")
    @ParameterizedTest
    fun foo(param: String) { ... }

    companion object {
      @JvmStatic
      fun parameters(): Stream<Arguments> {
        TODO("Not yet implemented")
      }
    }
  }

Use the inspection options to specify annotations. Any parameter annotated with one of these annotations will not be reported.