public class HttpWaitStrategy extends AbstractWaitStrategy
startupTimeout, waitStrategyTarget
Constructor and Description |
---|
HttpWaitStrategy() |
Modifier and Type | Method and Description |
---|---|
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.
|
getLivenessCheckPorts, getRateLimiter, waitUntilReady, withRateLimiter, withStartupTimeout
public 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 withBasicCredentials(java.lang.String username, java.lang.String password)
username
- the usernamepassword
- the passwordpublic HttpWaitStrategy forResponsePredicate(java.util.function.Predicate<java.lang.String> responsePredicate)
responsePredicate
- The predicate to test the response againstprotected void waitUntilReady()
AbstractWaitStrategy
AbstractWaitStrategy.waitStrategyTarget
has started.waitUntilReady
in class AbstractWaitStrategy