Class AbstractTestResultConstructor

    • Constructor Detail

      • AbstractTestResultConstructor

        public AbstractTestResultConstructor()
    • Method Detail

      • constructTestRunResult

        public final TestResult constructTestRunResult​(TestResultWrapper holder)
        Description copied from interface: ResultConstructor
        Constructs test case result from wrapper containing framework-specific data.
        Specified by:
        constructTestRunResult in interface ResultConstructor
        Parameters:
        holder - wrapper containing test metadata and framework data
        Returns:
        constructed test case result
      • validateHolder

        protected final void validateHolder​(TestResultWrapper holder)
        Validates that wrapper and its metadata are not null.
        Parameters:
        holder - wrapper to validate
        Throws:
        IllegalArgumentException - if wrapper or metadata is null
      • logTestResultCreation

        protected final void logTestResultCreation​(TestResultWrapper holder,
                                                   boolean hasCustomMessage)
        Logs test result creation details for debugging.
      • buildTestResult

        protected final TestResult.Builder buildTestResult​(TestResultWrapper holder)
        Builds test result with basic metadata and status.
        Parameters:
        holder - wrapper containing test metadata
        Returns:
        test result builder with basic fields populated
      • createExceptionDetails

        protected final ExceptionDetails createExceptionDetails​(Throwable throwable)
        Creates exception details with message and stack trace.
        Parameters:
        throwable - exception to extract details from
        Returns:
        exception details object
      • hasCustomMessage

        protected abstract boolean hasCustomMessage​(TestResultWrapper holder)
        Checks if wrapper contains custom message for the test result.
      • getCustomMessage

        protected abstract String getCustomMessage​(TestResultWrapper holder)
        Extracts custom message from wrapper.
      • createWithCustomMessage

        protected abstract TestResult createWithCustomMessage​(TestResultWrapper holder)
        Creates test result using custom message from wrapper.
      • createWithExceptionDetails

        protected abstract TestResult createWithExceptionDetails​(TestResultWrapper holder)
        Creates test result using exception details from framework-specific data.
      • getFrameworkName

        protected abstract String getFrameworkName()
        Returns name of the test framework for logging purposes.