-
-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(#715): Prepare HTTP wait strategy
- Loading branch information
1 parent
768dfd2
commit 1922cc1
Showing
5 changed files
with
54 additions
and
18 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/Testcontainers/Configurations/WaitStrategies/HttpWaitStrategy.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
namespace DotNet.Testcontainers.Configurations | ||
{ | ||
using System; | ||
using System.Threading.Tasks; | ||
using DotNet.Testcontainers.Containers; | ||
using Microsoft.Extensions.Logging; | ||
|
||
public sealed class HttpWaitStrategy : IWaitUntil | ||
{ | ||
private readonly UriBuilder uriBuilder = new UriBuilder(Uri.UriSchemeHttp, "127.0.0.1"); | ||
|
||
public Task<bool> Until(ITestcontainersContainer testcontainers, ILogger logger) | ||
{ | ||
return Task.FromResult(false); | ||
} | ||
|
||
public HttpWaitStrategy ForPath(string path) | ||
{ | ||
this.uriBuilder.Path = path; | ||
return this; | ||
} | ||
|
||
public HttpWaitStrategy UsingTls(bool tlsEnabled = true) | ||
{ | ||
this.uriBuilder.Scheme = tlsEnabled ? Uri.UriSchemeHttps : Uri.UriSchemeHttp; | ||
return this; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters