Class TransactionCorrelator
java.lang.Object
com.shaft.capture.generate.api.TransactionCorrelator
Finds
VOLATILE response leaves that a later transaction's request reuses (the common
create -> read/update case: a generated ID from a POST response reappears in a later GET's
URL, or a later PATCH's request body), and upgrades them to
LeafClassification.CORRELATED so codegen chains them through a variable
(e.g. String createdOrderId = api.getResponseJSONValue("$.id");) instead of asserting
or replaying a literal. Unmatched VOLATILE leaves are left as-is; codegen falls back to
the recorded literal for those.-
Method Summary
Modifier and TypeMethodDescriptionstatic List<CorrelatedTransaction> correlate(List<ApiTransaction> transactions) Correlates volatile response values across transactions, in encounter (chronological) order.
-
Method Details
-
correlate
Correlates volatile response values across transactions, in encounter (chronological) order. Only later transactions (by list index, matching recording order) are searched, matching how a value can only be reused after it was first observed.- Parameters:
transactions- transactions in recorded order- Returns:
- one
CorrelatedTransactionper input transaction, in the same order
-