Interface DisplayNameGenerator

    • Method Detail

      • generateDisplayNameForClass

        String generateDisplayNameForClass​(Class<?> testClass)
        Generate a display name for the given top-level or static nested test class.
        Parameters:
        testClass - the class generate a name for; never null
        Returns:
        the display name of the container; never null or blank
      • generateDisplayNameForNestedClass

        String generateDisplayNameForNestedClass​(Class<?> nestedClass)
        Generate a display name for the given @Nested inner test class.
        Parameters:
        nestedClass - the class generate a name for; never null
        Returns:
        the display name of the container; never null or blank
      • generateDisplayNameForMethod

        String generateDisplayNameForMethod​(Class<?> testClass,
                                            Method testMethod)
        Generate a display name for the given method.
        Parameters:
        testClass - the class the test method is invoked on; never null
        testMethod - method to generate a display name for; never null
        Returns:
        the display name of the test; never null or blank
        Implementation Note:
        The class instance passed as testClass may differ from the returned class by testMethod.getDeclaringClass(): e.g., when a test method is inherited from a super class.
      • parameterTypesAsString

        static String parameterTypesAsString​(Method method)
        Compile a string representation from all simple parameter type names.
        Parameters:
        method - the method providing parameter types for the result; never null
        Returns:
        a string representation of all parameter types of the supplied method or "()" if the method has no parameters