Class TestProcessorHelper.TestRequestBuilder

java.lang.Object
ai.pipestream.module.pipelineprobe.TestProcessorHelper.TestRequestBuilder
Enclosing class:
TestProcessorHelper

public static class TestProcessorHelper.TestRequestBuilder extends Object
Builder for creating test requests with various configurations.
  • Constructor Details

    • TestRequestBuilder

      public TestRequestBuilder()
      Creates a builder pre-populated with default pipeline, step, stream, and hop values.
  • Method Details

    • withDocument

      public TestProcessorHelper.TestRequestBuilder withDocument(ai.pipestream.data.v1.PipeDoc document)
      Sets the document to include in the request.
      Parameters:
      document - the document to process
      Returns:
      this builder
    • withPipelineName

      public TestProcessorHelper.TestRequestBuilder withPipelineName(String pipelineName)
      Sets the pipeline name in the request metadata.
      Parameters:
      pipelineName - the pipeline name
      Returns:
      this builder
    • withStepName

      public TestProcessorHelper.TestRequestBuilder withStepName(String stepName)
      Sets the pipe-step name in the request metadata.
      Parameters:
      stepName - the step name
      Returns:
      this builder
    • withStreamId

      public TestProcessorHelper.TestRequestBuilder withStreamId(String streamId)
      Sets the stream id in the request metadata.
      Parameters:
      streamId - the stream id
      Returns:
      this builder
    • withHopNumber

      public TestProcessorHelper.TestRequestBuilder withHopNumber(long hopNumber)
      Sets the current hop number in the request metadata.
      Parameters:
      hopNumber - the hop number
      Returns:
      this builder
    • withMode

      Sets the processing mode config field to the lower-cased mode name.
      Parameters:
      mode - the processing mode
      Returns:
      this builder
    • withSchemaValidation

      public TestProcessorHelper.TestRequestBuilder withSchemaValidation(boolean enabled)
      Sets the requireSchema config field.
      Parameters:
      enabled - whether schema validation is required
      Returns:
      this builder
    • withAddMetadata

      public TestProcessorHelper.TestRequestBuilder withAddMetadata(boolean enabled)
      Sets the addMetadata config field.
      Parameters:
      enabled - whether metadata should be added during processing
      Returns:
      this builder
    • withSimulateError

      public TestProcessorHelper.TestRequestBuilder withSimulateError(boolean enabled)
      Sets the simulateError config field.
      Parameters:
      enabled - whether processing should simulate an error
      Returns:
      this builder
    • build

      public ai.pipestream.data.module.v1.ProcessDataRequest build()
      Builds the ProcessDataRequest with the configured document, service metadata, and (when any config fields were set) a ProcessConfiguration carrying the JSON config.
      Returns:
      the built request
    • buildPipeStream

      public ai.pipestream.data.v1.PipeStream buildPipeStream()
      Demand-pull fixture: same shape as build() for TestProcessor.
      Returns:
      the built request converted to a PipeStream