Class HttpResponseValidator
java.lang.Object
org.uitnet.testing.smartfwk.validator.HttpResponseValidator
public class HttpResponseValidator extends Object
Used to validate the HTTP Response received by API Action Handler.
- Author:
- Madhav Krishna
-
Constructor Summary
Constructors Constructor Description HttpResponseValidator(HttpResponse response) -
Method Summary
-
Constructor Details
-
HttpResponseValidator
-
-
Method Details
-
validateExpectedResponseCode
-
validateExpectedHeaderValue
-
validateExpectedHeaderValue
public HttpResponseValidator validateExpectedHeaderValue(String headerName, String expectedValue, TextMatchMechanism textMatchMechanism) -
validateResponsePayloadType
-
validateResponseNotNull
-
validateResponseNotEmpty
-
validateResponseIsNull
-
validateContentType
-
validateMinContentLength
-
validateBodyContainsKeywords
-
validateFileDownloaded
public HttpResponseValidator validateFileDownloaded(String expectedFileName, TextMatchMechanism fileNameMatchMechanism, boolean deleteAfterValidation) -
validateDownloadedFileContainsAllKeywordsInOrder
public HttpResponseValidator validateDownloadedFileContainsAllKeywordsInOrder(boolean shouldPrintFileContentsOnConsole, String... keyWords)Validates the keywords order.- Parameters:
shouldPrintFileContentsOnConsole-keyWords-- Returns:
-
validateDownloadedFileContainsAllKeywords
public HttpResponseValidator validateDownloadedFileContainsAllKeywords(boolean shouldPrintFileContentsOnConsole, String... keyWords)Does not check the order of keywords.- Parameters:
shouldPrintFileContentsOnConsole-keyWords-- Returns:
-
validateDownloadedFileContainsAtLeastNKeyword
public HttpResponseValidator validateDownloadedFileContainsAtLeastNKeyword(boolean shouldPrintFileContentsOnConsole, int atLeastN, boolean inOrder, String... keyWords) -
getExtractedFileContents
-