testcontainers-dotnet
testcontainers-dotnet copied to clipboard
feat: Add http wait strategy
Adds external http wait strategy as an extension of IWaitForContainerOS. In doing so, http wait strategy can be chained with OS specific ones. I am opening this PR for feedback.
Todo
- [X] Wait for status code
- [ ] TLS
- [ ] Request headers
- [ ] Basic authentication
- [ ] Response predicate
Example
var waitRequestBuilder = HttpWaitRequest
.ForPort(8024)
.ForPath("/actuator/health")
.ForStatusCode(200)
.WithReadTimeout(TimeSpan.FromSeconds(5));
Wait.ForUnixContainer()
.UntilPortIsAvailable(8024)
.UntilHttpRequestIsCompleted(waitRequestBuilder.build())