Class DisableIfArgumentExtension

  • All Implemented Interfaces:
    org.junit.jupiter.api.extension.Extension, org.junit.jupiter.api.extension.InvocationInterceptor

    class DisableIfArgumentExtension
    extends java.lang.Object
    implements org.junit.jupiter.api.extension.InvocationInterceptor
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  DisableIfArgumentExtension.ArgumentChecker  
      • Nested classes/interfaces inherited from interface org.junit.jupiter.api.extension.InvocationInterceptor

        org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<T extends java.lang.Object>
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static void checkRequiredAnnotations​(java.lang.reflect.Method testMethod)  
      private java.lang.Object findArgument​(java.lang.reflect.Method testMethod, java.util.List<java.lang.Object> arguments, DisableIfArgument annotation, int index)  
      private java.lang.Object findArgumentByIndex​(java.util.List<java.lang.Object> arguments, int index)  
      private java.lang.Object findArgumentByName​(java.lang.reflect.Method testMethod, java.util.List<java.lang.Object> arguments, java.lang.String name)  
      private int findParameterIndexFromName​(java.lang.reflect.Method testMethod, java.lang.String name)  
      void interceptTestTemplateMethod​(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<java.lang.Void> invocation, org.junit.jupiter.api.extension.ReflectiveInvocationContext<java.lang.reflect.Method> invocationContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext)  
      private static org.junit.jupiter.api.extension.ExtensionConfigurationException invalidInputs​(java.lang.Class<?> annotationClass)  
      private static void verifyNonEmptyInputs​(DisableIfAllArguments annotation)  
      private static void verifyNonEmptyInputs​(DisableIfAnyArgument annotation)  
      private static void verifyNonEmptyInputs​(DisableIfArgument annotation)  
      private void verifyValidIndex​(java.util.List<java.lang.Object> arguments, int index)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.junit.jupiter.api.extension.InvocationInterceptor

        interceptAfterAllMethod, interceptAfterEachMethod, interceptBeforeAllMethod, interceptBeforeEachMethod, interceptDynamicTest, interceptDynamicTest, interceptTestClassConstructor, interceptTestFactoryMethod, interceptTestMethod
    • Constructor Detail

      • DisableIfArgumentExtension

        DisableIfArgumentExtension()
    • Method Detail

      • interceptTestTemplateMethod

        public void interceptTestTemplateMethod​(org.junit.jupiter.api.extension.InvocationInterceptor.Invocation<java.lang.Void> invocation,
                                                org.junit.jupiter.api.extension.ReflectiveInvocationContext<java.lang.reflect.Method> invocationContext,
                                                org.junit.jupiter.api.extension.ExtensionContext extensionContext)
                                         throws java.lang.Throwable
        Specified by:
        interceptTestTemplateMethod in interface org.junit.jupiter.api.extension.InvocationInterceptor
        Throws:
        java.lang.Throwable
      • checkRequiredAnnotations

        private static void checkRequiredAnnotations​(java.lang.reflect.Method testMethod)
      • verifyNonEmptyInputs

        private static void verifyNonEmptyInputs​(DisableIfAnyArgument annotation)
      • verifyNonEmptyInputs

        private static void verifyNonEmptyInputs​(DisableIfArgument annotation)
      • invalidInputs

        private static org.junit.jupiter.api.extension.ExtensionConfigurationException invalidInputs​(java.lang.Class<?> annotationClass)
      • findArgument

        private java.lang.Object findArgument​(java.lang.reflect.Method testMethod,
                                              java.util.List<java.lang.Object> arguments,
                                              DisableIfArgument annotation,
                                              int index)
      • findArgumentByName

        private java.lang.Object findArgumentByName​(java.lang.reflect.Method testMethod,
                                                    java.util.List<java.lang.Object> arguments,
                                                    java.lang.String name)
      • findParameterIndexFromName

        private int findParameterIndexFromName​(java.lang.reflect.Method testMethod,
                                               java.lang.String name)
      • findArgumentByIndex

        private java.lang.Object findArgumentByIndex​(java.util.List<java.lang.Object> arguments,
                                                     int index)
      • verifyValidIndex

        private void verifyValidIndex​(java.util.List<java.lang.Object> arguments,
                                      int index)