Class DisplayNameFormatter


  • public class DisplayNameFormatter
    extends Object
    Formats a display name using a name pattern and a Combination. This class is more a less a copy of org.junit.jupiter.params.ParameterizedTestNameFormatter from the junit-jupiter-params project.
    • Field Detail

      • DEFAULT_NAME_PATTERN

        public static final String DEFAULT_NAME_PATTERN
        The default name pattern: {combination}
        See Also:
        Constant Field Values
    • Method Detail

      • format

        public static String format​(String namePattern,
                                    Combination combination)
        Formats the combination into a String using a defined name pattern.

        Multiple placeholders are supported: -{index}: given the current invocation index of the test starting with 1 -{combination}: the complete Combination which is tested by the test -{PARAMETER_NAME}: the value of the Parameter with the given name in the currently tested Combination

        Parameters:
        namePattern - the name pattern to format with
        combination - the combination to format with
        Returns:
        the formatted string