public class HttpWaitStrategy extends AbstractWaitStrategy
startupTimeout, waitStrategyTarget| Constructor and Description |
|---|
HttpWaitStrategy() |
| Modifier and Type | Method and Description |
|---|---|
HttpWaitStrategy |
allowInsecure()
Indicates that HTTPS connection could use untrusted (self signed) certificate chains.
|
HttpWaitStrategy |
forPath(java.lang.String path)
Waits for the given path.
|
HttpWaitStrategy |
forPort(int port)
Wait for the given port.
|
HttpWaitStrategy |
forResponsePredicate(java.util.function.Predicate<java.lang.String> responsePredicate)
Waits for the response to pass the given predicate
|
HttpWaitStrategy |
forStatusCode(int statusCode)
Waits for the given status code.
|
HttpWaitStrategy |
forStatusCodeMatching(java.util.function.Predicate<java.lang.Integer> statusCodePredicate)
Waits for the status code to pass the given predicate
|
HttpWaitStrategy |
usingTls()
Indicates that the status check should use HTTPS.
|
protected void |
waitUntilReady()
Wait until
AbstractWaitStrategy.waitStrategyTarget has started. |
HttpWaitStrategy |
withBasicCredentials(java.lang.String username,
java.lang.String password)
Authenticate with HTTP Basic Authorization credentials.
|
HttpWaitStrategy |
withHeader(java.lang.String name,
java.lang.String value)
Add a custom HTTP Header to the call.
|
HttpWaitStrategy |
withHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Add multiple custom HTTP Headers to the call.
|
HttpWaitStrategy |
withMethod(java.lang.String method)
Indicates the HTTP method to use (
GET by default). |
HttpWaitStrategy |
withReadTimeout(java.time.Duration timeout)
Set the HTTP connections read timeout.
|
getLivenessCheckPorts, getRateLimiter, waitUntilReady, withRateLimiter, withStartupTimeoutpublic HttpWaitStrategy forStatusCode(int statusCode)
statusCode - the expected status codepublic HttpWaitStrategy forStatusCodeMatching(java.util.function.Predicate<java.lang.Integer> statusCodePredicate)
statusCodePredicate - The predicate to test the response againstpublic HttpWaitStrategy forPath(java.lang.String path)
path - the path to checkpublic HttpWaitStrategy forPort(int port)
port - the given portpublic HttpWaitStrategy usingTls()
public HttpWaitStrategy withMethod(java.lang.String method)
GET by default).method - the HTTP method.public HttpWaitStrategy allowInsecure()
public HttpWaitStrategy withBasicCredentials(java.lang.String username, java.lang.String password)
username - the usernamepassword - the passwordpublic HttpWaitStrategy withHeader(java.lang.String name, java.lang.String value)
name - The HTTP Header namevalue - The HTTP Header valuepublic HttpWaitStrategy withHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
headers - Headers map of name/valuepublic HttpWaitStrategy withReadTimeout(java.time.Duration timeout)
timeout - the timeout (minimum 1 millisecond)public HttpWaitStrategy forResponsePredicate(java.util.function.Predicate<java.lang.String> responsePredicate)
responsePredicate - The predicate to test the response againstprotected void waitUntilReady()
AbstractWaitStrategyAbstractWaitStrategy.waitStrategyTarget has started.waitUntilReady in class AbstractWaitStrategy