Class SHAFT.Contracts
java.lang.Object
com.shaft.driver.SHAFT.Contracts
- Enclosing class:
SHAFT
Controls current-thread HTTP contract recording and validation for browser and API traffic.
Usage example:
SHAFT.Contracts.startRecording("src/test/resources/contracts/checkout.json", "/api/checkout");
api.post("/api/checkout").setRequestBody(order);
SHAFT.Contracts.stopRecording();
SHAFT.Contracts.startAssertMode("src/test/resources/contracts/checkout.json");
api.post("/api/checkout").setRequestBody(order);
SHAFT.Contracts.stopValidation();
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidstartAssertMode(String contractFilePath, String... urlContains) Starts hard-assert validation against a recorded HTTP contract for the current thread.static voidstartRecording(String contractFilePath, String... urlContains) Starts recording selected browser and SHAFT API HTTP traffic for the current thread.static voidstartVerifyMode(String contractFilePath, String... urlContains) Starts soft-verify validation against a recorded HTTP contract for the current thread.static voidWrites the recorded HTTP contract and clears recording mode for the current thread.static voidClears HTTP contract validation mode for the current thread.
-
Method Details
-
startRecording
-
stopRecording
public static void stopRecording()Writes the recorded HTTP contract and clears recording mode for the current thread. -
startAssertMode
-
startVerifyMode
-
stopValidation
public static void stopValidation()Clears HTTP contract validation mode for the current thread.
-