Class TestProcessorHelper.TestRequestBuilder
java.lang.Object
ai.pipestream.module.pipelineprobe.TestProcessorHelper.TestRequestBuilder
- Enclosing class:
TestProcessorHelper
Builder for creating test requests with various configurations.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a builder pre-populated with default pipeline, step, stream, and hop values. -
Method Summary
Modifier and TypeMethodDescriptionai.pipestream.data.module.v1.ProcessDataRequestbuild()Builds theProcessDataRequestwith the configured document, service metadata, and (when any config fields were set) aProcessConfigurationcarrying the JSON config.ai.pipestream.data.v1.PipeStreamDemand-pull fixture: same shape asbuild()forTestProcessor.withAddMetadata(boolean enabled) Sets theaddMetadataconfig field.withDocument(ai.pipestream.data.v1.PipeDoc document) Sets the document to include in the request.withHopNumber(long hopNumber) Sets the current hop number in the request metadata.Sets the processingmodeconfig field to the lower-cased mode name.withPipelineName(String pipelineName) Sets the pipeline name in the request metadata.withSchemaValidation(boolean enabled) Sets therequireSchemaconfig field.withSimulateError(boolean enabled) Sets thesimulateErrorconfig field.withStepName(String stepName) Sets the pipe-step name in the request metadata.withStreamId(String streamId) Sets the stream id in the request metadata.
-
Constructor Details
-
TestRequestBuilder
public TestRequestBuilder()Creates a builder pre-populated with default pipeline, step, stream, and hop values.
-
-
Method Details
-
withDocument
Sets the document to include in the request.- Parameters:
document- the document to process- Returns:
- this builder
-
withPipelineName
Sets the pipeline name in the request metadata.- Parameters:
pipelineName- the pipeline name- Returns:
- this builder
-
withStepName
Sets the pipe-step name in the request metadata.- Parameters:
stepName- the step name- Returns:
- this builder
-
withStreamId
Sets the stream id in the request metadata.- Parameters:
streamId- the stream id- Returns:
- this builder
-
withHopNumber
Sets the current hop number in the request metadata.- Parameters:
hopNumber- the hop number- Returns:
- this builder
-
withMode
Sets the processingmodeconfig field to the lower-cased mode name.- Parameters:
mode- the processing mode- Returns:
- this builder
-
withSchemaValidation
Sets therequireSchemaconfig field.- Parameters:
enabled- whether schema validation is required- Returns:
- this builder
-
withAddMetadata
Sets theaddMetadataconfig field.- Parameters:
enabled- whether metadata should be added during processing- Returns:
- this builder
-
withSimulateError
Sets thesimulateErrorconfig field.- Parameters:
enabled- whether processing should simulate an error- Returns:
- this builder
-
build
public ai.pipestream.data.module.v1.ProcessDataRequest build()Builds theProcessDataRequestwith the configured document, service metadata, and (when any config fields were set) aProcessConfigurationcarrying the JSON config.- Returns:
- the built request
-
buildPipeStream
public ai.pipestream.data.v1.PipeStream buildPipeStream()Demand-pull fixture: same shape asbuild()forTestProcessor.- Returns:
- the built request converted to a
PipeStream
-