Package com.shaft.validation
Class RestValidationsBuilder
java.lang.Object
com.shaft.validation.RestValidationsBuilder
-
Constructor Summary
ConstructorDescriptionRestValidationsBuilder
(com.shaft.validation.ValidationEnums.ValidationCategory validationCategory, Object response, StringBuilder reportMessageBuilder) -
Method Summary
Modifier and TypeMethodDescriptionbody()
containsFileContent
(String fileRelativePath) Use this to check if the content of the provided actual response object contains the expected file contentdoesNotContainFileContent
(String fileRelativePath) Use this to check if the content of the provided actual response object does not contain the expected file contentdoesNotEqualFileContent
(String fileRelativePath) Use this to check if the content of the provided actual response object is not equal to the expected file contentdoesNotEqualFileContentIgnoringOrder
(String fileRelativePath) Use this to check if the content of the provided actual response object is not equal to the expected file content (Ignoring Order)doesNotMatchSchema
(String fileRelativePath) Use this to check if the content of the provided actual response object matches the schema for the expected file contentextractedJsonValue
(String jsonPath) Use this to extract a certain value from the provided actual response object and check against itisEqualToFileContent
(String fileRelativePath) Use this to check if the content of the provided actual response object is equal to the expected file contentisEqualToFileContentIgnoringOrder
(String fileRelativePath) Use this to check if the content of the provided actual response object is equal to the expected file content (Ignoring Order)matchesSchema
(String fileRelativePath) Use this to check if the content of the provided actual response object matches the schema for the expected file contenttime()
-
Constructor Details
-
RestValidationsBuilder
public RestValidationsBuilder(com.shaft.validation.ValidationEnums.ValidationCategory validationCategory, Object response, StringBuilder reportMessageBuilder)
-
-
Method Details
-
isEqualToFileContent
Use this to check if the content of the provided actual response object is equal to the expected file content- Parameters:
fileRelativePath
- relative path to the target expected response file- Returns:
- a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
-
isEqualToFileContentIgnoringOrder
Use this to check if the content of the provided actual response object is equal to the expected file content (Ignoring Order)- Parameters:
fileRelativePath
- relative path to the target expected response file- Returns:
- a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
-
doesNotEqualFileContent
Use this to check if the content of the provided actual response object is not equal to the expected file content- Parameters:
fileRelativePath
- relative path to the target expected response file- Returns:
- a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
-
doesNotEqualFileContentIgnoringOrder
Use this to check if the content of the provided actual response object is not equal to the expected file content (Ignoring Order)- Parameters:
fileRelativePath
- relative path to the target expected response file- Returns:
- a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
-
containsFileContent
Use this to check if the content of the provided actual response object contains the expected file content- Parameters:
fileRelativePath
- relative path to the target expected response file- Returns:
- a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
-
doesNotContainFileContent
Use this to check if the content of the provided actual response object does not contain the expected file content- Parameters:
fileRelativePath
- relative path to the target expected response file- Returns:
- a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
-
extractedJsonValue
Use this to extract a certain value from the provided actual response object and check against it- Parameters:
jsonPath
- JSONPath of the target value; the JSONPath expression that will be evaluated in order to extract the desired value [without the trailing $.] , please refer to these urls for examples: https://support.smartbear.com/alertsite/docs/monitors/api/endpoint/jsonpath.html http://jsonpath.com/- Returns:
- a NativeValidationsBuilder object to continue building your validation
-
body
-
time
-
matchesSchema
Use this to check if the content of the provided actual response object matches the schema for the expected file content- Parameters:
fileRelativePath
- relative path to the target expected response file- Returns:
- a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
-
doesNotMatchSchema
Use this to check if the content of the provided actual response object matches the schema for the expected file content- Parameters:
fileRelativePath
- relative path to the target expected response file- Returns:
- a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
-