Class AbstractParameterExtractionHandler

    • Field Detail

      • logger

        protected final org.slf4j.Logger logger
    • Constructor Detail

      • AbstractParameterExtractionHandler

        public AbstractParameterExtractionHandler()
    • Method Detail

      • extractParameters

        public final java.lang.Object extractParameters​(ParameterExtractionContext context)
        Description copied from interface: ParameterExtractionHandler
        Extracts parameters from the test method using this strategy's specific logic.
        Specified by:
        extractParameters in interface ParameterExtractionHandler
        Parameters:
        context - the parameter extraction context containing test method and annotations
        Returns:
        extracted parameter value (single value for simple params, Map for multiple params), or null if extraction fails
      • extractFromDisplayNameWithResult

        protected AbstractParameterExtractionHandler.ParseResult extractFromDisplayNameWithResult​(ParameterExtractionContext context)
        Extracts parameter values from the test display name using regex pattern matching.
        Parameters:
        context - the parameter extraction context
        Returns:
        ParseResult containing the extracted values or failure indicator
      • formatParameters

        protected java.lang.Object formatParameters​(java.lang.Object value,
                                                    ParameterExtractionContext context)
        Formats the extracted parameter values into the final result format.
        Parameters:
        value - the extracted values
        context - the parameter extraction context
        Returns:
        formatted parameter map with proper parameter names
      • createMultiParameterMap

        protected java.util.Map<java.lang.String,​java.lang.Object> createMultiParameterMap​(java.lang.Object[] values,
                                                                                                 ParameterExtractionContext context)
        Creates a parameter map for multiple parameter values.
        Parameters:
        values - the parameter values
        context - the parameter extraction context
        Returns:
        parameter map with named parameters
      • createSingleParameterMap

        protected java.util.Map<java.lang.String,​java.lang.Object> createSingleParameterMap​(java.lang.Object value,
                                                                                                  ParameterExtractionContext context)
        Creates a parameter map for a single parameter value.
        Parameters:
        value - the parameter value
        context - the parameter extraction context
        Returns:
        parameter map with named parameter
      • createGenericParameterMap

        protected java.util.Map<java.lang.String,​java.lang.Object> createGenericParameterMap​(java.lang.Object value)
        Creates a generic parameter map when method information is not available.
        Parameters:
        value - the parameter value or values
        Returns:
        generic parameter map with default parameter names
      • parseTypedValue

        protected java.lang.Object parseTypedValue​(java.lang.String value)
        Parses a string value into its appropriate type with common type conversions.
        Parameters:
        value - the string value to parse
        Returns:
        the parsed typed value (Boolean, Integer, Long, Double, or String)
      • removeQuotes

        protected java.lang.String removeQuotes​(java.lang.String value)
        Removes surrounding quotes from a string value.
        Parameters:
        value - the value to unquote
        Returns:
        the unquoted value
      • parseDisplayNameValue

        protected abstract java.lang.Object parseDisplayNameValue​(java.lang.String valueStr,
                                                                  ParameterExtractionContext context)
        Parses the value from the display name specific to this handler type.
        Parameters:
        valueStr - the value string from the display name
        context - the parameter extraction context
        Returns:
        the parsed values
        Throws:
        java.lang.RuntimeException - if parsing fails and fallback to annotation is required
      • extractFromAnnotation

        protected abstract java.lang.Object extractFromAnnotation​(ParameterExtractionContext context)
        Extracts parameter values from the annotation as a fallback.
        Parameters:
        context - the parameter extraction context
        Returns:
        the extracted values from the annotation