Annotation Type DisableIfDisplayName


  • @Target(METHOD)
    @Retention(RUNTIME)
    @ExtendWith(DisableIfNameExtension.class)
    public @interface DisableIfDisplayName
    @DisableIfDisplayName is a JUnit Jupiter extension that can be used to selectively disable a ParameterizedTest execution based on their display name.

    The extension is an ExecutionCondition that validates dynamically registered tests. Unlike Disabled annotations, this extension doesn't disable the whole test method. With DisableIfDisplayName, it is possible to selectively disable tests out of the plethora of dynamically registered parameterized tests.

    If neither contains nor matches is configured, or if both are present, the extension will throw an exception.

    Since:
    0.7
    See Also:
    DisableIfNameExtension
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String[] contains
      Disable test cases whose display name contain the specified strings (according to String.contains(CharSequence)).
      java.lang.String[] matches
      Disable test cases whose display name matches the specified regular expression (according to String.matches(java.lang.String)).
    • Element Detail

      • contains

        java.lang.String[] contains
        Disable test cases whose display name contain the specified strings (according to String.contains(CharSequence)).
        Returns:
        test case display name substrings
        Default:
        {}
      • matches

        java.lang.String[] matches
        Disable test cases whose display name matches the specified regular expression (according to String.matches(java.lang.String)).
        Returns:
        test case display name regular expressions
        Default:
        {}