Class HttpCondition

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

public class HttpCondition extends AbstractCondition
Tests if an HTTP Endpoint is reachable. The test is successful if the endpoint responds with the expected response code. By default, the HTTP 200 response code is expected.
Since:
2.4
  • Constructor Details

    • HttpCondition

      public HttpCondition()
      Default constructor.
  • Method Details

    • isSatisfied

      public boolean isSatisfied(org.citrusframework.context.TestContext context)
    • getSuccessMessage

      public String getSuccessMessage(org.citrusframework.context.TestContext context)
    • getErrorMessage

      public String getErrorMessage(org.citrusframework.context.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