Annotation Type DisableIfAllArguments


  • @Target(METHOD)
    @Retention(RUNTIME)
    @ExtendWith(DisableIfArgumentExtension.class)
    public @interface DisableIfAllArguments
    @DisableIfAllArguments is a JUnit Jupiter extension that selectively disables a ParameterizedTest execution if all arguments (as defined by Object.toString()) satisfy the specified condition.

    The extension uses Jupiter's InvocationInterceptor. It's important to note that since it's marked as org.apiguardian.api.API.Status#EXPERIMENTAL it might be removed without prior notice. Unlike Disabled annotations, this extension doesn't disable the whole test method. With DisableIfAllArguments, it is possible to selectively disable tests out of the plethora of dynamically registered parameterized tests.

    The extension requires that exactly one of contains or matches is configured.

    For more information how the extension resolves the annotations, check the documentation on disabling parameterized tests.

    Since:
    1.5.0
    See Also:
    DisableIfArgumentExtension
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String[] contains
      Disable test cases if all arguments (converted to String with Object.toString()) contain any of the specified strings (according to String.contains(CharSequence)).
      java.lang.String[] matches
      Disable test cases if all arguments (converted to String with Object.toString()) match any of the specified regular expressions (according to String.matches(String)).
    • Element Detail

      • contains

        java.lang.String[] contains
        Disable test cases if all arguments (converted to String with Object.toString()) contain any of the specified strings (according to String.contains(CharSequence)).
        Default:
        {}
      • matches

        java.lang.String[] matches
        Disable test cases if all arguments (converted to String with Object.toString()) match any of the specified regular expressions (according to String.matches(String)).
        Default:
        {}