Class HttpCondition

java.lang.Object
org.citrusframework.condition.AbstractCondition
org.citrusframework.condition.HttpCondition
All Implemented Interfaces:
Condition

public class HttpCondition extends AbstractCondition
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 Details

    • HttpCondition

      public HttpCondition()
      Default constructor.
  • Method Details

    • isSatisfied

      public boolean isSatisfied(TestContext context)
    • getSuccessMessage

      public String getSuccessMessage(TestContext context)
    • getErrorMessage

      public String getErrorMessage(TestContext context)
    • openConnection

      protected HttpURLConnection openConnection(URL url) throws IOException
      Open Http url connection.
      Parameters:
      url - The url to open
      Returns:
      The opened connection
      Throws:
      IOException
    • getUrl

      public String getUrl()
    • setUrl

      public void setUrl(String url)
    • getMethod

      public String getMethod()
    • setMethod

      public void setMethod(String method)
    • getTimeout

      public String getTimeout()
    • setTimeout

      public void setTimeout(String timeout)
    • getHttpResponseCode

      public String getHttpResponseCode()
    • setHttpResponseCode

      public void setHttpResponseCode(String httpResponseCode)
    • toString

      public String toString()
      Overrides:
      toString in class Object