Class ApiCaptureGenerator
java.lang.Object
com.shaft.capture.generate.api.ApiCaptureGenerator
Generates, optionally compiles, and optionally replays a
SHAFT.API TestNG class from a
recorded session's API transactions. Mirrors
com.shaft.capture.generate.CaptureGenerator's validate->analyze->render->
compile->replay->report staging, reusing GeneratedTestValidator and
CaptureGenerationReport rather than inventing parallel types.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne transaction's classified response leaves, for a "pin this path" picker UI. -
Constructor Summary
ConstructorsConstructorDescriptionApiCaptureGenerator(CaptureJsonCodec codec, GeneratedTestValidator validator, NetworkBodyStore bodyStore) ApiCaptureGenerator(CaptureJsonCodec codec, GeneratedTestValidator validator, NetworkBodyStore bodyStore, CaptureEnrichmentService enrichmentService) Creates a generator with an injectable AI naming-enrichment service, for tests that need to fake the provider boundary without any network/process call. -
Method Summary
Modifier and TypeMethodDescriptiongenerate(ApiCaptureGenerationRequest request) Generates, validates, and reports oneSHAFT.APItest class.listResponseLeaves(Path sessionPath, List<String> excludedTransactionIds) Lists classified response leaves for each renderable transaction in a recorded session, without generating any test source -- the basis for a "pin this path as a business assertion" picker UI (issue #3530 negative-case).
-
Constructor Details
-
ApiCaptureGenerator
public ApiCaptureGenerator() -
ApiCaptureGenerator
public ApiCaptureGenerator(CaptureJsonCodec codec, GeneratedTestValidator validator, NetworkBodyStore bodyStore) -
ApiCaptureGenerator
public ApiCaptureGenerator(CaptureJsonCodec codec, GeneratedTestValidator validator, NetworkBodyStore bodyStore, CaptureEnrichmentService enrichmentService) Creates a generator with an injectable AI naming-enrichment service, for tests that need to fake the provider boundary without any network/process call.- Parameters:
codec- session codecvalidator- compile/replay validatorbodyStore- network body resolverenrichmentService- AI naming-enrichment service (seeCaptureEnrichmentService.previewApiScenarioName(String, String, List, String, String, ApprovalPolicy))
-
-
Method Details
-
generate
Generates, validates, and reports oneSHAFT.APItest class.- Parameters:
request- generation options- Returns:
- generated artifacts and report
-
listResponseLeaves
public List<ApiCaptureGenerator.TransactionLeaves> listResponseLeaves(Path sessionPath, List<String> excludedTransactionIds) Lists classified response leaves for each renderable transaction in a recorded session, without generating any test source -- the basis for a "pin this path as a business assertion" picker UI (issue #3530 negative-case). ALeafClassification.SENSITIVEleaf's value is never returned, even redacted-in-source values like tokens must not leave this method.- Parameters:
sessionPath- persisted Capture JSON pathexcludedTransactionIds- transaction ids to omit, same semantics asgenerate(ApiCaptureGenerationRequest)- Returns:
- one entry per renderable transaction, in recorded order; empty if the session cannot be read
-