Package org.citrusframework.condition
Class HttpCondition
java.lang.Object
org.citrusframework.condition.AbstractCondition
org.citrusframework.condition.HttpCondition
- All Implemented Interfaces:
Condition
Tests if a HTTP Endpoint is reachable. The test is successful if the endpoint responds with the expected response
code. By default a HTTP 200 response code is expected.
- Since:
- 2.4
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetErrorMessage(TestContext context) getSuccessMessage(TestContext context) getUrl()booleanisSatisfied(TestContext context) protected HttpURLConnectionopenConnection(URL url) Open Http url connection.voidsetHttpResponseCode(String httpResponseCode) voidvoidsetTimeout(String timeout) voidtoString()Methods inherited from class org.citrusframework.condition.AbstractCondition
getName
-
Constructor Details
-
HttpCondition
public HttpCondition()Default constructor.
-
-
Method Details
-
isSatisfied
-
getSuccessMessage
-
getErrorMessage
-
openConnection
Open Http url connection.- Parameters:
url- The url to open- Returns:
- The opened connection
- Throws:
IOException
-
getUrl
-
setUrl
-
getMethod
-
setMethod
-
getTimeout
-
setTimeout
-
getHttpResponseCode
-
setHttpResponseCode
-
toString
-